forked from novemberborn/ksuid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
23 lines (23 loc) · 767 Bytes
/
index.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
/// <reference types="node" />
declare class KSUID {
constructor(buffer: Buffer);
readonly raw: Buffer;
readonly date: Date;
readonly timestamp: number;
readonly payload: Buffer;
readonly string: string;
compare(other: KSUID): number;
equals(other: KSUID): boolean;
toString(): string;
toJSON(): string;
static random(): Promise<KSUID>;
static random(timeInMs: number): Promise<KSUID>;
static random(date: Date): Promise<KSUID>;
static randomSync(): KSUID;
static randomSync(timeInMs: number): KSUID;
static randomSync(date: Date): KSUID;
static fromParts(timeInMs: number, payload: Buffer): KSUID;
static isValid(buffer: Buffer): boolean;
static parse(str: string): KSUID;
}
export = KSUID