opusdev/vector-similarity-api
1
1/** @internal */2export const BSON_MAJOR_VERSION = 6;3 4/** @internal */5export const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version');6 7/** @internal */8export const BSON_INT32_MAX = 0x7fffffff;9/** @internal */10export const BSON_INT32_MIN = -0x80000000;11/** @internal */12export const BSON_INT64_MAX = Math.pow(2, 63) - 1;13/** @internal */14export const BSON_INT64_MIN = -Math.pow(2, 63);15 16/**17 * Any integer up to 2^53 can be precisely represented by a double.18 * @internal19 */20export const JS_INT_MAX = Math.pow(2, 53);21 22/**23 * Any integer down to -2^53 can be precisely represented by a double.24 * @internal25 */26export const JS_INT_MIN = -Math.pow(2, 53);27 28/** Number BSON Type @internal */29export const BSON_DATA_NUMBER = 1;30 31/** String BSON Type @internal */32export const BSON_DATA_STRING = 2;33 34/** Object BSON Type @internal */35export const BSON_DATA_OBJECT = 3;36 37/** Array BSON Type @internal */38export const BSON_DATA_ARRAY = 4;39 40/** Binary BSON Type @internal */41export const BSON_DATA_BINARY = 5;42 43/** Binary BSON Type @internal */44export const BSON_DATA_UNDEFINED = 6;45 46/** ObjectId BSON Type @internal */47export const BSON_DATA_OID = 7;48 49/** Boolean BSON Type @internal */50export const BSON_DATA_BOOLEAN = 8;51 52/** Date BSON Type @internal */53export const BSON_DATA_DATE = 9;54 55/** null BSON Type @internal */56export const BSON_DATA_NULL = 10;57 58/** RegExp BSON Type @internal */59export const BSON_DATA_REGEXP = 11;60 61/** Code BSON Type @internal */62export const BSON_DATA_DBPOINTER = 12;63 64/** Code BSON Type @internal */65export const BSON_DATA_CODE = 13;66 67/** Symbol BSON Type @internal */68export const BSON_DATA_SYMBOL = 14;69 70/** Code with Scope BSON Type @internal */71export const BSON_DATA_CODE_W_SCOPE = 15;72 73/** 32 bit Integer BSON Type @internal */74export const BSON_DATA_INT = 16;75 76/** Timestamp BSON Type @internal */77export const BSON_DATA_TIMESTAMP = 17;78 79/** Long BSON Type @internal */80export const BSON_DATA_LONG = 18;81 82/** Decimal128 BSON Type @internal */83export const BSON_DATA_DECIMAL128 = 19;84 85/** MinKey BSON Type @internal */86export const BSON_DATA_MIN_KEY = 0xff;87 88/** MaxKey BSON Type @internal */89export const BSON_DATA_MAX_KEY = 0x7f;90 91/** Binary Default Type @internal */92export const BSON_BINARY_SUBTYPE_DEFAULT = 0;93 94/** Binary Function Type @internal */95export const BSON_BINARY_SUBTYPE_FUNCTION = 1;96 97/** Binary Byte Array Type @internal */98export const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;99 100/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */101export const BSON_BINARY_SUBTYPE_UUID = 3;102 103/** Binary UUID Type @internal */104export const BSON_BINARY_SUBTYPE_UUID_NEW = 4;105 106/** Binary MD5 Type @internal */107export const BSON_BINARY_SUBTYPE_MD5 = 5;108 109/** Encrypted BSON type @internal */110export const BSON_BINARY_SUBTYPE_ENCRYPTED = 6;111 112/** Column BSON type @internal */113export const BSON_BINARY_SUBTYPE_COLUMN = 7;114 115/** Sensitive BSON type @internal */116export const BSON_BINARY_SUBTYPE_SENSITIVE = 8;117 118/** Binary User Defined Type @internal */119export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128;120 121/** @public */122export const BSONType = Object.freeze({123 double: 1,124 string: 2,125 object: 3,126 array: 4,127 binData: 5,128 undefined: 6,129 objectId: 7,130 bool: 8,131 date: 9,132 null: 10,133 regex: 11,134 dbPointer: 12,135 javascript: 13,136 symbol: 14,137 javascriptWithScope: 15,138 int: 16,139 timestamp: 17,140 long: 18,141 decimal: 19,142 minKey: -1,143 maxKey: 127144} as const);145 146/** @public */147export type BSONType = (typeof BSONType)[keyof typeof BSONType];148 