BsonDecoder.d.ts 956 B

12345678910111213141516171819202122
  1. import { BsonBinary, BsonDbPointer, BsonDecimal128, BsonJavascriptCodeWithScope, BsonObjectId, BsonTimestamp } from './values';
  2. import type { IReader, IReaderResettable } from '@jsonjoy.com/buffers/lib';
  3. import type { BinaryJsonDecoder } from '../types';
  4. export declare class BsonDecoder implements BinaryJsonDecoder {
  5. reader: IReader & IReaderResettable;
  6. constructor(reader?: IReader & IReaderResettable);
  7. read(uint8: Uint8Array): unknown;
  8. decode(uint8: Uint8Array): unknown;
  9. readAny(): unknown;
  10. readDocument(): Record<string, unknown>;
  11. readCString(): string;
  12. readString(): string;
  13. readElementValue(type: number): unknown;
  14. readArray(): unknown[];
  15. readBinary(): BsonBinary | Uint8Array;
  16. readObjectId(): BsonObjectId;
  17. readRegex(): RegExp;
  18. readDbPointer(): BsonDbPointer;
  19. readCodeWithScope(): BsonJavascriptCodeWithScope;
  20. readTimestamp(): BsonTimestamp;
  21. readDecimal128(): BsonDecimal128;
  22. }