forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-uuid.d.ts
52 lines (41 loc) · 1.54 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
45
46
47
48
49
50
51
52
// 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" />
interface UUIDOptions {
/**
* Node id as Array of 6 bytes (per 4.1.6).
* Default: Randomly generated ID. See note 1.
*/
node: any[]
/**
* (Number between 0 - 0x3fff) RFC clock sequence.
* Default: An internally maintained clockseq is used.
*/
clockseq: number
/**
* (Number | Date) Time in milliseconds since unix Epoch.
* Default: The current time is used.
*/
msecs: any
/**
* (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if msecs is unspecified.
* Default: internal uuid counter is used, as per 4.2.1.2.
*/
nsecs: number
}
interface UUID {
v1(options?: UUIDOptions, buffer?: number[], offset?: number): string
v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
v2(options?: UUIDOptions, buffer?: number[], offset?: number): string
v2(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
v3(options?: UUIDOptions, buffer?: number[], offset?: number): string
v3(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
v4(options?: UUIDOptions, buffer?: number[], offset?: number): string
v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
}
declare module "node-uuid" {
var uuid: UUID;
export = uuid;
}