mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for uuidv4 2.0
|
||||
// Project: https://github.com/thenativeweb/uuidv4#readme
|
||||
// Definitions by: Rindo Hinase <https://github.com/Hinaser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = uuidv4;
|
||||
|
||||
declare function uuidv4(): string;
|
||||
|
||||
declare namespace uuidv4 {
|
||||
type EmptyUUIDv4 = '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
function is(value: string): boolean;
|
||||
|
||||
function empty(): string;
|
||||
|
||||
function fromString(text: string): string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"strictFunctionTypes": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"uuidv4-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,13 @@
|
||||
import * as uuidv4 from 'uuidv4'; // uuidv4 is () => string
|
||||
|
||||
// $ExpectType string
|
||||
uuidv4();
|
||||
|
||||
// $ExpectType string
|
||||
uuidv4.empty();
|
||||
|
||||
// $ExpectType boolean
|
||||
uuidv4.is('00000000-0000-0000-0000-000000000000');
|
||||
|
||||
// $ExpectType string
|
||||
uuidv4.fromString("test");
|
||||
Reference in New Issue
Block a user