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.

refactor: remove obsolete value state (#7356)

白熱3d53e787b7a8
diff --git a/packages/docs/src/facade/f-types.ts b/packages/docs/src/facade/f-types.ts
deleted file mode 100644
index 7eb5c67572..0000000000
--- a/packages/docs/src/facade/f-types.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Copyright 2023-present DreamNum Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export type FDocEmbedUnitFacadeMapAugmentation = never;
diff --git a/packages/docs/src/facade/index.ts b/packages/docs/src/facade/index.ts
index f5364c879d..c20c47f214 100644
--- a/packages/docs/src/facade/index.ts
+++ b/packages/docs/src/facade/index.ts
@@ -25,6 +25,5 @@ export type { FDocumentSectionPageSetup, IFDocumentSectionColumnOptions, IFDocum
export { FDocumentTextRange } from './f-document-text-range';
export type { IFDocumentTextRangeDescription, IFDocumentTextStyleRun } from './f-document-text-range';
export * from './f-enum';
-export type { FDocEmbedUnitFacadeMapAugmentation } from './f-types';
export type { IFDocumentTextRange } from './utils';
export { stripBlockTokens } from './utils';
diff --git a/packages/engine-formula/src/engine/utils/reference.ts b/packages/engine-formula/src/engine/utils/reference.ts
index 968a64b69c..653ca57dfa 100644
--- a/packages/engine-formula/src/engine/utils/reference.ts
+++ b/packages/engine-formula/src/engine/utils/reference.ts
@@ -15,7 +15,14 @@
*/
import type { IRange, IUnitRangeName, IUnitRangeWithName } from '@univerjs/core';
-import { AbsoluteRefType, columnLabelToNumber, MAX_COLUMN_COUNT, MAX_ROW_COUNT, RANGE_TYPE, Tools } from '@univerjs/core';
+import {
+ AbsoluteRefType,
+ columnLabelToNumber,
+ MAX_COLUMN_COUNT,
+ MAX_ROW_COUNT,
+ RANGE_TYPE,
+ Tools,
+} from '@univerjs/core';
import { includeFormulaLexerToken } from '../../basics/match-token';
import { isReferenceString, UNIT_NAME_REGEX_PRECOMPILING } from '../../basics/regex';
import { prefixToken, SPACE_TOKEN } from '../../basics/token';
diff --git a/packages/engine-formula/src/engine/value-object/array-value-object.ts b/packages/engine-formula/src/engine/value-object/array-value-object.ts
index 2c67607fbc..ad50acb8ae 100644
--- a/packages/engine-formula/src/engine/value-object/array-value-object.ts
+++ b/packages/engine-formula/src/engine/value-object/array-value-object.ts
@@ -58,10 +58,6 @@ enum ArrayCalculateType {
SINGLE,
}
-export function fromObjectToString(array: IArrayValueObject) {
- return '';
-}
-
export function transformToValueObject(array: Array<Array<number | string | boolean | null>> = [], isIgnoreNumberPattern: boolean = false) {
const arrayValueList: BaseValueObject[][] = [];
@@ -173,7 +169,7 @@ export class ArrayValueObject extends BaseValueObject {
}>;
constructor(rawValue: string | IArrayValueObject) {
- super(typeof rawValue === 'string' ? rawValue as string : fromObjectToString(rawValue as IArrayValueObject));
+ super();
this._values = this._formatValue(rawValue);
}
diff --git a/packages/engine-formula/src/engine/value-object/base-value-object.ts b/packages/engine-formula/src/engine/value-object/base-value-object.ts
index 04a98193e5..a1a75f01cf 100644
--- a/packages/engine-formula/src/engine/value-object/base-value-object.ts
+++ b/packages/engine-formula/src/engine/value-object/base-value-object.ts
@@ -37,10 +37,6 @@ export interface IArrayValueObject {
export class BaseValueObject extends ObjectClassType {
private _customData: CustomData;
- constructor(private _rawValue: string | number | boolean) {
- super();
- }
-
override isValueObject() {
return true;
}
@@ -531,7 +527,7 @@ export class ErrorValueObject extends BaseValueObject {
private _errorType: ErrorType,
private _errorContent: string = ''
) {
- super(_errorType);
+ super();
}
override getValue() {
diff --git a/packages/engine-formula/src/engine/value-object/cube-value-object.ts b/packages/engine-formula/src/engine/value-object/cube-value-object.ts
index e82b306d5e..f629584b8d 100644
--- a/packages/engine-formula/src/engine/value-object/cube-value-object.ts
+++ b/packages/engine-formula/src/engine/value-object/cube-value-object.ts
@@ -30,7 +30,7 @@ export class CubeValueObject extends BaseValueObject {
private _values: ArrayValueObject[] = [];
constructor(values: ArrayValueObject[]) {
- super('');
+ super();
this._values = values;
}
diff --git a/packages/engine-formula/src/engine/value-object/lambda-value-object.ts b/packages/engine-formula/src/engine/value-object/lambda-value-object.ts
index fb7f52886c..110f63a1cd 100644
--- a/packages/engine-formula/src/engine/value-object/lambda-value-object.ts
+++ b/packages/engine-formula/src/engine/value-object/lambda-value-object.ts
@@ -66,7 +66,7 @@ export class LambdaValueObjectObject extends BaseValueObject {
private _lambdaPrivacyVarKeys: string[]
) {
- super(0);
+ super();
this._lambdaPrivacyValueMap.clear();
}
diff --git a/packages/engine-formula/src/engine/value-object/primitive-object.ts b/packages/engine-formula/src/engine/value-object/primitive-object.ts
index 62369bc22e..5f0a462c04 100644
--- a/packages/engine-formula/src/engine/value-object/primitive-object.ts
+++ b/packages/engine-formula/src/engine/value-object/primitive-object.ts
@@ -33,7 +33,7 @@ export class NullValueObject extends BaseValueObject {
private static _instance: NullValueObject;
static create() {
- this._instance = this._instance || new NullValueObject(0);
+ this._instance = this._instance || new NullValueObject();
return this._instance;
}
@@ -229,7 +229,7 @@ export class BooleanValueObject extends BaseValueObject {
}
constructor(rawValue: boolean) {
- super(rawValue);
+ super();
this._value = rawValue;
}
@@ -448,7 +448,7 @@ export class NumberValueObject extends BaseValueObject {
}
constructor(rawValue: number) {
- super(rawValue);
+ super();
this._value = Number(rawValue);
}
@@ -1433,7 +1433,7 @@ export class StringValueObject extends BaseValueObject {
};
constructor(rawValue: string) {
- super(rawValue);
+ super();
this._value = rawValue;
}
diff --git a/packages/sheets/src/facade/f-types.ts b/packages/sheets/src/facade/f-types.ts
deleted file mode 100644
index 39b044acfe..0000000000
--- a/packages/sheets/src/facade/f-types.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Copyright 2023-present DreamNum Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export type FSheetEmbedUnitFacadeMapAugmentation = never;
diff --git a/packages/sheets/src/facade/index.ts b/packages/sheets/src/facade/index.ts
index 33ecd5247a..72472cb488 100644
--- a/packages/sheets/src/facade/index.ts
+++ b/packages/sheets/src/facade/index.ts
@@ -21,7 +21,6 @@ export * from './f-enum';
export * from './f-event';
export { FRange } from './f-range';
export { FSelection } from './f-selection';
-export type { FSheetEmbedUnitFacadeMapAugmentation } from './f-types';
export type * from './f-univer';
export { FWorkbook } from './f-workbook';
export { FWorksheet } from './f-worksheet';