forked from cabinjs/bson-objectid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objectid.d.ts
37 lines (29 loc) · 840 Bytes
/
objectid.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
import {Buffer} from 'buffer';
export default ObjectID
declare const ObjectID: ObjectIDCtor;
declare interface ObjectID {
readonly id: string;
readonly str: string;
toHexString(): string;
equals(other: ObjectID): boolean;
getTimestamp(): Date;
}
declare interface ObjectIDCtor {
(): ObjectID
(time: number): ObjectID
(hexString: string): ObjectID
(idString: string): ObjectID
(array: number[]): ObjectID
(buffer: Buffer): ObjectID
new(): ObjectID
new(time: number): ObjectID
new(hexString: string): ObjectID
new(idString: string): ObjectID
new(array: number[]): ObjectID
new(buffer: Buffer): ObjectID
createFromTime(time: number): ObjectID;
createFromHexString(hexString: string): ObjectID;
isValid(hexString: string): boolean;
isValid(ObjectID: ObjectID): boolean;
toString(): string;
}