/** * Verb parameter type. * @typedef {Expr|ExprList|ExprNumber|ExprObject|JoinKeys|JoinValues|Options|OrderbyKeys|SelectionList|TableRef|TableRefList} ParamType */ /** * Verb parameter schema. * @typedef {object} ParamDef * @property {string} name The name of the parameter. * @property {ParamType} type The type of the parameter. * @property {{ [key: string]: ParamType }} [props] Types for non-literal properties. */ /** * Create a new constructors. * @param {string} name The name of the verb. * @param {ParamDef[]} schema The verb parameter schema. * @return {Function} A verb constructor function. */ export function createVerb(name: string, schema: ParamDef[]): Function; /** * Model an Arquero verb as a serializable object. */ export class Verb { /** * Create new verb instance from the given serialized object. * @param {object} object A serialized verb representation, such as * those generated by Verb.toObject. * @returns {Verb} The instantiated verb. */ static from(object: object): Verb; /** * Construct a new verb instance. * @param {string} verb The verb name. * @param {object[]} schema Schema describing verb parameters. * @param {any[]} params Array of parameter values. */ constructor(verb: string, schema?: object[], params?: any[]); verb: string; schema: any[]; /** * Evaluate this verb against a given table and catalog. * @param {Table} table The Arquero table to process. * @param {Function} catalog A table lookup function that accepts a table * name string as input and returns a corresponding Arquero table. * @returns {Table} The resulting Arquero table. */ evaluate(table: Table, catalog: Function): Table; /** * Serialize this verb as a JSON-compatible object. The resulting * object can be passed to Verb.from to re-instantiate this verb. * @returns {object} A JSON-compatible object representing this verb. */ toObject(): object; /** * Serialize this verb to a JSON-compatible abstract syntax tree. * All table expressions will be parsed and represented as AST instances * using a modified form of the Mozilla JavaScript AST format. * This method can be used to output parsed and serialized representations * to translate Arquero verbs to alternative data processing platforms. * @returns {object} A JSON-compatible abstract syntax tree object. */ toAST(): object; } export namespace Verbs { const count: Function; const derive: Function; const filter: Function; const groupby: Function; const orderby: Function; const relocate: Function; const rename: Function; const rollup: Function; const sample: Function; const select: Function; const ungroup: Function; const unorder: Function; const reify: Function; const dedupe: Function; const impute: Function; const fold: Function; const pivot: Function; const spread: Function; const unroll: Function; const lookup: Function; const join: Function; const cross: Function; const semijoin: Function; const antijoin: Function; const concat: Function; const union: Function; const intersect: Function; const except: Function; } /** * Verb parameter type. */ export type ParamType = "Expr" | "ExprList" | "ExprNumber" | "ExprObject" | "JoinKeys" | "JoinValues" | "Options" | "OrderKeys" | "SelectionList" | "TableRef" | "TableRefList"; /** * Verb parameter schema. */ export type ParamDef = { /** * The name of the parameter. */ name: string; /** * The type of the parameter. */ type: ParamType; /** * Types for non-literal properties. */ props?: { [key: string]: ParamType; }; };