mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added uniqid definition (#18780)
* Created definitions & tests for pick-weight 🎲
* Fix no-single-module
* Added uniqid definition
This commit is contained in:
parent
1cffe21553
commit
371bffbf56
13
types/uniqid/index.d.ts
vendored
Normal file
13
types/uniqid/index.d.ts
vendored
Normal 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;
|
||||
22
types/uniqid/tsconfig.json
Normal file
22
types/uniqid/tsconfig.json
Normal 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
1
types/uniqid/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
7
types/uniqid/uniqid-tests.ts
Normal file
7
types/uniqid/uniqid-tests.ts
Normal 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 === "") { /**/ }
|
||||
Loading…
Reference in New Issue
Block a user