forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uuid-1345.d.ts
84 lines (74 loc) · 4.32 KB
/
uuid-1345.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Type definitions for uuid-1345 0.99
// Project: https://github.com/scravy/uuid-1345
// Definitions by: TANAKA Koichi <https://github.com/mugeso/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../node/node" />
declare module "uuid-1345" {
export interface UUID {
version: string;
variant: string;
toString(): string;
toBuffer(): Buffer;
}
type UuidTypes = string|Buffer|UUID;
interface ASCIICallback {
(error: string, result: string):void;
}
interface BinaryCallback {
(error: string, result: Buffer):void;
}
interface ObjectCallback {
(error: string, result: UUID):void;
}
export var namespace: {
dns: UUID
url: UUID,
oid: UUID,
x500: UUID
};
export function check(uuid:string|Buffer): {version?:number, variant: string, format: string};
export function parse(uuid:string): Buffer;
export function stringify(uuid:Buffer): string;
export function v1():string;
export function v1(options:{mac?:boolean}):string;
export function v1(options:{encoding:'ascii', mac?:boolean}):string;
export function v1(options:{encoding:'binary', mac?:boolean}):Buffer;
export function v1(options:{encoding:'object', mac?:boolean}):UUID;
export function v1(options:{mac?:boolean}, callback:ASCIICallback):void;
export function v1(options:{encoding:'ascii', mac?:boolean}, callback:ASCIICallback):void;
export function v1(options:{encoding:'binary', mac?:boolean}, callback:BinaryCallback):void;
export function v1(options:{encoding:'object', mac?:boolean}, callback:ObjectCallback):void;
export function v1(callback:ASCIICallback):void;
export function v3(options:{namespace:UuidTypes, name: string}):string;
export function v3(options:{encoding:'ascii', namespace:UuidTypes, name: string}):string;
export function v3(options:{encoding:'binary', namespace:UuidTypes, name: string}):Buffer;
export function v3(options:{encoding:'object', namespace:UuidTypes, name: string}):UUID;
export function v3(options:{namespace:UuidTypes, name: string}, callback:ASCIICallback):void;
export function v3(options:{encoding:'ascii', namespace:UuidTypes, name: string}, callback:ASCIICallback):void;
export function v3(options:{encoding:'binary', namespace:UuidTypes, name: string}, callback:BinaryCallback):void;
export function v3(options:{encoding:'object', namespace:UuidTypes, name: string}, callback:ObjectCallback):void;
export function v4():string;
export function v4(options:{encoding:'ascii'}):string;
export function v4(options:{encoding:'binary'}):Buffer;
export function v4(options:{encoding:'object'}):UUID;
export function v4(options:{encoding:'ascii'}, callback:ASCIICallback):void;
export function v4(options:{encoding:'binary'}, callback:BinaryCallback):void;
export function v4(options:{encoding:'object'}, callback:ObjectCallback):void;
export function v4(callback:ASCIICallback):void;
export function v4fast():string;
export function v4fast(options:{encoding:'ascii'}):string;
export function v4fast(options:{encoding:'binary'}):Buffer;
export function v4fast(options:{encoding:'object'}):UUID;
export function v4fast(options:{encoding:'ascii'}, callback:ASCIICallback):void;
export function v4fast(options:{encoding:'binary'}, callback:BinaryCallback):void;
export function v4fast(options:{encoding:'object'}, callback:ObjectCallback):void;
export function v4fast(callback:ASCIICallback):void;
export function v5(options:{namespace:UuidTypes, name: string}):string;
export function v5(options:{encoding:'ascii', namespace:UuidTypes, name: string}):string;
export function v5(options:{encoding:'binary', namespace:UuidTypes, name: string}):Buffer;
export function v5(options:{encoding:'object', namespace:UuidTypes, name: string}):UUID;
export function v5(options:{namespace:UuidTypes, name: string}, callback:ASCIICallback):void;
export function v5(options:{encoding:'ascii', namespace:UuidTypes, name: string}, callback:ASCIICallback):void;
export function v5(options:{encoding:'binary', namespace:UuidTypes, name: string}, callback:BinaryCallback):void;
export function v5(options:{encoding:'object', namespace:UuidTypes, name: string}, callback:ObjectCallback):void;
}