-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
103 lines (101 loc) · 6.11 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
export declare class ExcelFormula {
/**
* Method used to parse Excel Formula to its components.
* @param formula - string containing the excel formula to be parsed
* @returns the parsed token object of the formula
*/
static getTokens: (formula: string) => Object;
/**
*
* @function
* @param {string} formula - string containing the excel formula to be parsed
* @param {object} [options] - params for the parsing
*<pre>
* TEMPLATE VALUES
* {{autoindent}} - apply auto indent based on current tree level
* {{token}} - the named token such as FUNCTION_NAME or "string"
* {{autolinebreak}} - apply line break automatically. tests for next element only at this point
*
* Options include:
* tmplFunctionStart - template for the start of a function, the {{token}} will contain the name of the function.
* tmplFunctionStop - template for when the end of a function has been reached.
* tmplOperandError - template for errors.
* tmplOperandRange - template for ranges and variable names.
* tmplOperandLogical - template for logical operators such as + - = ...
* tmplOperandNumber - template for numbers.
* tmplOperandText - template for text/strings.
* tmplArgument - template for argument separators such as ,.
* tmplFunctionStartArray - template for the start of an array.
* tmplFunctionStartArrayRow - template for the start of an array row.
* tmplFunctionStopArrayRow - template for the end of an array row.
* tmplFunctionStopArray - template for the end of an array.
* tmplSubexpressionStart - template for the sub expression start
* tmplSubexpressionStop - template for the sub expression stop
* tmplIndentTab - template for the tab char.
* tmplIndentSpace - template for space char.
* autoLineBreak - when rendering line breaks automatically which types should it break on. "this.TOK_SUBTYPE_STOP | this.TOK_SUBTYPE_START | this.TOK_TYPE_ARGUMENT"
* newLine - used for the {{autolinebreak}} replacement as well as some string parsing. if this is not set correctly you may get undesired results. usually \n for text or <br /> for html
* trim: true - trim the output.
* customTokenRender: null - this is a call back to a custom token function. your call back should look like
* EXAMPLE:
*
* customTokenRender: function(tokenString, token, indent, lineBreak){
* let outStr = token,
* useTemplate = true;
* // In the return object "useTemplate" tells formatFormula()
* // weather or not to apply the template to what your return from the "tokenString".
* return {tokenString: outStr, useTemplate: useTemplate};
* }
*
*</pre>
* @returns {string}
*/
static formatFormula(formula: string, options?: Object): string;
/**
*
* @function
* @param {string} formula - string containing the excel formula to be parsed
* @param {object} [options] - params for the parsing
*<pre>
* TEMPLATE VALUES
* {{autoindent}} - apply auto indent based on current tree level
* {{token}} - the named token such as FUNCTION_NAME or "string"
* {{autolinebreak}} - apply line break automatically. tests for next element only at this point
*
* Options include:
* tmplFunctionStart - template for the start of a function, the {{token}} will contain the name of the function.
* tmplFunctionStop - template for when the end of a function has been reached.
* tmplOperandError - template for errors.
* tmplOperandRange - template for ranges and variable names.
* tmplOperandLogical - template for logical operators such as + - = ...
* tmplOperandNumber - template for numbers.
* tmplOperandText - template for text/strings.
* tmplArgument - template for argument separators such as ,.
* tmplFunctionStartArray - template for the start of an array.
* tmplFunctionStartArrayRow - template for the start of an array row.
* tmplFunctionStopArrayRow - template for the end of an array row.
* tmplFunctionStopArray - template for the end of an array.
* tmplSubexpressionStart - template for the sub expression start
* tmplSubexpressionStop - template for the sub expression stop
* tmplIndentTab - template for the tab char.
* tmplIndentSpace - template for space char.
* autoLineBreak - when rendering line breaks automatically which types should it break on. "this.TOK_SUBTYPE_STOP | this.TOK_SUBTYPE_START | this.TOK_TYPE_ARGUMENT"
* newLine - used for the {{autolinebreak}} replacement as well as some string parsing. if this is not set correctly you may get undesired results. usually \n for text or <br /> for html
* trim: true - trim the output.
* customTokenRender: null - this is a call back to a custom token function. your call back should look like
* EXAMPLE:
*
* customTokenRender: function(tokenString, token, indent, lineBreak){
* let outStr = token,
* useTemplate = true;
* // In the return object "useTemplate" tells formatFormula()
* // weather or not to apply the template to what your return from the "tokenString".
* return {tokenString: outStr, useTemplate: useTemplate};
* }
*
*</pre>
* @returns {string}
*/
static toJS(formula: string, options?: Object): string;
}
export {};