From 12e28d0e287d0a2fe41700639cb6e2f891c0ac0a Mon Sep 17 00:00:00 2001 From: Vince Picone Date: Thu, 7 Feb 2019 09:49:53 -0600 Subject: [PATCH 1/3] Add carbon motion --- types/carbon__motion/carbon__motion-tests.ts | 0 types/carbon__motion/index.d.ts | 28 ++++++++++++++++++++ types/carbon__motion/tsconfig.json | 19 +++++++++++++ types/carbon__motion/tslint.json | 1 + 4 files changed, 48 insertions(+) create mode 100644 types/carbon__motion/carbon__motion-tests.ts create mode 100644 types/carbon__motion/index.d.ts create mode 100644 types/carbon__motion/tsconfig.json create mode 100644 types/carbon__motion/tslint.json diff --git a/types/carbon__motion/carbon__motion-tests.ts b/types/carbon__motion/carbon__motion-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/carbon__motion/index.d.ts b/types/carbon__motion/index.d.ts new file mode 100644 index 0000000000..9570133327 --- /dev/null +++ b/types/carbon__motion/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for carbon__motion-ts 0.0 +// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const easings: { + entrance: { + expressive: string; + productive: string; + }; + exit: { + expressive: string; + productive: string; + }; + standard: { + expressive: string; + productive: string; + }; +}; + +export function motion(name: any, mode: any): any; + +export namespace motion { + const prototype: { + }; + +} + diff --git a/types/carbon__motion/tsconfig.json b/types/carbon__motion/tsconfig.json new file mode 100644 index 0000000000..38245c7c9e --- /dev/null +++ b/types/carbon__motion/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@carbon/motion": ["carbon__motion"] + } + }, + "files": ["index.d.ts", "carbon__motion-tests.ts"] +} diff --git a/types/carbon__motion/tslint.json b/types/carbon__motion/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/carbon__motion/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6eea5834fa91716914c604464c4fd4d2ba032ac8 Mon Sep 17 00:00:00 2001 From: Vince Picone Date: Thu, 7 Feb 2019 09:56:03 -0600 Subject: [PATCH 2/3] add tests --- types/carbon__motion/carbon__motion-tests.ts | 8 ++++++++ types/carbon__motion/index.d.ts | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/types/carbon__motion/carbon__motion-tests.ts b/types/carbon__motion/carbon__motion-tests.ts index e69de29bb2..6bcc820f5d 100644 --- a/types/carbon__motion/carbon__motion-tests.ts +++ b/types/carbon__motion/carbon__motion-tests.ts @@ -0,0 +1,8 @@ +import { easings, motion } from "@carbon/motion"; + +const easingNames = Object.keys(easings); + +const firstEasing = easingNames[0]; +const firstMode = Object.keys(firstEasing)[0]; + +motion(firstEasing, firstMode); diff --git a/types/carbon__motion/index.d.ts b/types/carbon__motion/index.d.ts index 9570133327..5027843174 100644 --- a/types/carbon__motion/index.d.ts +++ b/types/carbon__motion/index.d.ts @@ -18,11 +18,8 @@ export const easings: { }; }; -export function motion(name: any, mode: any): any; +export function motion(name: string, mode: string): string; export namespace motion { - const prototype: { - }; - + const prototype: {}; } - From d69938c98f79fdf9f948e47fdd7f6ba68c42ccfe Mon Sep 17 00:00:00 2001 From: Vince Picone Date: Thu, 7 Feb 2019 10:06:01 -0600 Subject: [PATCH 3/3] fix headers --- types/carbon__motion/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/carbon__motion/index.d.ts b/types/carbon__motion/index.d.ts index 5027843174..173687d04c 100644 --- a/types/carbon__motion/index.d.ts +++ b/types/carbon__motion/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for carbon__motion-ts 0.0 -// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) -// Definitions by: My Self +// Type definitions for @carbon/motion 0.0 +// Project: https://github.com/IBM/carbon-elements/tree/master/packages/motion +// Definitions by: Vince Picone // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export const easings: {