import { Parser as GrammarParser } from './grammar-parser/grammar-parser'; export default Parser; /** * @class Parser */ declare class Parser { parser: GrammarParser; cryptoDenomination: string; cryptoDecimals: number; variables: any; functions: any; options: any; /** * Parse formula expression. * * @param {string} expression to parse. * @param {object} options additional params. * @param {string} options.sheetId id of sheet which the formula expression belongs to. * @return {*} Returns an object with tow properties `error` and `result`. */ parse(expression: string, options: { sheetId: string; }): any; /** * Set predefined variable name which can be visible while parsing formula expression. * * @param {String} name Variable name. * @param {*} value Variable value. * @returns {Parser} */ setVariable(name: string, value: any): Parser; /** * Get variable name. * * @param {String} name Variable name. * @returns {*} */ getVariable(name: string): any; /** * Retrieve variable value by its name. * * @param name Variable name. * @returns {*} * @private */ private _callVariable; /** * Set custom function which can be visible while parsing formula expression. * * @param {String} name Custom function name. * @param {Function} fn Custom function. * @returns {Parser} */ setFunction(name: string, fn: Function): Parser; /** * Get custom function. * * @param {String} name Custom function name. * @returns {*} */ getFunction(name: string): any; /** * Call function with provided params. * * @param name Function name. * @param params Function params. * @returns {*} * @private */ private _callFunction; /** * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`). * * @param {String} label Coordinates. * @returns {*} * @private */ private _callCellValue; /** * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`). * * @param {String} startLabel Coordinates of the first cell. * @param {String} endLabel Coordinates of the last cell. * @returns {Array} Returns an array of mixed values. * @private */ private _callRangeValue; /** * Try to throw error by its name. * * @param {String} errorName Error name. * @returns {String} * @private */ private _throwError; }