/** * BJData encoder (Draft 4, and the Draft 5 structure-of-arrays containers and extensions). * * Copyright (c) 2019-2026 Qianqian Fang . Apache License 2.0. */ export interface EncodeOptions { /** write the count (#) of arrays and objects instead of an end marker (default false) */ count?: boolean; /** pack arrays of numbers into typed containers ([$type#n]), and rectangular nested arrays of * numbers into N-D ones ([$type#[dims]]) (default false; typed arrays are always packed) */ pack?: boolean; /** store a non-integer number as float32 ([d]) when that is exact (default false: [D]) */ float32?: boolean; /** write arrays of objects that share their keys and value types as a structure-of-arrays: * 'row' ([$), 'col' ({$), or false (default) */ soa?: false | 'row' | 'col'; /** the fewest records written as a structure-of-arrays (default 2) */ soaThreshold?: number; /** write the keys of each object sorted (default false) */ sortKeys?: boolean; /** Date values: 'string' (default, ISO 8601 as JSON.stringify), 'extension' (datetime_us) */ date?: 'string' | 'extension'; /** byte order: 'little' (BJData, default) or 'big' (UBJSON) */ endian?: 'little' | 'big'; /** called for a value that has no BJData form (a function, symbol, ...); its result is * written instead; default: such values are skipped in objects, null in arrays */ replacer?: (value: any) => any; /** maximum nesting (default 1000) */ maxDepth?: number; } export declare class Encoder { private buf; private v; pos: number; private little; private o; private stack; private maxDepth; constructor(opts?: EncodeOptions); /** The bytes written so far. */ result(): Uint8Array; private ensure; private byte; private marker; /** A number of marker m without its marker. */ private raw; /** An integer (|x| <= 2^53) with the marker pybj picks. */ private int; private bigint; private highprec; private bytes; /** A string's length and bytes (a key, or the payload of [S]). */ private str; private number; /** Writes one value. */ value(x: any): void; private depth; private enter; /** The members of an object (as JSON: undefined, functions and symbols are left out, unless * the replacer gives them a value). */ private plain; private object; private array; /** [$m#n payload] or [$m#[dims] payload]. */ private packed; /** The numbers vals of marker m at p, p + st, p + 2 st, ... (room already ensured). */ private column; private dims; /** A JData N-D array object {_ArrayType_, _ArraySize_, _ArrayData_: TypedArray} (nothing else * but _ArrayOrder_), or an ndarray-like value (numjs, scijs ndarray), as a packed N-D array. */ private ndobject; private soa; private schemaOut; } /** The BJData bytes of a value. */ export declare function dumpb(value: any, opts?: EncodeOptions): Uint8Array;