diff --git a/src/op/window-functions.js b/src/op/window-functions.js index 833a9b47..b861538f 100644 --- a/src/op/window-functions.js +++ b/src/op/window-functions.js @@ -9,6 +9,11 @@ import NULL from '../util/null'; * @return {void} */ +/** + * A storage object for the state of the window. + * @typedef {import('../engine/window/window-state').default} WindowState + */ + /** * Retrieve an output value from a window operator. * @callback WindowValue @@ -16,6 +21,16 @@ import NULL from '../util/null'; * @return {*} The output value. */ +/** + * Initialize an aggregate operator. + * @typedef {import('./aggregate-functions').AggregateInit} AggregateInit + */ + +/** + * Retrive an output value from an aggregate operator. + * @typedef {import('./aggregate-functions').AggregateValue} AggregateValue + */ + /** * An operator instance for a window function. * @typedef {object} WindowOperator @@ -30,6 +45,11 @@ import NULL from '../util/null'; * @return {WindowOperator} The instantiated window operator. */ +/** + * Create a new aggregate operator instance. + * @typedef {import('./aggregate-functions').AggregateCreate} AggregateCreate + */ + /** * An operator definition for a window function. * @typedef {object} WindowDef diff --git a/src/query/query.js b/src/query/query.js index 9222afb5..c1b08a96 100644 --- a/src/query/query.js +++ b/src/query/query.js @@ -145,6 +145,11 @@ export default class Query extends Transformable { } } +/** + * Abstract class representing a data table. + * @typedef {import('../table/table').default} Table + */ + /** * Serialized object representation of a query. * @typedef {object} QueryObject diff --git a/src/query/verb.js b/src/query/verb.js index 3fd167bd..e2321401 100644 --- a/src/query/verb.js +++ b/src/query/verb.js @@ -240,4 +240,9 @@ export const Verbs = { except: createVerb('except', [ { name: 'tables', type: TableRefList } ]) -}; \ No newline at end of file +}; + +/** + * Abstract class representing a data table. + * @typedef {import('../table/table').default} Table + */ diff --git a/src/table/column-table.js b/src/table/column-table.js index d78eaf81..afe1d4b5 100644 --- a/src/table/column-table.js +++ b/src/table/column-table.js @@ -79,7 +79,7 @@ export default class ColumnTable extends Table { * based on the values of the optional configuration argument. If a * setting is not specified, it is inherited from the current table. * @param {CreateOptions} [options] Creation options for the new table. - * @return {ColumnTable} A newly created table. + * @return {this} A newly created table. */ create({ data, names, filter, groups, order }) { const f = filter !== undefined ? filter : this.mask(); @@ -146,9 +146,9 @@ export default class ColumnTable extends Table { * Get an array of values contained in a column. The resulting array * respects any table filter or orderby criteria. * @param {string} name The column name. - * @param {ArrayConstructor|import('./table').TypedArrayConstructor} [constructor=Array] + * @param {ArrayConstructor|TypedArrayConstructor} [constructor=Array] * The array constructor for instantiating the output array. - * @return {import('./table').DataValue[]|import('./table).TypedArray} The array of column values. + * @return {DataValue[]|TypedArray} The array of column values. */ array(name, constructor = Array) { const column = this.column(name); @@ -162,7 +162,7 @@ export default class ColumnTable extends Table { * Get the value for the given column and row. * @param {string} name The column name. * @param {number} [row=0] The row index, defaults to zero if not specified. - * @return {import('./table').DataValue} The table value at (column, row). + * @return {DataValue} The table value at (column, row). */ get(name, row = 0) { const column = this.column(name); @@ -176,7 +176,7 @@ export default class ColumnTable extends Table { * function takes a row index as its single argument and returns the * corresponding column value. * @param {string} name The column name. - * @return {import('./table').ColumnGetter} The column getter function. + * @return {ColumnGetter} The column getter function. */ getter(name) { const column = this.column(name); @@ -240,7 +240,7 @@ export default class ColumnTable extends Table { * Instead, the backing data itself is filtered and ordered as needed. * @param {number[]} [indices] Ordered row indices to materialize. * If unspecified, all rows passing the table filter are used. - * @return {ColumnTable} A reified table. + * @return {this} A reified table. */ reify(indices) { const nrows = indices ? indices.length : this.numRows(); @@ -365,6 +365,36 @@ function objectBuilder(table) { return b; } +/** + * Options for derived table creation. + * @typedef {import('./table').CreateOptions} CreateOptions + */ + +/** + * A typed array constructor. + * @typedef {import('./table').TypedArrayConstructor} TypedArrayConstructor + */ + +/** + * A typed array instance. + * @typedef {import('./table').TypedArray} TypedArray + */ + +/** + * Table value. + * @typedef {import('./table').DataValue} DataValue + */ + +/** + * Column value accessor. + * @typedef {import('./table').ColumnGetter} ColumnGetter + */ + +/** + * Options for generating row objects. + * @typedef {import('./table').ObjectsOptions} ObjectsOptions + */ + /** * A table transformation. * @typedef {(table: ColumnTable) => ColumnTable} Transform diff --git a/src/table/table.js b/src/table/table.js index 88ef5ac8..737ab8f8 100644 --- a/src/table/table.js +++ b/src/table/table.js @@ -524,6 +524,11 @@ export default class Table extends Transformable { * @typedef {import('./bit-set').default} BitSet */ +/** + * Abstract class for custom aggregation operations. + * @typedef {import('../engine/reduce/reducer').default} Reducer + */ + /** * A table groupby specification. * @typedef {object} GroupBySpec diff --git a/src/table/transformable.js b/src/table/transformable.js index 488cbf70..b481573c 100644 --- a/src/table/transformable.js +++ b/src/table/transformable.js @@ -756,7 +756,7 @@ export default class Transformable { /** * A function defined over rows from two tables. - * @typedef {(a?: Struct, b?: Struct, $?: Params) => any} TableFunc2 + * @typedef {(a?: Struct, b?: Struct, $?: Params) => any} TableExprFunc2 */ /**