Restructured to more appropriate type definition

This commit is contained in:
Hinaser
2019-01-26 16:35:44 +09:00
parent f486782118
commit 0bb06233bd
+12 -28
View File
@@ -3,32 +3,16 @@
// Definitions by: Rindo Hinase <https://github.com/Hinaser>
// 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;
}