123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302 |
- export declare class Binary extends BSONValue {
- get _bsontype(): 'Binary';
-
-
- static readonly BUFFER_SIZE = 256;
-
- static readonly SUBTYPE_DEFAULT = 0;
-
- static readonly SUBTYPE_FUNCTION = 1;
-
- static readonly SUBTYPE_BYTE_ARRAY = 2;
-
- static readonly SUBTYPE_UUID_OLD = 3;
-
- static readonly SUBTYPE_UUID = 4;
-
- static readonly SUBTYPE_MD5 = 5;
-
- static readonly SUBTYPE_ENCRYPTED = 6;
-
- static readonly SUBTYPE_COLUMN = 7;
-
- static readonly SUBTYPE_USER_DEFINED = 128;
- buffer: Uint8Array;
- sub_type: number;
- position: number;
-
- constructor(buffer?: string | BinarySequence, subType?: number);
-
- put(byteValue: string | number | Uint8Array | number[]): void;
-
- write(sequence: string | BinarySequence, offset: number): void;
-
- read(position: number, length: number): BinarySequence;
-
- value(asRaw?: boolean): string | BinarySequence;
-
- length(): number;
- toJSON(): string;
- toString(encoding?: 'hex' | 'base64' | 'utf8' | 'utf-8'): string;
-
- toUUID(): UUID;
-
- static createFromHexString(hex: string, subType?: number): Binary;
-
- static createFromBase64(base64: string, subType?: number): Binary;
-
- inspect(): string;
- }
- export declare interface BinaryExtended {
- $binary: {
- subType: string;
- base64: string;
- };
- }
- export declare interface BinaryExtendedLegacy {
- $type: string;
- $binary: string;
- }
- export declare type BinarySequence = Uint8Array | number[];
- declare namespace BSON {
- export {
- setInternalBufferSize,
- serialize,
- serializeWithBufferAndIndex,
- deserialize,
- calculateObjectSize,
- deserializeStream,
- UUIDExtended,
- BinaryExtended,
- BinaryExtendedLegacy,
- BinarySequence,
- CodeExtended,
- DBRefLike,
- Decimal128Extended,
- DoubleExtended,
- EJSONOptions,
- Int32Extended,
- LongExtended,
- MaxKeyExtended,
- MinKeyExtended,
- ObjectIdExtended,
- ObjectIdLike,
- BSONRegExpExtended,
- BSONRegExpExtendedLegacy,
- BSONSymbolExtended,
- LongWithoutOverrides,
- TimestampExtended,
- TimestampOverrides,
- LongWithoutOverridesClass,
- SerializeOptions,
- DeserializeOptions,
- Code,
- BSONSymbol,
- DBRef,
- Binary,
- ObjectId,
- UUID,
- Long,
- Timestamp,
- Double,
- Int32,
- MinKey,
- MaxKey,
- BSONRegExp,
- Decimal128,
- BSONValue,
- BSONError,
- BSONVersionError,
- BSONRuntimeError,
- BSONType,
- EJSON,
- Document,
- CalculateObjectSizeOptions
- }
- }
- export { BSON }
- export declare class BSONError extends Error {
-
- get name(): string;
- constructor(message: string);
-
- static isBSONError(value: unknown): value is BSONError;
- }
- export declare class BSONRegExp extends BSONValue {
- get _bsontype(): 'BSONRegExp';
- pattern: string;
- options: string;
-
- constructor(pattern: string, options?: string);
- static parseOptions(options?: string): string;
-
-
- inspect(): string;
- }
- export declare interface BSONRegExpExtended {
- $regularExpression: {
- pattern: string;
- options: string;
- };
- }
- export declare interface BSONRegExpExtendedLegacy {
- $regex: string | BSONRegExp;
- $options: string;
- }
- export declare class BSONRuntimeError extends BSONError {
- get name(): 'BSONRuntimeError';
- constructor(message: string);
- }
- export declare class BSONSymbol extends BSONValue {
- get _bsontype(): 'BSONSymbol';
- value: string;
-
- constructor(value: string);
-
- valueOf(): string;
- toString(): string;
- inspect(): string;
- toJSON(): string;
-
-
- }
- export declare interface BSONSymbolExtended {
- $symbol: string;
- }
- export declare const BSONType: Readonly<{
- readonly double: 1;
- readonly string: 2;
- readonly object: 3;
- readonly array: 4;
- readonly binData: 5;
- readonly undefined: 6;
- readonly objectId: 7;
- readonly bool: 8;
- readonly date: 9;
- readonly null: 10;
- readonly regex: 11;
- readonly dbPointer: 12;
- readonly javascript: 13;
- readonly symbol: 14;
- readonly javascriptWithScope: 15;
- readonly int: 16;
- readonly timestamp: 17;
- readonly long: 18;
- readonly decimal: 19;
- readonly minKey: -1;
- readonly maxKey: 127;
- }>;
- export declare type BSONType = (typeof BSONType)[keyof typeof BSONType];
- export declare abstract class BSONValue {
-
- abstract get _bsontype(): string;
-
- abstract inspect(): string;
-
- }
- export declare class BSONVersionError extends BSONError {
- get name(): 'BSONVersionError';
- constructor();
- }
- export declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number;
- export declare type CalculateObjectSizeOptions = Pick<SerializeOptions, 'serializeFunctions' | 'ignoreUndefined'>;
- export declare class Code extends BSONValue {
- get _bsontype(): 'Code';
- code: string;
- scope: Document | null;
-
- constructor(code: string | Function, scope?: Document | null);
- toJSON(): {
- code: string;
- scope?: Document;
- };
-
-
- inspect(): string;
- }
- export declare interface CodeExtended {
- $code: string;
- $scope?: Document;
- }
- export declare class DBRef extends BSONValue {
- get _bsontype(): 'DBRef';
- collection: string;
- oid: ObjectId;
- db?: string;
- fields: Document;
-
- constructor(collection: string, oid: ObjectId, db?: string, fields?: Document);
-
-
- toJSON(): DBRefLike & Document;
-
-
- inspect(): string;
- }
- export declare interface DBRefLike {
- $ref: string;
- $id: ObjectId;
- $db?: string;
- }
- export declare class Decimal128 extends BSONValue {
- get _bsontype(): 'Decimal128';
- readonly bytes: Uint8Array;
-
- constructor(bytes: Uint8Array | string);
-
- static fromString(representation: string): Decimal128;
-
- static fromStringWithRounding(representation: string): Decimal128;
- private static _fromString;
-
- toString(): string;
- toJSON(): Decimal128Extended;
-
-
- inspect(): string;
- }
- export declare interface Decimal128Extended {
- $numberDecimal: string;
- }
- export declare function deserialize(buffer: Uint8Array, options?: DeserializeOptions): Document;
- export declare interface DeserializeOptions {
-
- useBigInt64?: boolean;
-
- promoteLongs?: boolean;
-
- promoteBuffers?: boolean;
-
- promoteValues?: boolean;
-
- fieldsAsRaw?: Document;
-
- bsonRegExp?: boolean;
-
- allowObjectSmallerThanBufferSize?: boolean;
-
- index?: number;
- raw?: boolean;
-
- validation?: {
- utf8: boolean | Record<string, true> | Record<string, false>;
- };
- }
- export declare function deserializeStream(data: Uint8Array | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number;
- export declare interface Document {
- [key: string]: any;
- }
- export declare class Double extends BSONValue {
- get _bsontype(): 'Double';
- value: number;
-
- constructor(value: number);
-
- valueOf(): number;
- toJSON(): number;
- toString(radix?: number): string;
-
-
- inspect(): string;
- }
- export declare interface DoubleExtended {
- $numberDouble: string;
- }
- export declare const EJSON: {
- parse: typeof parse;
- stringify: typeof stringify;
- serialize: typeof EJSONserialize;
- deserialize: typeof EJSONdeserialize;
- };
- declare function EJSONdeserialize(ejson: Document, options?: EJSONOptions): any;
- export declare type EJSONOptions = {
-
- legacy?: boolean;
-
- relaxed?: boolean;
-
- useBigInt64?: boolean;
- };
- declare function EJSONserialize(value: any, options?: EJSONOptions): Document;
- export declare class Int32 extends BSONValue {
- get _bsontype(): 'Int32';
- value: number;
-
- constructor(value: number | string);
-
- valueOf(): number;
- toString(radix?: number): string;
- toJSON(): number;
-
-
- inspect(): string;
- }
- export declare interface Int32Extended {
- $numberInt: string;
- }
- declare const kId: unique symbol;
- export declare class Long extends BSONValue {
- get _bsontype(): 'Long';
-
- get __isLong__(): boolean;
-
- high: number;
-
- low: number;
-
- unsigned: boolean;
-
- constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean);
- static TWO_PWR_24: Long;
-
- static MAX_UNSIGNED_VALUE: Long;
-
- static ZERO: Long;
-
- static UZERO: Long;
-
- static ONE: Long;
-
- static UONE: Long;
-
- static NEG_ONE: Long;
-
- static MAX_VALUE: Long;
-
- static MIN_VALUE: Long;
-
- static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long;
-
- static fromInt(value: number, unsigned?: boolean): Long;
-
- static fromNumber(value: number, unsigned?: boolean): Long;
-
- static fromBigInt(value: bigint, unsigned?: boolean): Long;
-
- static fromString(str: string, unsigned?: boolean, radix?: number): Long;
-
- static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long;
-
- static fromBytesLE(bytes: number[], unsigned?: boolean): Long;
-
- static fromBytesBE(bytes: number[], unsigned?: boolean): Long;
-
- static isLong(value: unknown): value is Long;
-
- static fromValue(val: number | string | {
- low: number;
- high: number;
- unsigned?: boolean;
- }, unsigned?: boolean): Long;
-
- add(addend: string | number | Long | Timestamp): Long;
-
- and(other: string | number | Long | Timestamp): Long;
-
- compare(other: string | number | Long | Timestamp): 0 | 1 | -1;
-
- comp(other: string | number | Long | Timestamp): 0 | 1 | -1;
-
- divide(divisor: string | number | Long | Timestamp): Long;
-
- div(divisor: string | number | Long | Timestamp): Long;
-
- equals(other: string | number | Long | Timestamp): boolean;
-
- eq(other: string | number | Long | Timestamp): boolean;
-
- getHighBits(): number;
-
- getHighBitsUnsigned(): number;
-
- getLowBits(): number;
-
- getLowBitsUnsigned(): number;
-
- getNumBitsAbs(): number;
-
- greaterThan(other: string | number | Long | Timestamp): boolean;
-
- gt(other: string | number | Long | Timestamp): boolean;
-
- greaterThanOrEqual(other: string | number | Long | Timestamp): boolean;
-
- gte(other: string | number | Long | Timestamp): boolean;
-
- ge(other: string | number | Long | Timestamp): boolean;
-
- isEven(): boolean;
-
- isNegative(): boolean;
-
- isOdd(): boolean;
-
- isPositive(): boolean;
-
- isZero(): boolean;
-
- lessThan(other: string | number | Long | Timestamp): boolean;
-
- lt(other: string | number | Long | Timestamp): boolean;
-
- lessThanOrEqual(other: string | number | Long | Timestamp): boolean;
-
- lte(other: string | number | Long | Timestamp): boolean;
-
- modulo(divisor: string | number | Long | Timestamp): Long;
-
- mod(divisor: string | number | Long | Timestamp): Long;
-
- rem(divisor: string | number | Long | Timestamp): Long;
-
- multiply(multiplier: string | number | Long | Timestamp): Long;
-
- mul(multiplier: string | number | Long | Timestamp): Long;
-
- negate(): Long;
-
- neg(): Long;
-
- not(): Long;
-
- notEquals(other: string | number | Long | Timestamp): boolean;
-
- neq(other: string | number | Long | Timestamp): boolean;
-
- ne(other: string | number | Long | Timestamp): boolean;
-
- or(other: number | string | Long): Long;
-
- shiftLeft(numBits: number | Long): Long;
-
- shl(numBits: number | Long): Long;
-
- shiftRight(numBits: number | Long): Long;
-
- shr(numBits: number | Long): Long;
-
- shiftRightUnsigned(numBits: Long | number): Long;
-
- shr_u(numBits: number | Long): Long;
-
- shru(numBits: number | Long): Long;
-
- subtract(subtrahend: string | number | Long | Timestamp): Long;
-
- sub(subtrahend: string | number | Long | Timestamp): Long;
-
- toInt(): number;
-
- toNumber(): number;
-
- toBigInt(): bigint;
-
- toBytes(le?: boolean): number[];
-
- toBytesLE(): number[];
-
- toBytesBE(): number[];
-
- toSigned(): Long;
-
- toString(radix?: number): string;
-
- toUnsigned(): Long;
-
- xor(other: Long | number | string): Long;
-
- eqz(): boolean;
-
- le(other: string | number | Long | Timestamp): boolean;
- toExtendedJSON(options?: EJSONOptions): number | LongExtended;
- static fromExtendedJSON(doc: {
- $numberLong: string;
- }, options?: EJSONOptions): number | Long | bigint;
- inspect(): string;
- }
- export declare interface LongExtended {
- $numberLong: string;
- }
- export declare type LongWithoutOverrides = new (low: unknown, high?: number | boolean, unsigned?: boolean) => {
- [P in Exclude<keyof Long, TimestampOverrides>]: Long[P];
- };
- export declare const LongWithoutOverridesClass: LongWithoutOverrides;
- export declare class MaxKey extends BSONValue {
- get _bsontype(): 'MaxKey';
-
-
- inspect(): string;
- }
- export declare interface MaxKeyExtended {
- $maxKey: 1;
- }
- export declare class MinKey extends BSONValue {
- get _bsontype(): 'MinKey';
-
-
- inspect(): string;
- }
- export declare interface MinKeyExtended {
- $minKey: 1;
- }
- export declare class ObjectId extends BSONValue {
- get _bsontype(): 'ObjectId';
-
- static cacheHexString: boolean;
-
-
-
- constructor(inputId?: string | number | ObjectId | ObjectIdLike | Uint8Array);
-
- get id(): Uint8Array;
- set id(value: Uint8Array);
-
- toHexString(): string;
-
-
- static generate(time?: number): Uint8Array;
-
- toString(encoding?: 'hex' | 'base64'): string;
-
- toJSON(): string;
-
- equals(otherId: string | ObjectId | ObjectIdLike): boolean;
-
- getTimestamp(): Date;
-
-
- static createFromTime(time: number): ObjectId;
-
- static createFromHexString(hexString: string): ObjectId;
-
- static createFromBase64(base64: string): ObjectId;
-
- static isValid(id: string | number | ObjectId | ObjectIdLike | Uint8Array): boolean;
-
-
- inspect(): string;
- }
- export declare interface ObjectIdExtended {
- $oid: string;
- }
- export declare interface ObjectIdLike {
- id: string | Uint8Array;
- __id?: string;
- toHexString(): string;
- }
- declare function parse(text: string, options?: EJSONOptions): any;
- export declare function serialize(object: Document, options?: SerializeOptions): Uint8Array;
- export declare interface SerializeOptions {
-
- checkKeys?: boolean;
-
- serializeFunctions?: boolean;
-
- ignoreUndefined?: boolean;
-
-
- index?: number;
- }
- export declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Uint8Array, options?: SerializeOptions): number;
- export declare function setInternalBufferSize(size: number): void;
- declare function stringify(value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSONOptions, space?: string | number, options?: EJSONOptions): string;
- export declare class Timestamp extends LongWithoutOverridesClass {
- get _bsontype(): 'Timestamp';
- static readonly MAX_VALUE: Long;
-
- constructor(int: bigint);
-
- constructor(long: Long);
-
- constructor(value: {
- t: number;
- i: number;
- });
- toJSON(): {
- $timestamp: string;
- };
-
- static fromInt(value: number): Timestamp;
-
- static fromNumber(value: number): Timestamp;
-
- static fromBits(lowBits: number, highBits: number): Timestamp;
-
- static fromString(str: string, optRadix: number): Timestamp;
-
-
- inspect(): string;
- }
- export declare interface TimestampExtended {
- $timestamp: {
- t: number;
- i: number;
- };
- }
- export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect';
- export declare class UUID extends Binary {
-
- static cacheHexString: boolean;
-
- constructor(input?: string | Uint8Array | UUID);
-
- get id(): Uint8Array;
- set id(value: Uint8Array);
-
- toHexString(includeDashes?: boolean): string;
-
- toString(encoding?: 'hex' | 'base64'): string;
-
- toJSON(): string;
-
- equals(otherId: string | Uint8Array | UUID): boolean;
-
- toBinary(): Binary;
-
- static generate(): Uint8Array;
-
- static isValid(input: string | Uint8Array | UUID | Binary): boolean;
-
- static createFromHexString(hexString: string): UUID;
-
- static createFromBase64(base64: string): UUID;
-
-
- inspect(): string;
- }
- export declare type UUIDExtended = {
- $uuid: string;
- };
- export { }
|