From 0bb06233bd7a9595be5e4c249955a2b98ce599bc Mon Sep 17 00:00:00 2001 From: Hinaser Date: Sat, 26 Jan 2019 16:35:44 +0900 Subject: [PATCH] Restructured to more appropriate type definition --- types/uuidv4/index.d.ts | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/types/uuidv4/index.d.ts b/types/uuidv4/index.d.ts index e181a39244..44f8fc4efe 100644 --- a/types/uuidv4/index.d.ts +++ b/types/uuidv4/index.d.ts @@ -3,32 +3,16 @@ // Definitions by: Rindo Hinase // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare const uuidv4: UUIDv4; - -interface UUIDv4_is { - (value: string): boolean; -} - -type EmptyUUIDv4 = '00000000-0000-0000-0000-000000000000'; - -interface UUIDv4_empty { - (): string; -} - -interface UUIDv4_FromString { - (text: string): string; -} - -interface UUIDv4 { - (): string; - is: UUIDv4_is; - empty: UUIDv4_empty; - fromString: UUIDv4_FromString; -} - -// If you read this because linter warns you like '... has no default export' -// please try to write import statement like -// import * as uuidv4 from 'uuidv4' -// rather than -// import uuidv4 from 'uuidv4' 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; +}