forked from mongodb/js-bson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbson_value.ts
32 lines (27 loc) · 901 Bytes
/
bson_value.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
import { BSON_MAJOR_VERSION } from './constants';
import { type InspectFn } from './parser/utils';
import { BSON_VERSION_SYMBOL } from './constants';
/** @public */
export abstract class BSONValue {
/** @public */
public abstract get _bsontype(): string;
/** @internal */
get [BSON_VERSION_SYMBOL](): typeof BSON_MAJOR_VERSION {
return BSON_MAJOR_VERSION;
}
[Symbol.for('nodejs.util.inspect.custom')](
depth?: number,
options?: unknown,
inspect?: InspectFn
): string {
return this.inspect(depth, options, inspect);
}
/**
* @public
* Prints a human-readable string of BSON value information
* If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify
*/
public abstract inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;
/** @internal */
abstract toExtendedJSON(): unknown;
}