Added uniqid definition (#18780)

* Created definitions & tests for pick-weight 🎲

* Fix no-single-module

* Added uniqid definition
This commit is contained in:
Roberts Slisans 2017-08-09 20:31:00 +03:00 committed by Mohamed Hegazy
parent 1cffe21553
commit 371bffbf56
4 changed files with 43 additions and 0 deletions

13
types/uniqid/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for uniqid 4.1
// Project: http://github.com/adamhalasz/diet-uniqid/
// Definitions by: My Self <https://github.com/me>
// 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;

View File

@ -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"
]
}

1
types/uniqid/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -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 === "") { /**/ }