Spaces:
Running
Running
File size: 1,448 Bytes
78c921d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import { Vector } from '../vector.js';
import { IntBuilder } from './int.js';
import { Dictionary, DataType } from '../type.js';
import { Builder, BuilderOptions } from '../builder.js';
declare type DictionaryHashFunction = (x: any) => string | number;
export interface DictionaryBuilderOptions<T extends DataType = any, TNull = any> extends BuilderOptions<T, TNull> {
dictionaryHashFunction?: DictionaryHashFunction;
}
/** @ignore */
export declare class DictionaryBuilder<T extends Dictionary, TNull = any> extends Builder<T, TNull> {
protected _dictionaryOffset: number;
protected _dictionary?: Vector<T['dictionary']>;
protected _keysToIndices: {
[key: string]: number;
};
readonly indices: IntBuilder<T['indices']>;
readonly dictionary: Builder<T['dictionary']>;
constructor({ 'type': type, 'nullValues': nulls, 'dictionaryHashFunction': hashFn }: DictionaryBuilderOptions<T, TNull>);
get values(): T["indices"]["TArray"] | null;
get nullCount(): number;
get nullBitmap(): Uint8Array | null;
get byteLength(): number;
get reservedLength(): number;
get reservedByteLength(): number;
isValid(value: T['TValue'] | TNull): boolean;
setValid(index: number, valid: boolean): boolean;
setValue(index: number, value: T['TValue']): void;
flush(): import("../data.js").Data<T>;
finish(): this;
clear(): this;
valueToKey(val: any): string | number;
}
export {};
|