diff --git a/types/sindresorhus__to-milliseconds/index.d.ts b/types/sindresorhus__to-milliseconds/index.d.ts new file mode 100644 index 0000000000..8eb44b2a7b --- /dev/null +++ b/types/sindresorhus__to-milliseconds/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for @sindresorhus/to-milliseconds 1.0 +// Project: https://github.com/sindresorhus/to-milliseconds +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = toMilliseconds; + +declare function toMilliseconds(input: toMilliseconds.TimeSpec): number; + +declare namespace toMilliseconds { + interface TimeSpec { + days?: number; + hours?: number; + minutes?: number; + seconds?: number; + milliseconds?: number; + microseconds?: number; + nanoseconds?: number; + } +} diff --git a/types/sindresorhus__to-milliseconds/sindresorhus__to-milliseconds-tests.ts b/types/sindresorhus__to-milliseconds/sindresorhus__to-milliseconds-tests.ts new file mode 100644 index 0000000000..aff7ba6fe0 --- /dev/null +++ b/types/sindresorhus__to-milliseconds/sindresorhus__to-milliseconds-tests.ts @@ -0,0 +1,24 @@ +import toMilliseconds = require('@sindresorhus/to-milliseconds'); + +// $ExpectType number +toMilliseconds({ + days: 15, +}); +toMilliseconds({ + hours: 11, +}); +toMilliseconds({ + minutes: 23, +}); +toMilliseconds({ + seconds: 20, +}); +toMilliseconds({ + milliseconds: 1, +}); +toMilliseconds({ + microseconds: 1, +}); +toMilliseconds({ + nanoseconds: 1, +}); diff --git a/types/sindresorhus__to-milliseconds/tsconfig.json b/types/sindresorhus__to-milliseconds/tsconfig.json new file mode 100644 index 0000000000..be9b1a9bec --- /dev/null +++ b/types/sindresorhus__to-milliseconds/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@sindresorhus/to-milliseconds": [ + "sindresorhus__to-milliseconds" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sindresorhus__to-milliseconds-tests.ts" + ] +} diff --git a/types/sindresorhus__to-milliseconds/tslint.json b/types/sindresorhus__to-milliseconds/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sindresorhus__to-milliseconds/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }