@devmm/puredocs-excel-formula 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +2945 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +455 -0
- package/dist/index.d.ts +455 -0
- package/dist/index.js +2905 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
declare const enum FormulaError {
|
|
2
|
+
None = 0,
|
|
3
|
+
Null = 1,
|
|
4
|
+
Div0 = 2,
|
|
5
|
+
Value = 3,
|
|
6
|
+
Ref = 4,
|
|
7
|
+
Name = 5,
|
|
8
|
+
Num = 6,
|
|
9
|
+
NA = 7,
|
|
10
|
+
Calc = 8,
|
|
11
|
+
Spill = 9
|
|
12
|
+
}
|
|
13
|
+
type FormulaValueKind = 'blank' | 'number' | 'text' | 'boolean' | 'error' | 'array';
|
|
14
|
+
declare class FormulaValue {
|
|
15
|
+
#private;
|
|
16
|
+
readonly kind: FormulaValueKind;
|
|
17
|
+
readonly errorCode: FormulaError;
|
|
18
|
+
private constructor();
|
|
19
|
+
static readonly blank: FormulaValue;
|
|
20
|
+
static readonly zero: FormulaValue;
|
|
21
|
+
static readonly one: FormulaValue;
|
|
22
|
+
static readonly true_: FormulaValue;
|
|
23
|
+
static readonly false_: FormulaValue;
|
|
24
|
+
static readonly emptyString: FormulaValue;
|
|
25
|
+
static readonly errorDiv0: FormulaValue;
|
|
26
|
+
static readonly errorValue: FormulaValue;
|
|
27
|
+
static readonly errorRef: FormulaValue;
|
|
28
|
+
static readonly errorName: FormulaValue;
|
|
29
|
+
static readonly errorNA: FormulaValue;
|
|
30
|
+
static readonly errorNum: FormulaValue;
|
|
31
|
+
static readonly errorNull: FormulaValue;
|
|
32
|
+
static number(v: number): FormulaValue;
|
|
33
|
+
static text(v: string): FormulaValue;
|
|
34
|
+
static boolean(v: boolean): FormulaValue;
|
|
35
|
+
static error(e: FormulaError): FormulaValue;
|
|
36
|
+
static array(a: ArrayValue): FormulaValue;
|
|
37
|
+
get isBlank(): boolean;
|
|
38
|
+
get isNumber(): boolean;
|
|
39
|
+
get isText(): boolean;
|
|
40
|
+
get isBoolean(): boolean;
|
|
41
|
+
get isError(): boolean;
|
|
42
|
+
get isArray(): boolean;
|
|
43
|
+
get isNumeric(): boolean;
|
|
44
|
+
get numberValue(): number;
|
|
45
|
+
get textValue(): string;
|
|
46
|
+
get booleanValue(): boolean;
|
|
47
|
+
get arrayVal(): ArrayValue;
|
|
48
|
+
coerceToNumber(): FormulaValue;
|
|
49
|
+
tryAsDouble(): {
|
|
50
|
+
ok: true;
|
|
51
|
+
value: number;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
};
|
|
55
|
+
coerceToBool(): FormulaValue;
|
|
56
|
+
asText(): string;
|
|
57
|
+
static areEqual(a: FormulaValue, b: FormulaValue): boolean;
|
|
58
|
+
/** Excel-compatible sort order: Number/Blank < Text < Boolean. */
|
|
59
|
+
static compare(a: FormulaValue, b: FormulaValue): number;
|
|
60
|
+
static errorToString(e: FormulaError): string;
|
|
61
|
+
static errorFromString(s: string): FormulaError;
|
|
62
|
+
static fromObjectSync(value: unknown): FormulaValue;
|
|
63
|
+
toObject(): unknown;
|
|
64
|
+
toString(): string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 2D array value for formula results and range data.
|
|
68
|
+
* Port of TVE.PureDocs.Excel.Formulas.ArrayValue (C#)
|
|
69
|
+
*/
|
|
70
|
+
declare class ArrayValue {
|
|
71
|
+
#private;
|
|
72
|
+
static readonly empty: ArrayValue;
|
|
73
|
+
readonly rows: number;
|
|
74
|
+
readonly columns: number;
|
|
75
|
+
constructor(rows: number, columns: number);
|
|
76
|
+
get length(): number;
|
|
77
|
+
get(row: number, col: number): FormulaValue;
|
|
78
|
+
set(row: number, col: number, value: FormulaValue): void;
|
|
79
|
+
getFlat(index: number): FormulaValue;
|
|
80
|
+
setFlat(index: number, value: FormulaValue): void;
|
|
81
|
+
/** Iterate all values in row-major order. */
|
|
82
|
+
values(): Iterable<FormulaValue>;
|
|
83
|
+
toObjectArray(): unknown[];
|
|
84
|
+
/** Create from a flat array (single column). */
|
|
85
|
+
static fromFlat(values: FormulaValue[]): ArrayValue;
|
|
86
|
+
/** Create a 1×1 array wrapping a scalar value (for broadcasting). */
|
|
87
|
+
static fromScalar(value: FormulaValue): ArrayValue;
|
|
88
|
+
/** Element-wise broadcasting operation (mirrors ArrayValue.Broadcast in C#). */
|
|
89
|
+
static broadcast(a: ArrayValue, b: ArrayValue, op: (av: FormulaValue, bv: FormulaValue) => FormulaValue): ArrayValue;
|
|
90
|
+
/** Implicit intersection: reduce array to scalar based on formula position. */
|
|
91
|
+
implicitIntersect(formulaRow: number, formulaCol: number, rangeStartRow: number, rangeStartCol: number): FormulaValue;
|
|
92
|
+
transpose(): ArrayValue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Tokens produced by the formula lexer.
|
|
97
|
+
* Port of TVE.PureDocs.Excel.Formulas.FormulaToken + FormulaTokenType (C#)
|
|
98
|
+
*/
|
|
99
|
+
declare const enum TokenType {
|
|
100
|
+
Number = 0,
|
|
101
|
+
String = 1,
|
|
102
|
+
Boolean = 2,
|
|
103
|
+
CellReference = 3,
|
|
104
|
+
Colon = 4,
|
|
105
|
+
Function = 5,
|
|
106
|
+
LeftParen = 6,
|
|
107
|
+
RightParen = 7,
|
|
108
|
+
Comma = 8,
|
|
109
|
+
Plus = 9,
|
|
110
|
+
Minus = 10,
|
|
111
|
+
Multiply = 11,
|
|
112
|
+
Divide = 12,
|
|
113
|
+
Power = 13,
|
|
114
|
+
Percent = 14,
|
|
115
|
+
Ampersand = 15,
|
|
116
|
+
Equal = 16,
|
|
117
|
+
NotEqual = 17,
|
|
118
|
+
LessThan = 18,
|
|
119
|
+
LessThanOrEqual = 19,
|
|
120
|
+
GreaterThan = 20,
|
|
121
|
+
GreaterThanOrEqual = 21,
|
|
122
|
+
SheetReference = 22,
|
|
123
|
+
NamedRange = 23,
|
|
124
|
+
Exclamation = 24,
|
|
125
|
+
AtSign = 25,
|
|
126
|
+
ErrorLiteral = 26,
|
|
127
|
+
EOF = 27
|
|
128
|
+
}
|
|
129
|
+
interface Token {
|
|
130
|
+
readonly type: TokenType;
|
|
131
|
+
readonly value: string;
|
|
132
|
+
readonly position: number;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Tokenises an Excel formula string into a sequence of tokens.
|
|
137
|
+
* Full port of TVE.PureDocs.Excel.Formulas.FormulaLexer (C#)
|
|
138
|
+
*
|
|
139
|
+
* Supports:
|
|
140
|
+
* - String literals ("hello")
|
|
141
|
+
* - Error literals (#N/A, #REF!, #VALUE!, etc.)
|
|
142
|
+
* - Quoted sheet references ('My Sheet'!A1)
|
|
143
|
+
* - Unquoted sheet references (Sheet1!A1)
|
|
144
|
+
* - _xlfn. prefix stripping
|
|
145
|
+
* - Cell references ($A$1, A1, AA123)
|
|
146
|
+
* - Named ranges
|
|
147
|
+
* - @ implicit intersection operator
|
|
148
|
+
* - All standard operators
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
declare class FormulaException extends Error {
|
|
152
|
+
constructor(message: string);
|
|
153
|
+
}
|
|
154
|
+
declare class FormulaLexer {
|
|
155
|
+
#private;
|
|
156
|
+
constructor(formula: string);
|
|
157
|
+
tokenize(): Token[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Central registry of all supported Excel functions.
|
|
162
|
+
* Port of TVE.PureDocs.Excel.Formulas.FunctionRegistry (C#)
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
type FormulaFunction = (args: FormulaNode[], ctx: FormulaContext) => FormulaValue;
|
|
166
|
+
interface FunctionDef {
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly minArgs: number;
|
|
169
|
+
readonly maxArgs: number;
|
|
170
|
+
readonly isVolatile: boolean;
|
|
171
|
+
readonly handler: FormulaFunction;
|
|
172
|
+
}
|
|
173
|
+
declare class FunctionRegistry {
|
|
174
|
+
#private;
|
|
175
|
+
/** Lazily-created default registry with all built-in functions registered. */
|
|
176
|
+
static get default(): FunctionRegistry;
|
|
177
|
+
/** Registers a function. Name is normalised to UPPERCASE. */
|
|
178
|
+
register(name: string, handler: FormulaFunction, minArgs?: number, maxArgs?: number, isVolatile?: boolean): void;
|
|
179
|
+
/** Executes a function by name with argument validation. */
|
|
180
|
+
execute(name: string, args: FormulaNode[], ctx: FormulaContext): FormulaValue;
|
|
181
|
+
/** Returns true if the named function is volatile (NOW, RAND, etc.). */
|
|
182
|
+
isVolatile(name: string): boolean;
|
|
183
|
+
/** Returns true if the function is registered. */
|
|
184
|
+
has(name: string): boolean;
|
|
185
|
+
}
|
|
186
|
+
declare namespace FormulaHelper {
|
|
187
|
+
/** Evaluates a node and coerces to number, propagating errors. */
|
|
188
|
+
function evalDouble(node: FormulaNode, ctx: FormulaContext): {
|
|
189
|
+
ok: true;
|
|
190
|
+
value: number;
|
|
191
|
+
} | {
|
|
192
|
+
ok: false;
|
|
193
|
+
error: FormulaValue;
|
|
194
|
+
};
|
|
195
|
+
/** Evaluates a node and coerces to string, propagating errors. */
|
|
196
|
+
function evalString(node: FormulaNode, ctx: FormulaContext): {
|
|
197
|
+
ok: true;
|
|
198
|
+
value: string;
|
|
199
|
+
} | {
|
|
200
|
+
ok: false;
|
|
201
|
+
error: FormulaValue;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Collects numbers from all args (expanding arrays, skipping blanks/text).
|
|
205
|
+
* Returns false + error value if any arg is an error.
|
|
206
|
+
*/
|
|
207
|
+
function collectNumbers(args: FormulaNode[], ctx: FormulaContext): {
|
|
208
|
+
ok: true;
|
|
209
|
+
values: number[];
|
|
210
|
+
} | {
|
|
211
|
+
ok: false;
|
|
212
|
+
error: FormulaValue;
|
|
213
|
+
};
|
|
214
|
+
/** Flattens all args into FormulaValue array (expanding arrays). */
|
|
215
|
+
function flattenArgs(args: FormulaNode[], ctx: FormulaContext): FormulaValue[];
|
|
216
|
+
/** Matches a criteria string (e.g. ">5", "=hello", "*partial*") against a value. */
|
|
217
|
+
function matchesCriteria(value: FormulaValue, criteria: string): boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface WorksheetLike {
|
|
221
|
+
getCellValue(reference: string): unknown;
|
|
222
|
+
name: string;
|
|
223
|
+
}
|
|
224
|
+
interface WorkbookLike {
|
|
225
|
+
worksheets: readonly WorksheetLike[];
|
|
226
|
+
getWorksheet(name: string): WorksheetLike;
|
|
227
|
+
}
|
|
228
|
+
declare class FormulaContext {
|
|
229
|
+
#private;
|
|
230
|
+
/** Row of the formula cell (for @ implicit intersection). */
|
|
231
|
+
formulaRow: number;
|
|
232
|
+
/** Column of the formula cell (for @ implicit intersection). */
|
|
233
|
+
formulaCol: number;
|
|
234
|
+
/** Optional workbook reference for cross-sheet references. */
|
|
235
|
+
workbook?: WorkbookLike;
|
|
236
|
+
constructor(sheet: WorksheetLike, formulaRow?: number, formulaCol?: number, evaluating?: Set<string>, registry?: FunctionRegistry);
|
|
237
|
+
get worksheet(): WorksheetLike;
|
|
238
|
+
getCellValue(cellReference: string): FormulaValue;
|
|
239
|
+
getRangeValues(startRef: string, endRef: string): FormulaValue;
|
|
240
|
+
getSheetCellValue(sheetName: string, cellReference: string): FormulaValue;
|
|
241
|
+
getSheetRangeValues(sheetName: string, startRef: string, endRef: string): FormulaValue;
|
|
242
|
+
resolveNamedRange(_name: string): FormulaValue;
|
|
243
|
+
getRangeBounds(startRef: string, endRef: string): {
|
|
244
|
+
startRow: number;
|
|
245
|
+
startCol: number;
|
|
246
|
+
endRow: number;
|
|
247
|
+
endCol: number;
|
|
248
|
+
};
|
|
249
|
+
evaluateFunction(name: string, args: FormulaNode[]): FormulaValue;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* AST node types for formula expressions.
|
|
254
|
+
* Port of TVE.PureDocs.Excel.Formulas.FormulaNode (C#)
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
declare abstract class FormulaNode {
|
|
258
|
+
abstract evaluate(ctx: FormulaContext): FormulaValue;
|
|
259
|
+
}
|
|
260
|
+
declare class NumberNode extends FormulaNode {
|
|
261
|
+
readonly value: number;
|
|
262
|
+
constructor(value: number);
|
|
263
|
+
evaluate(): FormulaValue;
|
|
264
|
+
}
|
|
265
|
+
declare class StringNode extends FormulaNode {
|
|
266
|
+
readonly value: string;
|
|
267
|
+
constructor(value: string);
|
|
268
|
+
evaluate(): FormulaValue;
|
|
269
|
+
}
|
|
270
|
+
declare class BooleanNode extends FormulaNode {
|
|
271
|
+
readonly value: boolean;
|
|
272
|
+
constructor(value: boolean);
|
|
273
|
+
evaluate(): FormulaValue;
|
|
274
|
+
}
|
|
275
|
+
declare class ErrorNode extends FormulaNode {
|
|
276
|
+
readonly errorValue: FormulaValue;
|
|
277
|
+
constructor(errorValue: FormulaValue);
|
|
278
|
+
evaluate(): FormulaValue;
|
|
279
|
+
}
|
|
280
|
+
/** Represents an empty/omitted argument in a function call (e.g. IF(A1,,0)). */
|
|
281
|
+
declare class BlankNode extends FormulaNode {
|
|
282
|
+
evaluate(): FormulaValue;
|
|
283
|
+
}
|
|
284
|
+
declare class CellReferenceNode extends FormulaNode {
|
|
285
|
+
readonly reference: string;
|
|
286
|
+
constructor(reference: string);
|
|
287
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
288
|
+
}
|
|
289
|
+
declare class RangeReferenceNode extends FormulaNode {
|
|
290
|
+
readonly startRef: string;
|
|
291
|
+
readonly endRef: string;
|
|
292
|
+
constructor(startRef: string, endRef: string);
|
|
293
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
294
|
+
}
|
|
295
|
+
declare class SheetCellReferenceNode extends FormulaNode {
|
|
296
|
+
readonly sheetName: string;
|
|
297
|
+
readonly cellReference: string;
|
|
298
|
+
constructor(sheetName: string, cellReference: string);
|
|
299
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
300
|
+
}
|
|
301
|
+
declare class SheetRangeReferenceNode extends FormulaNode {
|
|
302
|
+
readonly sheetName: string;
|
|
303
|
+
readonly startRef: string;
|
|
304
|
+
readonly endRef: string;
|
|
305
|
+
constructor(sheetName: string, startRef: string, endRef: string);
|
|
306
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
307
|
+
}
|
|
308
|
+
declare class NamedRangeNode extends FormulaNode {
|
|
309
|
+
readonly name: string;
|
|
310
|
+
constructor(name: string);
|
|
311
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
312
|
+
}
|
|
313
|
+
declare const enum BinaryOperator {
|
|
314
|
+
Add = 0,
|
|
315
|
+
Subtract = 1,
|
|
316
|
+
Multiply = 2,
|
|
317
|
+
Divide = 3,
|
|
318
|
+
Power = 4,
|
|
319
|
+
Concatenate = 5,
|
|
320
|
+
Equal = 6,
|
|
321
|
+
NotEqual = 7,
|
|
322
|
+
LessThan = 8,
|
|
323
|
+
LessThanOrEqual = 9,
|
|
324
|
+
GreaterThan = 10,
|
|
325
|
+
GreaterThanOrEqual = 11
|
|
326
|
+
}
|
|
327
|
+
declare const enum UnaryOperator {
|
|
328
|
+
Negate = 0,
|
|
329
|
+
Plus = 1,
|
|
330
|
+
Percent = 2
|
|
331
|
+
}
|
|
332
|
+
declare class BinaryOpNode extends FormulaNode {
|
|
333
|
+
#private;
|
|
334
|
+
readonly left: FormulaNode;
|
|
335
|
+
readonly op: BinaryOperator;
|
|
336
|
+
readonly right: FormulaNode;
|
|
337
|
+
constructor(left: FormulaNode, op: BinaryOperator, right: FormulaNode);
|
|
338
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
339
|
+
}
|
|
340
|
+
declare class UnaryOpNode extends FormulaNode {
|
|
341
|
+
readonly op: UnaryOperator;
|
|
342
|
+
readonly operand: FormulaNode;
|
|
343
|
+
constructor(op: UnaryOperator, operand: FormulaNode);
|
|
344
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
345
|
+
}
|
|
346
|
+
/** @ implicit intersection operator (Excel 365). */
|
|
347
|
+
declare class ImplicitIntersectionNode extends FormulaNode {
|
|
348
|
+
readonly inner: FormulaNode;
|
|
349
|
+
constructor(inner: FormulaNode);
|
|
350
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
351
|
+
}
|
|
352
|
+
declare class FunctionCallNode extends FormulaNode {
|
|
353
|
+
readonly functionName: string;
|
|
354
|
+
readonly args: FormulaNode[];
|
|
355
|
+
constructor(functionName: string, args: FormulaNode[]);
|
|
356
|
+
evaluate(ctx: FormulaContext): FormulaValue;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Recursive descent parser converting formula tokens into an AST.
|
|
361
|
+
* Port of TVE.PureDocs.Excel.Formulas.FormulaParser (C#)
|
|
362
|
+
*
|
|
363
|
+
* Operator precedence (low → high):
|
|
364
|
+
* Comparison: =, <>, <, <=, >, >=
|
|
365
|
+
* Concatenation: &
|
|
366
|
+
* Addition/Subtraction: +, -
|
|
367
|
+
* Multiplication/Division: *, /
|
|
368
|
+
* Unary: +, -, @ (prefix)
|
|
369
|
+
* Power: ^ (right-associative)
|
|
370
|
+
* Percent: % (postfix)
|
|
371
|
+
* Primary: literals, refs, functions, parentheses
|
|
372
|
+
*/
|
|
373
|
+
|
|
374
|
+
declare class FormulaParser {
|
|
375
|
+
#private;
|
|
376
|
+
constructor(tokens: Token[]);
|
|
377
|
+
parse(): FormulaNode;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Parses a formula string to an AST, with LRU caching.
|
|
382
|
+
*/
|
|
383
|
+
declare function parseFormula(formula: string): FormulaNode;
|
|
384
|
+
/**
|
|
385
|
+
* Evaluates a formula string against a worksheet.
|
|
386
|
+
* Mirrors FormulaEvaluator.Evaluate() in C#.
|
|
387
|
+
*/
|
|
388
|
+
declare function evaluateFormula(formula: string, sheet: WorksheetLike, options?: {
|
|
389
|
+
workbook?: WorkbookLike;
|
|
390
|
+
formulaRow?: number;
|
|
391
|
+
formulaCol?: number;
|
|
392
|
+
}): FormulaValue;
|
|
393
|
+
declare function clearAstCache(): void;
|
|
394
|
+
declare function getAstCacheStats(): {
|
|
395
|
+
size: number;
|
|
396
|
+
hits: number;
|
|
397
|
+
misses: number;
|
|
398
|
+
hitRate: number;
|
|
399
|
+
};
|
|
400
|
+
declare function setAstCacheCapacity(capacity: number): void;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Least-Recently-Used cache using JavaScript Map insertion-order semantics.
|
|
404
|
+
* Port of TVE.PureDocs.Excel.Formulas.LruCache<TKey, TValue> (C#)
|
|
405
|
+
*
|
|
406
|
+
* JS Map maintains insertion order, so LRU eviction is simply:
|
|
407
|
+
* delete oldest key = map.keys().next().value
|
|
408
|
+
* move to end = delete + re-insert
|
|
409
|
+
*
|
|
410
|
+
* This is simpler and faster than the C# LinkedList + Dictionary approach.
|
|
411
|
+
*/
|
|
412
|
+
declare class LruCache<K, V> {
|
|
413
|
+
#private;
|
|
414
|
+
constructor(capacity: number);
|
|
415
|
+
get capacity(): number;
|
|
416
|
+
get size(): number;
|
|
417
|
+
get hits(): number;
|
|
418
|
+
get misses(): number;
|
|
419
|
+
get evictions(): number;
|
|
420
|
+
get hitRate(): number;
|
|
421
|
+
/**
|
|
422
|
+
* Returns the value for key, or undefined if not present.
|
|
423
|
+
* Moves the accessed key to the "most recently used" end.
|
|
424
|
+
*/
|
|
425
|
+
get(key: K): V | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* Inserts or updates a key-value pair.
|
|
428
|
+
* Evicts the least-recently-used entry if over capacity.
|
|
429
|
+
*/
|
|
430
|
+
set(key: K, value: V): void;
|
|
431
|
+
/** Removes a key from the cache. Returns true if it existed. */
|
|
432
|
+
delete(key: K): boolean;
|
|
433
|
+
/** Returns true if the key is present (does NOT update LRU order). */
|
|
434
|
+
has(key: K): boolean;
|
|
435
|
+
/** Removes all entries and resets statistics. */
|
|
436
|
+
clear(): void;
|
|
437
|
+
/** Resizes the cache, evicting oldest entries if necessary. */
|
|
438
|
+
resize(newCapacity: number): void;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare function registerMath(r: FunctionRegistry): void;
|
|
442
|
+
|
|
443
|
+
declare function registerText(r: FunctionRegistry): void;
|
|
444
|
+
|
|
445
|
+
declare function registerLogical(r: FunctionRegistry): void;
|
|
446
|
+
|
|
447
|
+
declare function registerDate(r: FunctionRegistry): void;
|
|
448
|
+
|
|
449
|
+
declare function registerLookup(r: FunctionRegistry): void;
|
|
450
|
+
|
|
451
|
+
declare function registerStatistical(r: FunctionRegistry): void;
|
|
452
|
+
|
|
453
|
+
declare function registerInfo(r: FunctionRegistry): void;
|
|
454
|
+
|
|
455
|
+
export { ArrayValue, BinaryOpNode, BinaryOperator, BlankNode, BooleanNode, CellReferenceNode, ErrorNode, FormulaContext, FormulaError, FormulaException, type FormulaFunction, FormulaHelper, FormulaLexer, FormulaNode, FormulaParser, FormulaValue, type FormulaValueKind, FunctionCallNode, type FunctionDef, FunctionRegistry, ImplicitIntersectionNode, LruCache, NamedRangeNode, NumberNode, RangeReferenceNode, SheetCellReferenceNode, SheetRangeReferenceNode, StringNode, type Token, TokenType, UnaryOpNode, UnaryOperator, type WorkbookLike, type WorksheetLike, clearAstCache, evaluateFormula, getAstCacheStats, parseFormula, registerDate, registerInfo, registerLogical, registerLookup, registerMath, registerStatistical, registerText, setAstCacheCapacity };
|