forked from 418sec/bson-objectid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjectid.d.ts
More file actions
32 lines (28 loc) · 1023 Bytes
/
objectid.d.ts
File metadata and controls
32 lines (28 loc) · 1023 Bytes
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
// Type definitions for bson-objectid 1.1.5
// Project: bson-objectid
// Definitions by: Marcel Ernst <https://www.marcel-ernst.de>
import { Buffer } from 'buffer';
export default ObjectID;
declare class ObjectID {
static createFromTime(time: number): ObjectID;
static createFromHexString(hexString: string): ObjectID;
static createFromObject(obj: object): ObjectID;
static isValid(hexString: string):boolean;
static isValid(ObjectID: ObjectID):boolean;
static hasRequiredProps(input: object): boolean;
static sanitizeObject(input: object): object;
static generate(): string;
static generate(time: number): string;
static toString():string;
constructor();
constructor(time: number);
constructor(hexString: string);
constructor(idString: string);
constructor(array: number[]);
constructor(buffer: Buffer);
readonly id: string;
readonly str: string;
toHexString(): string;
equals(other: ObjectID): boolean;
getTimestamp(): number;
}