forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-uuid.d.ts
44 lines (37 loc) · 1.71 KB
/
node-uuid.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
// Type definitions for node-uuid.js
// Project: https://github.com/broofa/node-uuid
// Definitions by: Jeff May <https://github.com/jeffmay>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="./node-uuid-base.d.ts" />
/// <reference path="./node-uuid-cjs.d.ts" />
/**
* Definitions for use in node environment
*
* !! For browser enviroments, use node-uuid-global or node-uuid-cjs
*/
declare module __NodeUUID {
/**
* Overloads for node environment
* We need to duplicate some declarations because
* interface merging doesn't work with overloads
*/
interface UUID {
v1(options?: UUIDOptions): string;
v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
v2(options?: UUIDOptions): string;
v2(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v2(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
v3(options?: UUIDOptions): string;
v3(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v3(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
v4(options?: UUIDOptions): string;
v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
parse(id: string, buffer?: number[], offset?: number): number[];
parse(id: string, buffer?: Buffer, offset?: number): Buffer;
unparse(buffer: number[], offset?: number): string;
unparse(buffer: Buffer, offset?: number): string;
}
}