import duckdb from '@duckdb/node-bindings'; import { DuckDBVariantType } from '../DuckDBType'; import { DuckDBVariantValue } from '../values'; import { DuckDBVector } from './DuckDBVector'; import { DuckDBStructVector } from './DuckDBStructVector'; export declare class DuckDBVariantVector extends DuckDBVector { private readonly structVec; private readonly keysList; private readonly childrenList; private readonly valuesList; private readonly dataBlob; private readonly keysEntry; private readonly keysIdxVec; private readonly valuesIdxVec; private readonly typeIdVec; private readonly byteOffsetVec; constructor(structVec: DuckDBStructVector); static fromRawVector(vector: duckdb.Vector, itemCount: number): DuckDBVariantVector; get type(): DuckDBVariantType; get itemCount(): number; getItem(itemIndex: number): DuckDBVariantValue | null; setItem(_itemIndex: number, value: DuckDBVariantValue | null): void; flush(): void; slice(offset: number, length: number): DuckDBVariantVector; /** * Decode one variant node identified by its row-local `valueIndex` * (an index into the row's `values` list). Per-row state is bundled in * `row`: the data blob plus the row-local list slice extents and the * absolute backing-array offsets they begin at. All recursive calls * share the same `row`; only `valueIndex` changes. * * Returns both the decoded value and the `DuckDBType` corresponding to * the node's on-disk tag, so the top-level caller can attach the type * to the resulting `DuckDBVariantValue` for round-trip fidelity. * * Throws if any index decoded from the blob falls outside its row-local * list slice — guards against malformed or hostile VARIANT payloads. */ private decodeNode; /** Bounds-check an OBJECT / ARRAY's `[childrenIdx, childrenIdx+childCount)` range. */ private checkChildrenSlice; }