Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(facade): add lexer-tree-builder (#4444)

zhangwa36c4f3d6fbf
diff --git a/packages/engine-formula/src/facade/f-formula.ts b/packages/engine-formula/src/facade/f-formula.ts
index e93ec0e532..757513e196 100644
--- a/packages/engine-formula/src/facade/f-formula.ts
+++ b/packages/engine-formula/src/facade/f-formula.ts
@@ -37,6 +37,14 @@ export class FFormula extends FBase {
// do nothing
}
+ /**
+ * The tree builder for formula string.
+ * @type {LexerTreeBuilder}
+ */
+ get lexerTreeBuilder(): LexerTreeBuilder {
+ return this._lexerTreeBuilder;
+ }
+
/**
* Offsets the formula
* @param {string} formulaString
@@ -54,7 +62,7 @@ export class FFormula extends FBase {
/**
* Resolves the formula string to a 'node' node
* @param {string} formulaString
- * @return {*} {((string | ISequenceNode)[])}
+ * @returns {*} {((string | ISequenceNode)[])}
* @memberof FFormula
*/
sequenceNodesBuilder(formulaString: string): (string | ISequenceNode)[] {
@@ -77,6 +85,7 @@ export class FFormula extends FBase {
/**
* Listening calculation starts.
+ * @param callback
*/
calculationStart(callback: (forceCalculation: boolean) => void): IDisposable {
return this._commandService.onCommandExecuted((command: ICommandInfo) => {
@@ -89,6 +98,7 @@ export class FFormula extends FBase {
/**
* Listening calculation ends.
+ * @param callback
*/
calculationEnd(callback: (functionsExecutedState: FormulaExecutedStateType) => void): IDisposable {
return this._commandService.onCommandExecuted((command: ICommandInfo) => {
@@ -121,6 +131,7 @@ export class FFormula extends FBase {
/**
* Listening calculation processing.
+ * @param callback
*/
calculationProcessing(callback: (stageInfo: IExecutionInProgressParams) => void): IDisposable {
return this._commandService.onCommandExecuted((command: ICommandInfo) => {