@univerjs/core 0.1.17 → 0.2.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.
Files changed (32) hide show
  1. package/lib/cjs/index.js +8 -8
  2. package/lib/es/index.js +2075 -1899
  3. package/lib/types/common/interceptor.d.ts +1 -1
  4. package/lib/types/common/url.d.ts +16 -0
  5. package/lib/types/docs/data-model/document-data-model.d.ts +3 -3
  6. package/lib/types/docs/data-model/json-x/json-x.d.ts +1 -1
  7. package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +4 -1
  8. package/lib/types/docs/data-model/text-x/utils.d.ts +13 -1
  9. package/lib/types/docs/data-model/types.d.ts +2 -2
  10. package/lib/types/index.d.ts +4 -0
  11. package/lib/types/services/__tests__/index.d.ts +18 -0
  12. package/lib/types/services/command/command.service.d.ts +1 -0
  13. package/lib/types/services/resource-loader/resource-loader.service.d.ts +2 -0
  14. package/lib/types/services/resource-loader/type.d.ts +3 -0
  15. package/lib/types/services/resource-manager/resource-manager.service.d.ts +5 -0
  16. package/lib/types/services/resource-manager/type.d.ts +1 -0
  17. package/lib/types/services/user-manager/user-manager.service.d.ts +2 -2
  18. package/lib/types/shared/__tests__/name.spec.d.ts +16 -0
  19. package/lib/types/shared/common.d.ts +2 -7
  20. package/lib/types/shared/name.d.ts +26 -0
  21. package/lib/types/shared/tools.d.ts +2 -0
  22. package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +6 -6
  23. package/lib/types/sheets/range.d.ts +1 -5
  24. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +3 -3
  25. package/lib/types/types/interfaces/i-cell-data.d.ts +1 -1
  26. package/lib/types/types/interfaces/i-document-data.d.ts +24 -1
  27. package/lib/types/types/interfaces/i-selection-data.d.ts +7 -2
  28. package/lib/types/types/interfaces/i-style-data.d.ts +4 -0
  29. package/lib/umd/index.js +8 -8
  30. package/package.json +7 -7
  31. package/lib/types/services/__test__/index.d.ts +0 -18
  32. /package/lib/types/services/{__test__ → __tests__}/permission.spec.d.ts +0 -0
