import { DataTypeFieldConfig, Maybe, SortOrder, DataTypeFields, ReadonlyDataTypeFields } from '@terascope/types'; import { SerializeOptions, Vector } from '../vector/index.js'; import { ColumnOptions } from './interfaces.js'; type NameType = (number | string | symbol); /** * A single column of values with the same data type. * * Changing the values is safe as long the length doesn't change. * When adding or removing values it is better to create a new Column. */ export declare class Column { /** * Create a Column from an array of values */ static fromJSON(name: F, config: Readonly, values?: Maybe[] | readonly Maybe[], version?: number, childConfig?: DataTypeFields | ReadonlyDataTypeFields): Column; /** * Create a Column from the custom serialized format */ static deserialize(columnConfig: Buffer | string): Column; /** * The field name for the column */ name: N; /** * The DataType version to use for the field definition */ readonly version: number; readonly vector: Vector; /** * Get the Data Type field configuration. */ readonly config: Readonly; constructor(vector: Vector, options: ColumnOptions | Readonly>); /** * Iterate over each value, this is returned in the stored value format. * And may not be compatible with the JSON spec. */ [Symbol.iterator](): IterableIterator>; /** * Returns the size of the column */ get size(): number; /** * A Unique ID for the Column. * The ID should only change if the data vector changes. */ get id(): string; /** * Rename the column */ rename(name: K): Column; /** * Create a new Column with the same metadata but with different data */ fork(vector: Vector): Column; /** * Sort the column */ sort(direction?: SortOrder): Column; /** * Get the unique values. This doesn't change the * the size, it just drops the duplicate values. * @example * [null, 1, 3, 2, 2, null, 1] => [null, 1, 3, 2, null, null, null] */ unique(): Column; isEmpty(): boolean; /** * Average all of the values in the Column */ avg(): number | bigint; /** * Sum all of the values in the Column */ sum(): number | bigint; /** * Find the minimum value in the Column */ min(): number | bigint; /** * Find the maximum value in the Column */ max(): number | bigint; /** * Select the child fields with in a given vector. * This involves recreating the whole column in * most cases. */ selectSubFields(fields: Iterable): Column; /** * Convert the Column an array of values (the output is JSON compatible) * * @note probably only useful for debugging */ toJSON(options?: SerializeOptions): Maybe[]; serialize(): string; /** * return an empty column with the same size and metadata as the previous one */ clearAll(): Column; } export {}; //# sourceMappingURL=Column.d.ts.map