/** * @file WOQL Rules * @license Apache Version 2 * WOQL Rules support pattern matching on results of WOQL Queries */ export function WOQLRule(): void; export class WOQLRule { pattern: WOQLPattern; /** * Specifies that the rule only applies to specific variables returned by the WOQL query * @param {[String]} - array of strings, each representing a variable name, variable prefixes * ("v:") are added automatically if absent */ setVariables(vars: any): WOQLRule; current_variable: any; /** * Shorthand to the above using spread operator */ vars(...varlist: any[]): WOQLRule; /** * Specifies that the rule applies to a specific variable, variable prefix ("v:") * is added automatically if absent */ v(v: any): any; /** * Specifies that the rule applies to a specific edge, a source -> target pair of variables */ edge(source: any, target: any): WOQLRule; /** * Specifies that the rule applies to a specific edge, a source -> target pair of variables */ rownum(rownum: any): any; /** * Specifies that the value of a variable must be one of the values contained in the list * @param {[String|Number]} list - parameters are any atomic value (string | number) - * the rule will match only cells that have one of these values */ in(list_0: string | number): WOQLRule; /** * Specifies a filter function to apply to each element - only those values that * return true when this filter is invoked will be matched * @param {function} tester - test function that will be used to filter values */ filter(tester: Function): WOQLRule; matchRow(rules: any, row: any, rownum: any, action: any): any[]; matchCell(rules: any, row: any, key: any, rownum: any, action: any): any[]; /** * * @param {array} rules * @param {string} key - column name * @param {string} ruleName - the rule name like header, width etc... * @returns {array} */ matchColumn(rules: any[], key: string, ruleName: string): any[]; matchNode(rules: any, row: any, key: any, nid: any, action: any): any[]; matchPair(rules: any, row: any, keya: any, keyb: any, action: any): any[]; matchEdge: any; } /** * Object to encapsulate the matching of woql result patterns - inherits from TerminusRule * @param {Object} pattern */ export function WOQLPattern(pattern: any): void; export class WOQLPattern { /** * Object to encapsulate the matching of woql result patterns - inherits from TerminusRule * @param {Object} pattern */ constructor(pattern: any); prettyPrint(): string; /** * @param {String|Object} data * @param {String|[String, String]} [key] - a variable or an array of two variables * (in the case of edge scope) which constitutes the key being tested * @param {String} [scope] - the scope in which the test is being carried out (row, column, cell) */ matchRow(row: any, rownum: any): boolean; matchCell(row: any, key: any, rownum: any): boolean; matchNode(row: any, key: any): boolean; matchColumn(key: any): boolean; matchPair(row: any, keya: any, keyb: any): boolean; testVariableConstraints(row: any): boolean; testVariableConstraint(name: any, val: any): boolean; setPattern(pattern: any): void; json(): { scope: any; value: any; rownum: any; variables: any; literal: any; type: any; constraints: any; source: any; target: any; }; }