@@ -10,7 +10,7 @@ export type IComposeInterceptors<T = any, C = any> = (interceptors: Array<IInter
10
10
  /**
11
11
  * A helper to compose a certain type of interceptors.
12
12
  */
13
- export declare const composeInterceptors: <T, C>(interceptors: Array<IInterceptor<T, C>>) => (initValue: Nullable<T>, initContext: C) => Nullable<T>;
13
+ export declare const composeInterceptors: <T, C>(interceptors: Array<IInterceptor<T, C>>) => ReturnType<IComposeInterceptors<T, C>>;
14
14
  export declare class InterceptorManager<P extends Record<string, IInterceptor<any, any>>> {
15
15
  private _interceptorsByName;
16
16
  private _interceptorPoints;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare function isLegalUrl(url: string): boolean;
@@ -44,15 +44,15 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
44
44
  dispose(): void;
45
45
  getDrawings(): IDrawings | undefined;
46
46
  getDrawingsOrder(): string[] | undefined;
47
+ getCustomRanges(): import('../../types/interfaces/i-document-data').ICustomRange[] | undefined;
48
+ getCustomDecorations(): import('../../types/interfaces/i-document-data').ICustomDecoration[] | undefined;
47
49
  getRev(): number;
48
50
  incrementRev(): void;
49
51
  getSettings(): import('../../types/interfaces/i-document-data').IDocumentSettings | undefined;
50
52
  reset(snapshot: Partial<IDocumentData>): void;
51
53
  getSelfOrHeaderFooterModel(segmentId?: string): DocumentDataModel;
52
54
  getUnitId(): string;
53
- apply(actions: JSONXActions): string | number | boolean | import('ot-json1').Doc[] | {
54
- [k: string]: import('ot-json1').Doc;
55
- } | null | undefined;
55
+ apply(actions: JSONXActions): IDocumentData | undefined;
56
56
  sliceBody(startOffset: number, endOffset: number): Nullable<IDocumentBody>;
57
57
  private _initializeHeaderFooterModel;
58
58
  updateDocumentId(unitId: string): void;
@@ -34,5 +34,5 @@ export declare class JSONX {
34
34
  moveOp(from: Path, to: Path): JSONOp;
35
35
  insertOp(path: Path, value: any): JSONOp;
36
36
  replaceOp(path: Path, oldVal: any, newVal: any): JSONOp;
37
- editOp(subOp: TextXAction[]): JSONOp;
37
+ editOp(subOp: TextXAction[], path?: string[]): JSONOp;
38
38
  }
@@ -1,4 +1,4 @@
1
- import { ICustomBlock, ICustomRange, IDocumentBody, IParagraph, ISectionBreak, ITable, ITextRun } from '../../../../types/interfaces';
1
+ import { ICustomBlock, ICustomDecoration, ICustomRange, IDocumentBody, IParagraph, ISectionBreak, ITable, ITextRun } from '../../../../types/interfaces';
2
2
 
3
3
  export declare function normalizeTextRuns(textRuns: ITextRun[]): ITextRun[];
4
4
  /**
@@ -22,9 +22,12 @@ export declare function insertSectionBreaks(body: IDocumentBody, insertBody: IDo
22
22
  export declare function insertCustomBlocks(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
23
23
  export declare function insertTables(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
24
24
  export declare function insertCustomRanges(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
25
+ export declare function mergeDecorations(customDecorations: ICustomDecoration[]): ICustomDecoration[];
26
+ export declare function insertCustomDecorations(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
25
27
  export declare function deleteTextRuns(body: IDocumentBody, textLength: number, currentIndex: number): ITextRun[];
26
28
  export declare function deleteParagraphs(body: IDocumentBody, textLength: number, currentIndex: number): IParagraph[];
27
29
  export declare function deleteSectionBreaks(body: IDocumentBody, textLength: number, currentIndex: number): ISectionBreak[];
28
30
  export declare function deleteCustomBlocks(body: IDocumentBody, textLength: number, currentIndex: number): ICustomBlock[];
29
31
  export declare function deleteTables(body: IDocumentBody, textLength: number, currentIndex: number): ITable[];
30
32
  export declare function deleteCustomRanges(body: IDocumentBody, textLength: number, currentIndex: number): ICustomRange[];
33
+ export declare function deleteCustomDecorations(body: IDocumentBody, textLength: number, currentIndex: number, needOffset?: boolean): ICustomDecoration[];
@@ -1,7 +1,19 @@
1
1
  import { UpdateDocsAttributeType } from '../../../shared/command-enum';
2
- import { IDocumentBody } from '../../../types/interfaces/i-document-data';
2
+ import { ICustomDecoration, IDocumentBody } from '../../../types/interfaces/i-document-data';
3
3
  import { IRetainAction } from './action-types';
4
4
 
5
5
  export declare function getBodySlice(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyTextRun?: boolean): IDocumentBody;
6
+ export declare function normalizeBody(body: IDocumentBody): IDocumentBody;
7
+ export declare function getCustomRangeSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
8
+ customRanges: {
9
+ startIndex: number;
10
+ endIndex: number;
11
+ rangeId: string;
12
+ rangeType: import('../../../types/interfaces/i-document-data').CustomRangeType;
13
+ }[];
14
+ leftOffset: number;
15
+ rightOffset: number;
16
+ };
17
+ export declare function getCustomDecorationSlice(body: IDocumentBody, startOffset: number, endOffset: number): ICustomDecoration[];
6
18
  export declare function composeBody(thisBody: IDocumentBody, otherBody: IDocumentBody, coverType?: UpdateDocsAttributeType): IDocumentBody;
7
19
  export declare function isUselessRetainAction(action: IRetainAction): boolean;
@@ -28,8 +28,8 @@ export declare enum DataStreamTreeTokenType {
28
28
  TABLE_ROW_START = "\u001B",// 表格开始
29
29
  TABLE_CELL_START = "\u001C",// 表格开始
30
30
  TABLE_CELL_END = "\u001D",// 表格开始
31
- TABLE_ROW_END = "\u001E",// 表格开始
32
- TABLE_END = "\u001F",// 表格结束
31
+ TABLE_ROW_END = "*",// 表格开始
32
+ TABLE_END = "+",// 表格结束
33
33
  CUSTOM_RANGE_START = "\u001F",// 自定义范围开始
34
34
  CUSTOM_RANGE_END = "\u001E",// 自定义范围结束
35
35
  COLUMN_BREAK = "\v",// 换列
@@ -106,3 +106,7 @@ export { AuthzIoLocalService } from './services/authz-io/authz-io-local.service'
106
106
  export { IAuthzIoService } from './services/authz-io/type';
107
107
  export { createDefaultUser } from './services/user-manager/const';
108
108
  export { skipParseTagNames } from './types/const/clipboard';
109
+ export { normalizeBody, getCustomRangeSlice, getCustomDecorationSlice } from './docs/data-model/text-x/utils';
110
+ export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
111
+ export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
112
+ export { nameCharacterCheck } from './shared/name';
@@ -0,0 +1,18 @@
1
+ import { ICommandService, Univer } from '@univerjs/core';
2
+ import { Dependency } from '@wendellhu/redi';
3
+
4
+ export declare const createTestBed: (dependencies?: Dependency[]) => {
5
+ univer: Univer;
6
+ get: {
7
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
8
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
9
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
10
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
11
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
12
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
13
+ };
14
+ workbook: import('@univerjs/core').Workbook;
15
+ unitId: string;
16
+ subUnitId: string;
17
+ commandService: ICommandService;
18
+ };
@@ -84,6 +84,7 @@ export interface IExecutionOptions {
84
84
  onlyLocal?: boolean;
85
85
  /** This command is from collaboration peers. */
86
86
  fromCollab?: boolean;
87
+ fromChangeset?: boolean;
87
88
  [key: PropertyKey]: string | number | boolean | undefined;
88
89
  }
89
90
  export type CommandListener = (commandInfo: Readonly<ICommandInfo>, options?: IExecutionOptions) => void;
@@ -3,6 +3,7 @@ import { IWorkbookData } from '../../types/interfaces';
3
3
  import { IResourceManagerService } from '../resource-manager/type';
4
4
  import { IUniverInstanceService } from '../instance/instance.service';
5
5
  import { Disposable } from '../../shared/lifecycle';
6
+ import { DocumentDataModel } from '../../docs';
6
7
  import { IResourceLoaderService } from './type';
7
8
 
8
9
  export declare class ResourceLoaderService extends Disposable implements IResourceLoaderService {
@@ -11,4 +12,5 @@ export declare class ResourceLoaderService extends Disposable implements IResour
11
12
  constructor(_resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService);
12
13
  private _init;
13
14
  saveWorkbook: (workbook: Workbook) => IWorkbookData;
15
+ saveDoc(doc: DocumentDataModel): import('../../types/interfaces').IDocumentData;
14
16
  }
@@ -1,7 +1,10 @@
1
1
  import { Workbook } from '../../sheets/workbook';
2
2
  import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
3
+ import { IDocumentData } from '../../types/interfaces';
4
+ import { DocumentDataModel } from '../../docs';
3
5
 
4
6
  export interface IResourceLoaderService {
5
7
  saveWorkbook: (workbook: Workbook) => IWorkbookData;
8
+ saveDoc: (doc: DocumentDataModel) => IDocumentData;
6
9
  }
7
10
  export declare const IResourceLoaderService: import('@wendellhu/redi').IdentifierDecorator<IResourceLoaderService>;
@@ -1,5 +1,6 @@
1
1
  import { Disposable } from '../../shared/lifecycle';
2
2
  import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
3
+ import { UniverInstanceType } from '../../common/unit';
3
4
  import { IResourceHook, IResourceManagerService, IResourceName } from './type';
4
5
 
5
6
  export declare class ResourceManagerService extends Disposable implements IResourceManagerService {
@@ -11,6 +12,10 @@ export declare class ResourceManagerService extends Disposable implements IResou
11
12
  name: `SHEET_${string}_PLUGIN` | `DOC_${string}_PLUGIN`;
12
13
  data: string;
13
14
  }[];
15
+ getResourcesByType(unitId: string, type: UniverInstanceType): {
16
+ name: `SHEET_${string}_PLUGIN` | `DOC_${string}_PLUGIN`;
17
+ data: string;
18
+ }[];
14
19
  registerPluginResource<T = unknown>(hook: IResourceHook<T>): import('@wendellhu/redi').IDisposable;
15
20
  disposePluginResource(pluginName: IResourceName): void;
16
21
  loadResources(unitId: string, resources: IWorkbookData['resources']): void;
@@ -19,6 +19,7 @@ export interface IResourceManagerService {
19
19
  disposePluginResource: (pluginName: IResourceName) => void;
20
20
  getAllResourceHooks: () => IResourceHook[];
21
21
  getResources: (unitId: string) => IWorkbookData['resources'];
22
+ getResourcesByType: (unitId: string, type: UniverInstanceType) => IWorkbookData['resources'];
22
23
  loadResources: (unitId: string, resources: IWorkbookData['resources']) => void;
23
24
  unloadResources(unitId: string): void;
24
25
  }
@@ -22,10 +22,10 @@ export declare class UserManagerService {
22
22
  private _model;
23
23
  private _userChange$;
24
24
  userChange$: import('rxjs').Observable<{
25
- type: 'add' | 'delete';
25
+ type: "add" | "delete";
26
26
  user: IUser;
27
27
  } | {
28
- type: 'clear';
28
+ type: "clear";
29
29
  }>;
30
30
  private _currentUser$;
31
31
  /**
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -1,11 +1,11 @@
1
1
  import { IRange } from '../types/interfaces';
2
2
  import { ICellData, ICellDataForSheetInterceptor } from '../types/interfaces/i-cell-data';
3
3
  import { IDocumentData } from '../types/interfaces/i-document-data';
4
- import { IRangeWithCoord, ISelectionCell, ISelectionCellWithCoord } from '../types/interfaces/i-selection-data';
4
+ import { IRangeWithCoord, ISelectionCell, ISelectionCellWithMergeInfo } from '../types/interfaces/i-selection-data';
5
5
  import { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
6
6
  import { Nullable } from './types';
7
7
 
8
- export declare function makeCellToSelection(cellInfo: Nullable<ISelectionCellWithCoord>): Nullable<IRangeWithCoord>;
8
+ export declare function makeCellToSelection(cellInfo: Nullable<ISelectionCellWithMergeInfo>): Nullable<IRangeWithCoord>;
9
9
  export declare function makeCellRangeToRangeData(cellInfo: Nullable<ISelectionCell>): Nullable<IRange>;
10
10
  export declare function isEmptyCell(cell: Nullable<ICellData>): boolean;
11
11
  export declare function isCellCoverable(cell: Nullable<ICellDataForSheetInterceptor>): boolean;
@@ -22,11 +22,6 @@ export declare function isFormulaString(value: any): boolean;
22
22
  * @returns
23
23
  */
24
24
  export declare function isFormulaId(value: any): boolean;
25
- /**
26
- * Convert rich text json to DOM
27
- * @param p
28
- */
29
- export declare function handleJsonToDom(p: IDocumentData): string;
30
25
  /**
31
26
  * transform style object to string
32
27
  * @param style
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * The name you entered for the worksheet or chart is invalid. Please ensure:
18
+
19
+ The name is no more than 31 characters.
20
+ The first and last characters cannot be '
21
+ The name does not contain any of the following characters: : \ / ? * [ or ].
22
+ The name is not empty.
23
+ * @param name
24
+ * @returns
25
+ */
26
+ export declare function nameCharacterCheck(name: string): boolean;
@@ -36,6 +36,7 @@ export declare class Tools {
36
36
  static isWeChat(): boolean;
37
37
  static isAndroid(): boolean;
38
38
  static isIPhone(): boolean;
39
+ static isLegalUrl(url: string): boolean;
39
40
  static itCount(count: number): Function;
40
41
  static hasLength(target: IArguments | any[] | string, length?: number): boolean;
41
42
  static capitalize(str: string): string;
@@ -105,4 +106,5 @@ export declare class Tools {
105
106
  * @param value
106
107
  */
107
108
  static set(data: Record<string, any>, propertyPath: string, value: any): void;
109
+ static clamp(value: number, min: number, max: number): number;
108
110
  }
@@ -4,12 +4,12 @@ import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
4
4
  export declare function createCoreTestBed(workbookData?: IWorkbookData): {
5
5
  univer: Univer;
6
6
  get: {
7
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
8
- <T_1>(id: import('@wendellhu/redi').DependencyIdentifier<T_1>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_1[];
9
- <T_2>(id: import('@wendellhu/redi').DependencyIdentifier<T_2>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_2 | null;
10
- <T_3>(id: import('@wendellhu/redi').DependencyIdentifier<T_3>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_3;
11
- <T_4>(id: import('@wendellhu/redi').DependencyIdentifier<T_4>, quantity?: import('@wendellhu/redi').Quantity | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_4 | T_4[] | null;
12
- <T_5>(id: import('@wendellhu/redi').DependencyIdentifier<T_5>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_5 | T_5[] | null;
7
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
8
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
9
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
10
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
11
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
12
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
13
13
  };
14
14
  sheet: import('../workbook').Workbook;
15
15
  };
@@ -1,5 +1,5 @@
1
1
  import { IObjectMatrixPrimitiveType, Nullable, ObjectMatrix } from '../shared';
2
- import { HorizontalAlign, VerticalAlign, WrapStrategy, BooleanNumber, FontItalic, FontWeight } from '../types/enum';
2
+ import { HorizontalAlign, VerticalAlign, BooleanNumber, FontItalic, FontWeight, WrapStrategy } from '../types/enum';
3
3
  import { IBorderData, ICellData, IDocumentBody, IDocumentData, IRange, IStyleBase, IStyleData, ITextDecoration, ITextRotation } from '../types/interfaces';
4
4
  import { Styles } from './styles';
5
5
  import { Worksheet } from './worksheet';
@@ -275,10 +275,6 @@ export declare class Range {
275
275
  * Returns whether the text in the cell wraps.
276
276
  */
277
277
  getWrap(): BooleanNumber;
278
- /**
279
- * Returns whether the text in the cells wrap.
280
- */
281
- getWraps(): BooleanNumber[][];
282
278
  /**
283
279
  * Returns the text wrapping strategies for the cells in the range.
284
280
  */
@@ -1,15 +1,15 @@
1
1
  import { Nullable } from '../../shared';
2
2
  import { Worksheet } from '../../sheets/worksheet';
3
3
  import { Workbook } from '../../sheets/workbook';
4
- import { ISelectionCellWithCoord } from './i-selection-data';
4
+ import { ISelectionCellWithMergeInfo } from './i-selection-data';
5
5
  import { IStyleData } from './i-style-data';
6
6
  import { ICellDataForSheetInterceptor } from './i-cell-data';
7
7
 
8
8
  export interface ICellRenderContext {
9
9
  data: ICellDataForSheetInterceptor;
10
10
  style: Nullable<IStyleData>;
11
- primaryWithCoord: ISelectionCellWithCoord;
12
- unitId?: string;
11
+ primaryWithCoord: ISelectionCellWithMergeInfo;
12
+ unitId: string;
13
13
  subUnitId: string;
14
14
  row: number;
15
15
  col: number;
@@ -64,4 +64,4 @@ export interface ICellDataForSheetInterceptor extends ICellData {
64
64
  export declare function isICellData(value: any): value is ICellData;
65
65
  export declare function getCellValueType(cell: ICellData): CellValueType | null | undefined;
66
66
  export declare function isNullCell(cell: Nullable<ICellData>): boolean;
67
- export declare function isCellV(cell: Nullable<ICellData | CellValue>): boolean;
67
+ export declare function isCellV(cell: Nullable<ICellData | CellValue>): cell is string | number | boolean;
@@ -98,6 +98,7 @@ export interface IDocumentBody {
98
98
  customBlocks?: ICustomBlock[];
99
99
  tables?: ITable[];
100
100
  customRanges?: ICustomRange[];
101
+ customDecorations?: ICustomDecoration[];
101
102
  }
102
103
  export interface IDocStyle {
103
104
  name: string;
@@ -202,6 +203,14 @@ export interface ICustomRange {
202
203
  rangeId: string;
203
204
  rangeType: CustomRangeType;
204
205
  }
206
+ export interface ICustomRangeForInterceptor extends ICustomRange {
207
+ active?: boolean;
208
+ show?: boolean;
209
+ }
210
+ export interface ICustomDecorationForInterceptor extends ICustomDecoration {
211
+ active?: boolean;
212
+ show?: boolean;
213
+ }
205
214
  export declare enum CustomRangeType {
206
215
  HYPERLINK = 0,
207
216
  FIELD = 1,// 17.16 Fields and Hyperlinks
@@ -219,6 +228,15 @@ export interface ICustomBlock {
219
228
  blockType?: BlockType;
220
229
  blockId: string;
221
230
  }
231
+ export declare enum CustomDecorationType {
232
+ COMMENT = 0
233
+ }
234
+ export interface ICustomDecoration {
235
+ startIndex: number;
236
+ endIndex: number;
237
+ id: string;
238
+ type: CustomDecorationType;
239
+ }
222
240
  /**
223
241
  * Type of block
224
242
  */
@@ -234,7 +252,11 @@ export interface IHeaderAndFooterBase {
234
252
  firstPageHeaderId?: string;
235
253
  firstPageFooterId?: string;
236
254
  useFirstPageHeaderFooter?: BooleanNumber;
237
- useEvenPageHeaderFooter?: BooleanNumber;
255
+ evenAndOddHeaders?: BooleanNumber;
256
+ }
257
+ export declare enum DocumentFlavor {
258
+ TRADITIONAL = 0,
259
+ MODERN = 1
238
260
  }
239
261
  /**
240
262
  * Basics properties of doc style
@@ -243,6 +265,7 @@ export interface IDocStyleBase extends IMargin {
243
265
  pageNumberStart?: number;
244
266
  pageSize?: ISize;
245
267
  pageOrient?: PageOrientType;
268
+ documentFlavor?: DocumentFlavor;
246
269
  marginHeader?: number;
247
270
  marginFooter?: number;
248
271
  renderConfig?: IDocumentRenderConfig;
@@ -20,7 +20,7 @@ export interface IRangeWithCoord extends IPosition, IRange {
20
20
  }
21
21
  export interface ISelectionCell extends IRange, ISingleCell {
22
22
  }
23
- export interface ISelectionCellWithCoord extends IPosition, ISingleCell {
23
+ export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
24
24
  mergeInfo: IRangeWithCoord;
25
25
  }
26
26
  export interface ISelection {
@@ -33,9 +33,13 @@ export interface ISelection {
33
33
  */
34
34
  primary: Nullable<ISelectionCell>;
35
35
  }
36
+ /**
37
+ * Selection range Info, contains selectionrange & primaryrange
38
+ * primaryrange is the range of the highlighted cell.
39
+ */
36
40
  export interface ISelectionWithCoord {
37
41
  rangeWithCoord: IRangeWithCoord;
38
- primaryWithCoord: Nullable<ISelectionCellWithCoord>;
42
+ primaryWithCoord: Nullable<ISelectionCellWithMergeInfo>;
39
43
  }
40
44
  export interface ITextRangeStart {
41
45
  startOffset: number;
@@ -46,6 +50,7 @@ export interface ITextRange extends ITextRangeStart {
46
50
  }
47
51
  export interface ITextRangeParam extends ITextRange {
48
52
  segmentId?: string;
53
+ segmentPage?: number;
49
54
  isActive?: boolean;
50
55
  }
51
56
  /**
@@ -112,6 +112,10 @@ export interface IStyleBase {
112
112
  * underline
113
113
  */
114
114
  ul?: ITextDecoration;
115
+ /**
116
+ * bottomBorerLine
117
+ */
118
+ bbl?: ITextDecoration;
115
119
  /**
116
120
  * strikethrough
117
121
  */