/** * Shared utilities for Native format codec. */ export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array | Float32Array | Float64Array; export interface ColumnDef { name: string; type: string; } export interface DecodeOptions { /** Decode Map types as Array<[K, V]> instead of Map to preserve duplicate keys */ mapAsArray?: boolean; /** Client version or protocol revision (e.g. 54454) */ clientVersion?: number; /** Decode Enum types as numeric values instead of string names (default: false = strings) */ enumAsNumber?: boolean; } export interface EnumMapping { nameToValue: Map; valueToName: Map; } /** * Parse a ClickHouse Enum type definition string into bidirectional name↔value maps. * Grammar: Enum8('name1' = val1, 'name2' = val2, ...) * Enum16('name1' = val1, 'name2' = val2, ...) * Enum8 values are Int8 (-128..127), Enum16 values are Int16 (-32768..32767). * Names and values must each be unique — duplicates cause a null return. */ export declare function parseEnumDefinition(type: string): EnumMapping | null; export declare const TEXT_ENCODER: import("util").TextEncoder; export declare const TEXT_DECODER: import("util").TextDecoder; /** * Wraps a ClickHouse DateTime64 value as raw ticks at a given precision. * Precision N means the tick unit is 10^-N seconds: * 0 = seconds, 3 = milliseconds, 6 = microseconds, 9 = nanoseconds. * JS Date only supports millisecond resolution, so sub-ms values can't round-trip * through Date without loss — use .ticks directly for those. */ export declare class ClickHouseDateTime64 { ticks: bigint; precision: number; private pow; constructor(ticks: bigint, precision: number); /** * Convert to native Date object. * Throws if value overflows JS Date range or precision is lost (sub-millisecond components). */ toDate(): Date; /** * Convert to native Date object, truncating sub-millisecond precision and clamping to JS Date range. * Unlike toDate(), this never throws — useful for display/logging where lossiness is acceptable. */ toClosestDate(): Date; toJSON(): string; toString(): string; } /** * Explicit-typed value for a Dynamic column, e.g. `new DynamicValue("Float64", 3)`. * Bypasses guessType so a value is stored as a specific ClickHouse type (Int8 vs * Int64, Float64 vs Int64) instead of one inferred from its JS runtime form. */ export declare class DynamicValue { readonly type: string; readonly value: unknown; constructor(type: string, value: unknown); } /** * A Variant cell tagged with its arm discriminator (in the ClickHouse-sorted * arm order), e.g. `new VariantValue(1, 42n)`. `VariantColumn.get` returns * these on decode; on encode, wrap a value to force a specific arm instead of * relying on runtime-type inference. */ export declare class VariantValue { readonly discriminator: number; readonly value: unknown; constructor(discriminator: number, value: unknown); } //# sourceMappingURL=types.d.ts.map