@univerjs/engine-formula 0.10.14-nightly.202511031023 → 0.10.14-nightly.202511070640

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.
@@ -1,10 +1,17 @@
1
+ import { Nullable, AbsoluteRefType, Disposable } from '@univerjs/core';
2
+ import { IDirtyUnitSheetDefinedNameMap } from '../../basics/common';
3
+ import { IDefinedNamesServiceParam } from '../../services/defined-names.service';
1
4
  import { ISequenceArray, ISequenceNode } from '../utils/sequence';
2
- import { AbsoluteRefType, Disposable } from '@univerjs/core';
3
5
  import { FormulaAstLRU } from '../../basics/cache-lru';
4
6
  import { ErrorType } from '../../basics/error-type';
5
7
  import { LexerNode } from './lexer-node';
6
8
  export declare const FormulaLexerNodeCache: FormulaAstLRU<LexerNode>;
7
9
  export declare const FormulaSequenceNodeCache: FormulaAstLRU<(string | ISequenceNode)[]>;
10
+ interface IInjectDefinedNameParam {
11
+ unitId: Nullable<string>;
12
+ getValueByName(unitId: string, name: string): Nullable<IDefinedNamesServiceParam>;
13
+ getDirtyDefinedNameMap(): IDirtyUnitSheetDefinedNameMap;
14
+ }
8
15
  export declare class LexerTreeBuilder extends Disposable {
9
16
  private _currentLexerNode;
10
17
  private _upLevel;
@@ -62,11 +69,11 @@ export declare class LexerTreeBuilder extends Disposable {
62
69
  private _minusSplitSequenceNode;
63
70
  private _pushSequenceNode;
64
71
  nodeMakerTest(formulaString: string): ErrorType.VALUE | (string | LexerNode)[] | undefined;
65
- treeBuilder(formulaString: string, transformSuffix?: boolean, injectDefinedName?: (sequenceArray: ISequenceArray[]) => {
66
- sequenceString: string;
67
- hasDefinedName: boolean;
68
- definedNames: string[];
69
- }, simpleCheckDefinedName?: (formulaString: string) => boolean): ErrorType.VALUE | LexerNode | (string | LexerNode)[] | undefined;
72
+ treeBuilder(formulaString: string, transformSuffix?: boolean, injectDefinedNameParam?: IInjectDefinedNameParam): ErrorType.VALUE | LexerNode | (string | LexerNode)[] | undefined;
73
+ private _handleDefinedName;
74
+ private _handleNestedDefinedName;
75
+ private _simpleCheckDefinedName;
76
+ private _checkDefinedNameDirty;
70
77
  private _suffixExpressionHandler;
71
78
  private _processSuffixExpressionRemain;
72
79
  private _processSuffixExpressionCloseBracket;
@@ -131,3 +138,4 @@ export declare class LexerTreeBuilder extends Disposable {
131
138
  private _isScientificNotation;
132
139
  private _addSequenceArray;
133
140
  }
141
+ export {};
@@ -1,5 +1,4 @@
1
1
  import { Disposable } from '@univerjs/core';
2
- import { ErrorType } from '../../basics/error-type';
3
2
  import { IFormulaCurrentConfigService } from '../../services/current-data.service';
4
3
  import { IDefinedNamesService } from '../../services/defined-names.service';
5
4
  import { LexerTreeBuilder } from './lexer-tree-builder';
@@ -8,8 +7,5 @@ export declare class Lexer extends Disposable {
8
7
  private readonly _lexerTreeBuilder;
9
8
  private readonly _formulaCurrentConfigService;
10
9
  constructor(_definedNamesService: IDefinedNamesService, _lexerTreeBuilder: LexerTreeBuilder, _formulaCurrentConfigService: IFormulaCurrentConfigService);
11
- treeBuilder(formulaString: string, transformSuffix?: boolean): ErrorType.VALUE | import('./lexer-node').LexerNode | (string | import('./lexer-node').LexerNode)[] | undefined;
12
- private _simpleCheckDefinedName;
13
- private _checkDefinedNameDirty;
14
- private _injectDefinedName;
10
+ treeBuilder(formulaString: string, transformSuffix?: boolean): import("../..").ErrorType.VALUE | import('./lexer-node').LexerNode | (string | import('./lexer-node').LexerNode)[] | undefined;
15
11
  }
@@ -4,7 +4,7 @@ import { FunctionVariantType } from '../reference-object/base-reference-object';
4
4
  import { AstNodePromiseType } from '../../basics/common';
5
5
  import { ErrorValueObject } from '../value-object/base-value-object';
6
6
  import { NodeType } from './node-type';
7
- interface IAstNodeNodeJson {
7
+ export interface IAstNodeNodeJson {
8
8
  token: string;
9
9
  children?: IAstNodeNodeJson[];
10
10
  nodeType: number;
@@ -53,4 +53,3 @@ export declare class ErrorNode extends BaseAstNode {
53
53
  static create(errorType: ErrorType): ErrorNode;
54
54
  getValue(): ErrorValueObject;
55
55
  }
56
- export {};
@@ -73,3 +73,15 @@ export declare function needsQuoting(name: string): boolean;
73
73
  * Add quotes to the sheet name
74
74
  */
75
75
  export declare function addQuotesBothSides(name: string): string;
76
+ /**
77
+ * Add a single quote before the single quote
78
+ * @param name
79
+ * @returns Quoted name
80
+ */
81
+ export declare function quoteSheetName(name: string): string;
82
+ /**
83
+ * Replace double single quotes with single quotes
84
+ * @param name
85
+ * @returns Unquoted name
86
+ */
87
+ export declare function unquoteSheetName(name: string): string;
@@ -43,7 +43,7 @@ export { LexerNode } from './engine/analysis/lexer-node';
43
43
  export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
44
44
  export { AstTreeBuilder } from './engine/analysis/parser';
45
45
  export { AstRootNodeFactory } from './engine/ast-node/ast-root-node';
46
- export type { BaseAstNode } from './engine/ast-node/base-ast-node.js';
46
+ export type { BaseAstNode, IAstNodeNodeJson } from './engine/ast-node/base-ast-node';
47
47
  export { FunctionNodeFactory } from './engine/ast-node/function-node';
48
48
  export { LambdaNodeFactory } from './engine/ast-node/lambda-node';
49
49
  export { LambdaParameterNodeFactory } from './engine/ast-node/lambda-parameter-node';
@@ -68,7 +68,7 @@ export { generateAstNode } from './engine/utils/generate-ast-node';
68
68
  export { strip, stripErrorMargin } from './engine/utils/math-kit';
69
69
  export { handleNumfmtInCell } from './engine/utils/numfmt-kit';
70
70
  export { deserializeRangeForR1C1 } from './engine/utils/r1c1-reference';
71
- export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, getRangeWithRefsString, type IAbsoluteRefTypeForRange, isReferenceStrings, isReferenceStringWithEffectiveColumn, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, singleReferenceToGrid, } from './engine/utils/reference';
71
+ export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, getRangeWithRefsString, type IAbsoluteRefTypeForRange, isReferenceStrings, isReferenceStringWithEffectiveColumn, needsQuoting, quoteSheetName, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, singleReferenceToGrid, unquoteSheetName, } from './engine/utils/reference';
72
72
  export { handleRefStringInfo } from './engine/utils/reference';
73
73
  export { deserializeRangeWithSheetWithCache } from './engine/utils/reference-cache';
74
74
  export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence';