diff --git a/parse-unit/index.d.ts b/parse-unit/index.d.ts new file mode 100644 index 0000000000..238f3cfc06 --- /dev/null +++ b/parse-unit/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for parse-unit 1.0 +// Project: https://github.com/mattdesl/parse-unit +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function parse(value: string): [number, string]; +export = parse; diff --git a/parse-unit/parse-unit-tests.ts b/parse-unit/parse-unit-tests.ts new file mode 100644 index 0000000000..772641c302 --- /dev/null +++ b/parse-unit/parse-unit-tests.ts @@ -0,0 +1,4 @@ +import parse = require('parse-unit') +let [number, length] = parse('10px') +number === 50 +length === 'px' diff --git a/parse-unit/tsconfig.json b/parse-unit/tsconfig.json new file mode 100644 index 0000000000..4f0a626508 --- /dev/null +++ b/parse-unit/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "parse-unit-tests.ts" + ] +} diff --git a/parse-unit/tslint.json b/parse-unit/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/parse-unit/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }