import { Vector } from './vector.js'; import { BufferType } from './enum.js'; import { DataType } from './type.js'; /** @ignore */ export declare type kUnknownNullCount = -1; /** @ignore */ export declare const kUnknownNullCount = -1; /** @ignore */ export declare type NullBuffer = Uint8Array | null | undefined; /** @ignore */ export declare type TypeIdsBuffer = Int8Array | ArrayLike | Iterable | undefined; /** @ignore */ export declare type ValueOffsetsBuffer = Int32Array | ArrayLike | Iterable | undefined; /** @ignore */ export declare type DataBuffer = T['TArray'] | ArrayLike | Iterable | undefined; /** @ignore */ export interface Buffers { [BufferType.OFFSET]: Int32Array; [BufferType.DATA]: T['TArray']; [BufferType.VALIDITY]: Uint8Array; [BufferType.TYPE]: T['TArray']; } /** @ignore */ export interface Data { readonly TType: T['TType']; readonly TArray: T['TArray']; readonly TValue: T['TValue']; } /** * Data structure underlying {@link Vector}s. Use the convenience method {@link makeData}. */ export declare class Data { readonly type: T; readonly length: number; readonly offset: number; readonly stride: number; readonly nullable: boolean; readonly children: Data[]; /** * The dictionary for this Vector, if any. Only used for Dictionary type. */ dictionary?: Vector; readonly values: Buffers[BufferType.DATA]; readonly typeIds: Buffers[BufferType.TYPE]; readonly nullBitmap: Buffers[BufferType.VALIDITY]; readonly valueOffsets: Buffers[BufferType.OFFSET]; get typeId(): T['TType']; get ArrayType(): T['ArrayType']; get buffers(): Buffers; get byteLength(): number; protected _nullCount: number | kUnknownNullCount; get nullCount(): number; constructor(type: T, offset: number, length: number, nullCount?: number, buffers?: Partial> | Data, children?: Data[], dictionary?: Vector); getValid(index: number): boolean; setValid(index: number, value: boolean): boolean; clone(type?: R, offset?: number, length?: number, nullCount?: number, buffers?: Buffers, children?: Data[]): Data; slice(offset: number, length: number): Data; _changeLengthAndBackfillNullBitmap(newLength: number): Data; protected _sliceBuffers(offset: number, length: number, stride: number, typeId: T['TType']): Buffers; protected _sliceChildren(children: Data[], offset: number, length: number): Data[]; } import { Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Int, Date_, Interval, Time, Timestamp, Union, DenseUnion, SparseUnion } from './type.js'; /** @ignore */ interface DataProps_ { type: T; offset?: number; length?: number; nullCount?: number; nullBitmap?: NullBuffer; } interface NullDataProps { type: T; offset?: number; length?: number; } interface IntDataProps extends DataProps_ { data?: DataBuffer; } interface DictionaryDataProps extends DataProps_ { data?: DataBuffer; dictionary?: Vector; } interface FloatDataProps extends DataProps_ { data?: DataBuffer; } interface BoolDataProps extends DataProps_ { data?: DataBuffer; } interface DecimalDataProps extends DataProps_ { data?: DataBuffer; } interface Date_DataProps extends DataProps_ { data?: DataBuffer; } interface TimeDataProps extends DataProps_ { data?: DataBuffer; } interface TimestampDataProps extends DataProps_ { data?: DataBuffer; } interface IntervalDataProps extends DataProps_ { data?: DataBuffer; } interface FixedSizeBinaryDataProps extends DataProps_ { data?: DataBuffer; } interface BinaryDataProps extends DataProps_ { valueOffsets: ValueOffsetsBuffer; data?: DataBuffer; } interface Utf8DataProps extends DataProps_ { valueOffsets: ValueOffsetsBuffer; data?: DataBuffer; } interface ListDataProps extends DataProps_ { valueOffsets: ValueOffsetsBuffer; child: Data; } interface FixedSizeListDataProps extends DataProps_ { child: Data; } interface StructDataProps extends DataProps_ { children: Data[]; } interface Map_DataProps extends DataProps_ { valueOffsets: ValueOffsetsBuffer; child: Data; } interface SparseUnionDataProps extends DataProps_ { typeIds: TypeIdsBuffer; children: Data[]; } interface DenseUnionDataProps extends DataProps_ { typeIds: TypeIdsBuffer; children: Data[]; valueOffsets: ValueOffsetsBuffer; } interface UnionDataProps extends DataProps_ { typeIds: TypeIdsBuffer; children: Data[]; valueOffsets?: ValueOffsetsBuffer; } export declare type DataProps = (T extends Null ? NullDataProps : T extends Int ? IntDataProps : T extends Dictionary ? DictionaryDataProps : T extends Float ? FloatDataProps : T extends Bool ? BoolDataProps : T extends Decimal ? DecimalDataProps : T extends Date_ ? Date_DataProps : T extends Time ? TimeDataProps : T extends Timestamp ? TimestampDataProps : T extends Interval ? IntervalDataProps : T extends FixedSizeBinary ? FixedSizeBinaryDataProps : T extends Binary ? BinaryDataProps : T extends Utf8 ? Utf8DataProps : T extends List ? ListDataProps : T extends FixedSizeList ? FixedSizeListDataProps : T extends Struct ? StructDataProps : T extends Map_ ? Map_DataProps : T extends SparseUnion ? SparseUnionDataProps : T extends DenseUnion ? DenseUnionDataProps : T extends Union ? UnionDataProps : DataProps_); export declare function makeData(props: NullDataProps): Data; export declare function makeData(props: IntDataProps): Data; export declare function makeData(props: DictionaryDataProps): Data; export declare function makeData(props: FloatDataProps): Data; export declare function makeData(props: BoolDataProps): Data; export declare function makeData(props: DecimalDataProps): Data; export declare function makeData(props: Date_DataProps): Data; export declare function makeData(props: TimeDataProps): Data; export declare function makeData(props: TimestampDataProps): Data; export declare function makeData(props: IntervalDataProps): Data; export declare function makeData(props: FixedSizeBinaryDataProps): Data; export declare function makeData(props: BinaryDataProps): Data; export declare function makeData(props: Utf8DataProps): Data; export declare function makeData(props: ListDataProps): Data; export declare function makeData(props: FixedSizeListDataProps): Data; export declare function makeData(props: StructDataProps): Data; export declare function makeData(props: Map_DataProps): Data; export declare function makeData(props: SparseUnionDataProps): Data; export declare function makeData(props: DenseUnionDataProps): Data; export declare function makeData(props: UnionDataProps): Data; export declare function makeData(props: DataProps_): Data; export {};