UNPKG

arquero

Version:

Query processing and transformation of array-backed data tables.

59 lines (58 loc) 2.46 kB
/** * Return a new column set instance. * @param {import('./Table.js').Table} [table] A base table whose columns * should populate the returned set. If unspecified, create an empty set. * @return {ColumnSet} The column set. */ export function columnSet(table?: import("./Table.js").Table): ColumnSet; /** An editable collection of named columns. */ export class ColumnSet { /** * Create a new column set instance. * @param {import('./types.js').ColumnData} [data] Initial column data. * @param {string[]} [names] Initial column names. */ constructor(data?: import("./types.js").ColumnData, names?: string[]); data: import("./types.js").ColumnData; names: string[]; /** * Add a new column to this set and return the column values. * @template {import('./types.js').ColumnType} T * @param {string} name The column name. * @param {T} values The column values. * @return {T} The provided column values. */ add<T extends import("./types.js").ColumnType<any>>(name: string, values: T): T; /** * Test if this column set has a columns with the given name. * @param {string} name A column name * @return {boolean} True if this set contains a column with the given name, * false otherwise. */ has(name: string): boolean; /** * Add a groupby specification to this column set. * @param {import('./types.js').GroupBySpec} groups A groupby specification. * @return {this} This column set. */ groupby(groups: import("./types.js").GroupBySpec): this; groups: import("./types.js").GroupBySpec; /** * Create a new table with the contents of this column set, using the same * type as a given prototype table. The new table does not inherit the * filter, groupby, or orderby state of the prototype. * @template {import('./Table.js').Table} T * @param {T} proto A prototype table * @return {T} The new table. */ "new"<T extends import("./Table.js").Table>(proto: T): T; /** * Create a derived table with the contents of this column set, using the same * type as a given prototype table. The new table will inherit the filter, * groupby, and orderby state of the prototype. * @template {import('./Table.js').Table} T * @param {T} proto A prototype table * @return {T} The new table. */ derive<T extends import("./Table.js").Table>(proto: T): T; }