diff --git a/types/carbon__type/carbon__type-tests.ts b/types/carbon__type/carbon__type-tests.ts index e69de29bb2..a5d4cf7b8b 100644 --- a/types/carbon__type/carbon__type-tests.ts +++ b/types/carbon__type/carbon__type-tests.ts @@ -0,0 +1,6 @@ +import { fontFamily, fontWeight, getTypeSize, print } from "@carbon/type"; + +fontFamily("mono"); // $ExpectType { fontFamily: string; } +fontWeight("light"); // $ExpectType { fontWeight: number; } +print(fontFamily("mono")); // $ExpectType string +getTypeSize(2); // $ExpectType number diff --git a/types/carbon__type/index.d.ts b/types/carbon__type/index.d.ts index af79ee812b..7933f2e358 100644 --- a/types/carbon__type/index.d.ts +++ b/types/carbon__type/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/IBM/carbon-elements/tree/master/packages/type // Definitions by: Vince Picone // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export const bodyLong01: { fontFamily: string; @@ -692,13 +693,21 @@ export const styles: { }; }; -export function fontFamily(name: any): any; +export function fontFamily( + name: string +): { + fontFamily: string; +}; -export function fontWeight(weight: any): any; +export function fontWeight( + weight: string +): { + fontWeight: number; +}; -export function getTypeSize(step: any): any; +export function getTypeSize(step: number): number; -export function print(block: any): any; +export function print(block: object): string; export namespace fontFamily { const prototype: {};