diff --git a/types/uniqid/index.d.ts b/types/uniqid/index.d.ts new file mode 100644 index 0000000000..e3853a64a3 --- /dev/null +++ b/types/uniqid/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for uniqid 4.1 +// Project: http://github.com/adamhalasz/diet-uniqid/ +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Commmon function signature +declare function f(prefix: string): string; + +// let x -> Workaround for ES6 imports +// Combined type because of assigning to function object in original module +declare let x: typeof f & { process: typeof f } & { time: typeof f }; + +export = x; diff --git a/types/uniqid/tsconfig.json b/types/uniqid/tsconfig.json new file mode 100644 index 0000000000..437a215958 --- /dev/null +++ b/types/uniqid/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "uniqid-tests.ts" + ] +} diff --git a/types/uniqid/tslint.json b/types/uniqid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/uniqid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/uniqid/uniqid-tests.ts b/types/uniqid/uniqid-tests.ts new file mode 100644 index 0000000000..f0f56aa2fd --- /dev/null +++ b/types/uniqid/uniqid-tests.ts @@ -0,0 +1,7 @@ +import * as uniqid from "uniqid"; + +const uniqueID = uniqid("123"); +const processString = uniqid.process("123"); +const timeString = uniqid.time("123"); + +if (uniqueID === "" && processString === "" && timeString === "") { /**/ }