@univerjs/core 1.0.0-alpha.7 → 1.0.0-alpha.8

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 (34) hide show
  1. package/lib/cjs/facade.js +6 -138
  2. package/lib/cjs/index.js +272 -462
  3. package/lib/es/facade.js +8 -134
  4. package/lib/es/index.js +271 -459
  5. package/lib/facade.js +8 -134
  6. package/lib/index.js +271 -459
  7. package/lib/types/bases/index.d.ts +1 -1
  8. package/lib/types/bases/typedef.d.ts +23 -0
  9. package/lib/types/docs/data-model/paragraph-style.d.ts +7 -1
  10. package/lib/types/docs/data-model/rich-text-builder.d.ts +11 -1
  11. package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +1 -1
  12. package/lib/types/docs/data-model/text-x/utils.d.ts +1 -0
  13. package/lib/types/docs/data-model/types.d.ts +0 -2
  14. package/lib/types/facade/f-univer.d.ts +1 -22
  15. package/lib/types/facade/index.d.ts +0 -1
  16. package/lib/types/services/context/context.d.ts +0 -2
  17. package/lib/types/services/instance/instance.service.d.ts +0 -8
  18. package/lib/types/shared/common.d.ts +0 -5
  19. package/lib/types/shared/object-matrix.d.ts +0 -14
  20. package/lib/types/shared/rectangle.d.ts +0 -15
  21. package/lib/types/shared/tools.d.ts +0 -2
  22. package/lib/types/sheets/sheet-skeleton.d.ts +2 -6
  23. package/lib/types/sheets/typedef.d.ts +0 -14
  24. package/lib/types/sheets/workbook.d.ts +0 -2
  25. package/lib/types/sheets/worksheet.d.ts +0 -6
  26. package/lib/types/types/const/page-size.d.ts +2 -0
  27. package/lib/types/types/enum/theme-color-type.d.ts +0 -4
  28. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +0 -2
  29. package/lib/types/types/interfaces/i-document-data.d.ts +93 -12
  30. package/lib/types/types/interfaces/i-style-data.d.ts +43 -0
  31. package/lib/umd/facade.js +1 -1
  32. package/lib/umd/index.js +21 -21
  33. package/package.json +4 -4
  34. package/lib/types/facade/f-hooks.d.ts +0 -74
@@ -16,4 +16,4 @@
16
16
  export { BaseDataModel } from './base-data-model';
17
17
  export { createDefaultBaseTableSnapshot, getEmptySnapshot as getBasesEmptySnapshot, type ICreateDefaultBaseTableSnapshotOptions, } from './empty-snapshot';
18
18
  export { BaseFieldType, BaseFilterConjunction, BaseFilterOperator, BaseSortDirection, BaseViewType } from './typedef';
19
- export type { BaseCellMatrix, BaseCellPrimitiveValue, CellValue as BaseCellValue, BaseCellValueType, BaseHitTestResult, BaseId, PrimitiveCellValue as BasePrimitiveCellValue, BaseSelection, BaseSnapshot, BaseViewProjection, FieldConfig, FieldId, FieldSnapshot, IBaseCellData, IBaseInvalidation, IBaseRect, IBaseResources, IBaseSnapshot, IBaseViewColorCondition, IBaseViewport, ICalendarEventResizeSelection, ICalendarEventSelection, ICalendarProjection, ICalendarViewConfig, ICardLayoutConfig, IFieldCapabilities, IFieldSnapshot, IFilterCondition, IFilterConfig, IGalleryCardSelection, IGalleryProjection, IGalleryViewConfig, IGanttBarSelection, IGanttCellSelection, IGanttProjection, IGanttTimeColumn, IGanttViewConfig, IGridCellSelection, IGridFieldSelection, IGridGroupSelection, IGridProjection, IGridRecordSelection, IGridViewConfig, IGroupConfig, IInvalidViewProjection, IKanbanCardSelection, IKanbanColumnSetting, IKanbanFieldCardSetting, IKanbanProjection, IKanbanViewConfig, IProjectedField, IProjectedGroup, IProjectedRow, IRecordSnapshot, ISortConfig, ITableSnapshot, IValidationResult, IViewFieldSetting, IViewProjection, IViewSnapshot, KanbanCardLayoutMode, RecordId, RecordSnapshot, TableId, TableSnapshot, ViewId, ViewSnapshot, ViewSpecificConfig, } from './typedef';
19
+ export type { BaseCellMatrix, BaseCellPrimitiveValue, CellValue as BaseCellValue, BaseCellValueType, BaseHitTestResult, BaseId, PrimitiveCellValue as BasePrimitiveCellValue, BaseSelection, BaseSnapshot, BaseViewProjection, FieldConfig, FieldId, FieldSnapshot, IBaseAttachment, IBaseCellData, IBaseInvalidation, IBaseRect, IBaseResources, IBaseSnapshot, IBaseViewColorCondition, IBaseViewport, ICalendarEventResizeSelection, ICalendarEventSelection, ICalendarProjection, ICalendarViewConfig, ICardLayoutConfig, IFieldCapabilities, IFieldSnapshot, IFilterCondition, IFilterConfig, IGalleryCardSelection, IGalleryProjection, IGalleryViewConfig, IGanttBarSelection, IGanttCellSelection, IGanttProjection, IGanttTimeColumn, IGanttViewConfig, IGridCellSelection, IGridFieldSelection, IGridGroupSelection, IGridProjection, IGridRecordSelection, IGridViewConfig, IGroupConfig, IInvalidViewProjection, IKanbanCardSelection, IKanbanColumnSetting, IKanbanFieldCardSetting, IKanbanProjection, IKanbanViewConfig, IProjectedField, IProjectedGroup, IProjectedRow, IRecordSnapshot, ISortConfig, ITableSnapshot, IValidationResult, IViewFieldSetting, IViewProjection, IViewSnapshot, KanbanCardLayoutMode, RecordId, RecordSnapshot, TableId, TableSnapshot, ViewId, ViewSnapshot, ViewSpecificConfig, } from './typedef';
@@ -13,6 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { ImageSourceType } from '../services/image-io/image-io.service';
17
+ import type { IResources } from '../services/resource-manager/type';
16
18
  import type { CellValueType, LocaleType } from '../types/enum';
17
19
  import type { IDocumentData } from '../types/interfaces';
18
20
  export type BaseId = string;
@@ -38,6 +40,26 @@ export interface IBaseResources {
38
40
  attachmentSets?: Record<string, string[]>;
39
41
  attachments?: Record<string, Record<string, unknown>>;
40
42
  }
43
+ export interface IBaseAttachment {
44
+ /** Stable attachment identifier. Use the uploaded file id for remote attachments. */
45
+ id: string;
46
+ /** Display name, including the file extension when available. */
47
+ name: string;
48
+ /** MIME type used to classify and preview the attachment. */
49
+ mimeType?: string;
50
+ /** File size in bytes. */
51
+ size?: number;
52
+ /** Image width in pixels when known. */
53
+ width?: number;
54
+ /** Image height in pixels when known. */
55
+ height?: number;
56
+ /** How to interpret `source`, for example UUID, URL, or Base64 data. */
57
+ sourceType?: ImageSourceType;
58
+ /** Canonical attachment source: an uploaded file id, URL, or Base64 data URL. */
59
+ source?: string;
60
+ /** Optional preview source when it is distinct from the canonical attachment source. */
61
+ thumbnail?: string;
62
+ }
41
63
  export declare enum BaseFieldType {
42
64
  Text = "text",
43
65
  SingleSelect = "singleSelect",
@@ -90,6 +112,7 @@ export interface IBaseSnapshot {
90
112
  createdAt: number;
91
113
  updatedAt: number;
92
114
  createdBy?: string;
115
+ resources?: IResources;
93
116
  }
94
117
  export interface ITableSnapshot {
95
118
  id: TableId;
@@ -14,9 +14,15 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { Nullable } from '../../shared';
17
- import type { IDocumentStyle, IParagraphStyle } from '../../types/interfaces';
17
+ import type { IDocStyles, IDocumentStyle, IParagraphStyle } from '../../types/interfaces';
18
18
  export interface IResolveDocumentParagraphStyleOptions {
19
+ /** Exclude document-level outer spacing while retaining all other defaults. */
19
20
  excludeDocumentOuterSpacing?: boolean;
21
+ /** Preserve the legacy Modern Doc spacing defaults when no explicit flavor is available. */
20
22
  useLegacyModernDefaults?: boolean;
23
+ /** Named document styles keyed by stable style id. */
24
+ styles?: IDocStyles;
25
+ /** Named paragraph style referenced by the paragraph. */
26
+ paragraphStyleId?: string;
21
27
  }
22
28
  export declare function resolveDocumentParagraphStyle(documentStyle: Nullable<IDocumentStyle>, paragraphStyle: Nullable<IParagraphStyle>, options?: IResolveDocumentParagraphStyleOptions): IParagraphStyle;
@@ -32,7 +32,9 @@ export declare function normalizeData(data: IDocumentData): IDocumentData;
32
32
  * Agent-friendly text style aliases accepted by `RichTextBuilder.span()`.
33
33
  *
34
34
  * The readable aliases can be combined in one object and apply only to the appended span. Native `ITextStyle` fields
35
- * remain available for advanced document integrations.
35
+ * remain available for advanced document integrations. Drawing effects such as `glow` and `outerShadow` are
36
+ * especially useful when the resulting rich text is attached to a Shape; standalone document products may not expose
37
+ * dedicated controls for them.
36
38
  *
37
39
  * @example
38
40
  * ```ts
@@ -43,6 +45,14 @@ export declare function normalizeData(data: IDocumentData): IDocumentData;
43
45
  * italic: true,
44
46
  * color: '#dc2626',
45
47
  * background: '#fee2e2',
48
+ * glow: { color: '#f97316', radius: 6 },
49
+ * outerShadow: {
50
+ * color: '#000000',
51
+ * opacity: 0.35,
52
+ * blurRadius: 4,
53
+ * distance: 3,
54
+ * direction: 45,
55
+ * },
46
56
  * });
47
57
  * ```
48
58
  */
@@ -70,7 +70,7 @@ export declare class BuildTextUtils {
70
70
  export { getSingleDataStreamChange } from './data-stream-change';
71
71
  export type { IDataStreamChange } from './data-stream-change';
72
72
  export { getCustomBlockIdsInSelections } from './drawings';
73
- export { getParagraphContentStartOffset, getParagraphContentStartOffsets, getParagraphFollowingBlockOffset } from './paragraph';
73
+ export { getParagraphContentStartOffset, getParagraphContentStartOffsets, getParagraphFollowingBlockOffset, } from './paragraph';
74
74
  export { containsInteriorInsertionOffset, containsStreamIndex, getBlockRangeInterval, getColumnGroupRangeInterval, getCustomBlockInterval, getCustomRangeInterval, getExclusiveRangeInterval, getInclusiveRangeInterval, getTableCellTokenInterval, getTableRangeInterval, getTableRowTokenInterval, intersectsOperationalIntervals, shiftExclusiveRangeOnDelete, shiftExclusiveRangeOnInsert, shiftInclusiveRangeOnDelete, shiftInclusiveRangeOnInsert, } from './range-interval';
75
75
  export type { IDocOperationalInterval } from './range-interval';
76
76
  export type { IAddCustomRangeTextXParam, IDeleteCustomRangeParam, IReplaceSelectionTextXParams } from './text-x-utils';
@@ -37,6 +37,7 @@ export declare function getColumnGroupSlice(body: IDocumentBody, startOffset: nu
37
37
  export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number, type?: SliceBodyType): {
38
38
  startIndex: number;
39
39
  paragraphId: string;
40
+ styleId?: string;
40
41
  paragraphStyle?: import("../../..").IParagraphStyle;
41
42
  bullet?: import("../../..").IBullet;
42
43
  }[] | undefined;
@@ -55,5 +55,3 @@ export declare enum DataStreamTreeTokenType {
55
55
  LETTER = "",
56
56
  SPACE = " "
57
57
  }
58
- /** Wrap your stream in a pair of custom range tokens. */
59
- export declare function makeCustomRangeStream(stream: string): string;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { CommandListener, IDisposable, IDocumentData, IExecutionOptions, ILanguagePack, IParagraphStyle, ITextDecoration, ITextStyle, LifecycleStages } from '@univerjs/core';
16
+ import type { IDisposable, IDocumentData, IExecutionOptions, ILanguagePack, IParagraphStyle, ITextDecoration, ITextStyle, LifecycleStages } from '@univerjs/core';
17
17
  import type { Subscription } from 'rxjs';
18
18
  import type { IEventParamConfig } from './f-event';
19
19
  import { Disposable, ICommandService, Injector, IUniverInstanceService, LifecycleService, ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue, Univer } from '@univerjs/core';
@@ -21,7 +21,6 @@ import { FBlob } from './f-blob';
21
21
  import { FEnum } from './f-enum';
22
22
  import { FEventName } from './f-event';
23
23
  import { FEventRegistry } from './f-event-registry';
24
- import { FHooks } from './f-hooks';
25
24
  import { FUserManager } from './f-usermanager';
26
25
  import { FUtil } from './f-util';
27
26
  /**
@@ -164,20 +163,6 @@ export declare class FUniver extends Disposable {
164
163
  * ```
165
164
  */
166
165
  getLocales(): ILanguagePack | undefined;
167
- /**
168
- * Register a callback that will be triggered before invoking a command.
169
- * @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeCommandExecute, (event) => {})` instead.
170
- * @param {CommandListener} callback The callback.
171
- * @returns {IDisposable} The disposable instance.
172
- */
173
- onBeforeCommandExecute(callback: CommandListener): IDisposable;
174
- /**
175
- * Register a callback that will be triggered when a command is invoked.
176
- * @deprecated use `univerAPI.addEvent(univerAPI.Event.CommandExecuted, (event) => {})` instead.
177
- * @param {CommandListener} callback The callback.
178
- * @returns {IDisposable} The disposable instance.
179
- */
180
- onCommandExecuted(callback: CommandListener): IDisposable;
181
166
  /**
182
167
  * Execute a command with the given id and parameters.
183
168
  * @param id Identifier of the command.
@@ -210,12 +195,6 @@ export declare class FUniver extends Disposable {
210
195
  * ```
211
196
  */
212
197
  syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): R;
213
- /**
214
- * Get hooks.
215
- * @deprecated use `addEvent` instead.
216
- * @returns {FHooks} FHooks instance
217
- */
218
- getHooks(): FHooks;
219
198
  get Enum(): FEnum;
220
199
  get Event(): FEventName;
221
200
  get Util(): FUtil;
@@ -17,6 +17,5 @@ export { FBase, FBaseInitialable } from './f-base';
17
17
  export { FBlob, type IFBlobSource } from './f-blob';
18
18
  export { FEnum } from './f-enum';
19
19
  export { FEventName, type IEventBase, type IEventParamConfig } from './f-event';
20
- export { FHooks } from './f-hooks';
21
20
  export { FUniver } from './f-univer';
22
21
  export { FUtil } from './f-util';
@@ -18,8 +18,6 @@ export declare const FOCUSING_SHEET = "FOCUSING_SHEET";
18
18
  export declare const FOCUSING_DOC = "FOCUSING_DOC";
19
19
  export declare const FOCUSING_SLIDE = "FOCUSING_SLIDE";
20
20
  export declare const FOCUSING_BOARD = "FOCUSING_BOARD";
21
- /** @deprecated */
22
- export declare const FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN";
23
21
  export declare const EDITOR_ACTIVATED = "EDITOR_ACTIVATED";
24
22
  export declare const FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA";
25
23
  /** The focusing state of the formula editor (Fx bar). */
@@ -19,9 +19,7 @@ import type { UnitModel } from '../../common/unit';
19
19
  import type { Nullable } from '../../shared';
20
20
  import { Injector } from '../../common/di';
21
21
  import { UniverInstanceType } from '../../common/unit';
22
- import { DocumentDataModel } from '../../docs/data-model/document-data-model';
23
22
  import { Disposable } from '../../shared/lifecycle';
24
- import { Workbook } from '../../sheets/workbook';
25
23
  import { IContextService } from '../context/context.service';
26
24
  import { ILogService } from '../log/log.service';
27
25
  export type UnitCtor = new (...args: any[]) => UnitModel;
@@ -98,13 +96,9 @@ export interface IUniverInstanceService {
98
96
  /** Dispose a unit */
99
97
  disposeUnit(unitId: string): boolean;
100
98
  registerCtorForType<T extends UnitModel>(type: UniverInstanceType, ctor: new (...args: any[]) => T): IDisposable;
101
- /** @deprecated */
102
- changeDoc(unitId: string, doc: DocumentDataModel): void;
103
99
  getUnit<T extends UnitModel>(id: string, type?: UniverInstanceType): Nullable<T>;
104
100
  getAllUnitsForType<T>(type: UniverInstanceType): T[];
105
101
  getUnitType(unitId: string): UniverInstanceType;
106
- /** @deprecated */
107
- getUniverSheetInstance(unitId: string): Nullable<Workbook>;
108
102
  }
109
103
  export declare const IUniverInstanceService: import("@wendellhu/redi").IdentifierDecorator<IUniverInstanceService>;
110
104
  export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
@@ -143,9 +137,7 @@ export declare class UniverInstanceService extends Disposable implements IUniver
143
137
  getTypeOfUnitDisposed$<T extends UnitModel<object, number>>(type: UniverInstanceType): Observable<T>;
144
138
  getUnit<T extends UnitModel = UnitModel>(id: string, type?: UniverInstanceType): Nullable<T>;
145
139
  getUnitCreateOptions(unitId: string): Nullable<ICreateUnitOptions>;
146
- getUniverSheetInstance(unitId: string): Nullable<Workbook>;
147
140
  getAllUnitsForType<T>(type: UniverInstanceType): T[];
148
- changeDoc(unitId: string, doc: DocumentDataModel): void;
149
141
  private readonly _focused$;
150
142
  readonly focused$: Observable<Nullable<string>>;
151
143
  get focused(): Nullable<UnitModel>;
@@ -25,11 +25,6 @@ import type { Nullable } from './types';
25
25
  * @returns IRangeWithCoord
26
26
  */
27
27
  export declare function convertCellToRange(cellInfo: ICellWithCoord): IRangeWithCoord;
28
- /**
29
- * @deprecated use `convertCellToRange` instead
30
- */
31
- declare const makeCellToSelection: typeof convertCellToRange;
32
- export { makeCellToSelection };
33
28
  export declare function makeCellRangeToRangeData(cellInfo: Nullable<ISelectionCell>): Nullable<IRange>;
34
29
  export declare function isEmptyCell(cell: Nullable<ICellData>): boolean;
35
30
  export declare function isCellCoverable(cell: Nullable<ICellDataForSheetInterceptor>): boolean;
@@ -54,12 +54,6 @@ export declare class ObjectMatrix<T> {
54
54
  hasValue(): boolean;
55
55
  getValue(row: number, column: number): Nullable<T>;
56
56
  setValue(row: number, column: number, value: T): void;
57
- /**
58
- * !!
59
- * Please +1 ‘!’, who fell into this pit.
60
- * @deprecated use `realDelete` or `splice`
61
- */
62
- deleteValue(row: number, column: number): void;
63
57
  realDeleteValue(row: number, column: number): void;
64
58
  setRow(rowNumber: number, row: IObjectArrayPrimitiveType<T>): void;
65
59
  moveRows(start: number, count: number, target: number): void;
@@ -106,15 +100,7 @@ export declare class ObjectMatrix<T> {
106
100
  toNativeArray(): T[];
107
101
  toArray(): T[][];
108
102
  toFullArray(): T[][];
109
- /**
110
- * @deprecated Use getMatrix as a substitute.
111
- */
112
- toJSON(): IObjectMatrixPrimitiveType<T>;
113
103
  clone(): IObjectMatrixPrimitiveType<T>;
114
- /**
115
- * @deprecated Use clone as a substitute.
116
- */
117
- getData(): IObjectMatrixPrimitiveType<T>;
118
104
  getArrayData(): IObjectMatrixPrimitiveType<T>;
119
105
  /**
120
106
  * the function can only be used in all the row and column are positive integer
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IRange, IRectLTRB } from '../sheets/typedef';
17
- import type { Nullable } from './types';
18
17
  /**
19
18
  * This class provides a set of methods to calculate and manipulate rectangular ranges (IRange).
20
19
  * A range represents a rectangular area in a grid, defined by start/end rows and columns.
@@ -106,20 +105,6 @@ export declare class Rectangle {
106
105
  * ```
107
106
  */
108
107
  static doAnyRangesIntersect(src: IRange[], target: IRange[]): boolean;
109
- /**
110
- * Gets the intersection range between two ranges
111
- * @param src
112
- * @param target
113
- * @deprecated use `getIntersectRange` instead
114
- * @example
115
- * ```typescript
116
- * const range1 = { startRow: 0, startColumn: 0, endRow: 2, endColumn: 2 };
117
- * const range2 = { startRow: 1, startColumn: 1, endRow: 3, endColumn: 3 };
118
- * const intersection = Rectangle.getIntersects(range1, range2);
119
- * // intersection = { startRow: 1, startColumn: 1, endRow: 2, endColumn: 2 }
120
- * ```
121
- */
122
- static getIntersects(src: IRange, target: IRange): Nullable<IRange>;
123
108
  /**
124
109
  * Checks if one range completely contains another range
125
110
  * @param src
@@ -22,8 +22,6 @@ export declare class Tools {
22
22
  static deleteNull(obj: any): any;
23
23
  static getSystemType(): string;
24
24
  static getBrowserType(): string;
25
- /** @deprecated This method is deprecated, please use `import { merge } from '@univerjs/core` instead */
26
- static deepMerge(target: any, ...sources: any[]): any;
27
25
  static diffValue(one: any, two: any): boolean;
28
26
  static deepClone<T = unknown>(value: T): T;
29
27
  static getValueType(value: any): string;
@@ -81,8 +81,8 @@ export declare class SheetSkeleton extends Skeleton {
81
81
  protected readonly _configService: IConfigService;
82
82
  protected _injector: Injector;
83
83
  /**
84
- * @deprecated avoid use `IWorksheetData` directly, use API provided by `Worksheet`, otherwise
85
- * `ViewModel` will be not working.
84
+ * Avoid using `IWorksheetData` directly when an API is provided by `Worksheet`, otherwise
85
+ * `ViewModel` will not work.
86
86
  */
87
87
  protected _worksheetData: IWorksheetData;
88
88
  protected _renderRawFormula: boolean;
@@ -95,10 +95,6 @@ export declare class SheetSkeleton extends Skeleton {
95
95
  constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
96
96
  initConfig(): void;
97
97
  resetCache(): void;
98
- /**
99
- * @deprecated should never expose a property that is provided by another module!
100
- */
101
- getWorksheetConfig(): IWorksheetData;
102
98
  /**
103
99
  * Get which Workbook and Worksheet this skeleton is attached to.
104
100
  * @returns [unitId, sheetId]
@@ -97,11 +97,8 @@ export interface IWorksheetData {
97
97
  freeze: IFreeze;
98
98
  rowCount: number;
99
99
  columnCount: number;
100
- /** @deprecated */
101
100
  zoomRatio: number;
102
- /** @deprecated */
103
101
  scrollTop: number;
104
- /** @deprecated */
105
102
  scrollLeft: number;
106
103
  defaultColumnWidth: number;
107
104
  defaultRowHeight: number;
@@ -486,12 +483,6 @@ export interface ISingleCell {
486
483
  }
487
484
  export interface IRangeWithCoord extends IPosition, IRange {
488
485
  }
489
- /**
490
- * @deprecated use ICellWithCoord instead.
491
- */
492
- export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
493
- mergeInfo: IRangeWithCoord;
494
- }
495
486
  /**
496
487
  * SingleCell & coordinate and mergeRange.
497
488
  */
@@ -586,11 +577,6 @@ export interface ITextRangeParam extends ITextRange {
586
577
  isActive?: boolean;
587
578
  rangeType?: DOC_RANGE_TYPE;
588
579
  }
589
- /**
590
- * Determines whether the cell(row, column) is within the range of the merged cells.
591
- * @deprecated please use worksheet.getCellInfoInMergeData instead
592
- */
593
- export declare function getCellInfoInMergeData(row: number, column: number, mergeData?: IRange[]): ISelectionCell;
594
580
  export type ICellDataWithSpanAndDisplay = ICellData & {
595
581
  rowSpan?: number;
596
582
  colSpan?: number;
@@ -71,8 +71,6 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
71
71
  * @memberof Workbook
72
72
  */
73
73
  getSnapshot(): IWorkbookData;
74
- /** @deprecated use use name property instead */
75
- getName(): string;
76
74
  setName(name: string): void;
77
75
  getUnitId(): string;
78
76
  getRev(): number;
@@ -192,12 +192,6 @@ export declare class Worksheet {
192
192
  * @returns name of the sheet
193
193
  */
194
194
  getName(): string;
195
- /**
196
- * Returns WorkSheet Clone Object
197
- * @returns WorkSheet Clone Object
198
- * @deprecated
199
- */
200
- clone(): Worksheet;
201
195
  /**
202
196
  * Get the merged cell list of the sheet.
203
197
  * @returns {IRange[]} merged cell list
@@ -23,3 +23,5 @@ export declare enum ModernDocumentWidthMode {
23
23
  }
24
24
  export declare const MODERN_DOCUMENT_WIDTH: Record<ModernDocumentWidthMode, number>;
25
25
  export declare const MODERN_DOCUMENT_DEFAULT_MARGIN: number;
26
+ /** Default margin for a paginated Traditional document, in 96-DPI layout pixels. */
27
+ export declare const TRADITIONAL_DOCUMENT_DEFAULT_MARGIN = 72;
@@ -15,8 +15,6 @@
15
15
  */
16
16
  /**
17
17
  * Theme color type enum
18
- *
19
- * @deprecated
20
18
  */
21
19
  export declare enum ThemeColorType {
22
20
  /**
@@ -43,8 +41,6 @@ export declare enum ThemeColorType {
43
41
  }
44
42
  /**
45
43
  * Preset theme names.
46
- *
47
- * @deprecated
48
44
  */
49
45
  export declare enum ThemeColors {
50
46
  OFFICE = "Office",
@@ -32,8 +32,6 @@ export interface ICellRenderContext {
32
32
  /**
33
33
  * @debt This shouldn't exist in core package.
34
34
  * @ignore
35
- *
36
- * @deprecated This interface is subject to change in the future.
37
35
  */
38
36
  export interface ICellCustomRender {
39
37
  drawWith(ctx: CanvasRenderingContext2D, info: ICellRenderContext, skeleton: any, spreadsheets: any): void;
@@ -19,7 +19,7 @@ import type { ISize } from '../../shared/shape';
19
19
  import type { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
20
20
  import type { IDrawingParam } from './i-drawing';
21
21
  import type { IMention } from './i-mention';
22
- import type { IColorStyle, IStyleBase } from './i-style-data';
22
+ import type { IColorStyle, IGlowEffect, IShadowEffect, IStyleBase } from './i-style-data';
23
23
  /**
24
24
  * Properties of document
25
25
  */
@@ -32,6 +32,8 @@ export interface IDocumentData extends IReferenceSource {
32
32
  title?: string;
33
33
  body?: IDocumentBody;
34
34
  documentStyle: IDocumentStyle;
35
+ /** OOXML-compatible named document styles keyed by stable style id. */
36
+ styles?: IDocStyles;
35
37
  settings?: IDocumentSettings;
36
38
  resources?: IResources;
37
39
  disabled?: boolean;
@@ -137,10 +139,11 @@ export declare enum DocumentBlockType {
137
139
  }
138
140
  export interface IDocStyle {
139
141
  name: string;
140
- basedOn: string;
141
- link: string;
142
+ basedOn?: string;
143
+ link?: string;
142
144
  type: DocStyleType;
143
- textStyle: ITextStyle;
145
+ textStyle?: ITextStyle;
146
+ paragraphStyle?: IParagraphStyle;
144
147
  }
145
148
  export declare enum DocStyleType {
146
149
  character = 0,
@@ -270,9 +273,13 @@ export declare enum BulletAlignment {
270
273
  BOTH = 4
271
274
  }
272
275
  export interface IMargin {
276
+ /** Top page margin in 96-DPI layout pixels. */
273
277
  marginTop?: number;
278
+ /** Bottom page margin in 96-DPI layout pixels. */
274
279
  marginBottom?: number;
280
+ /** Right page margin in 96-DPI layout pixels. */
275
281
  marginRight?: number;
282
+ /** Left page margin in 96-DPI layout pixels. */
276
283
  marginLeft?: number;
277
284
  }
278
285
  export interface ITableOfContent {
@@ -341,6 +348,10 @@ export declare enum CustomRangeType {
341
348
  UNI_FORMULA = 7,
342
349
  DELTED = 9999
343
350
  }
351
+ export declare enum DocxBreakType {
352
+ COLUMN = "column",
353
+ TEXT_WRAPPING = "textWrapping"
354
+ }
344
355
  /**
345
356
  * Custom Block
346
357
  */
@@ -389,12 +400,13 @@ export declare enum DocumentFlavor {
389
400
  */
390
401
  export interface IDocStyleBase extends IMargin {
391
402
  pageNumberStart?: number;
403
+ /** Page size in 96-DPI layout pixels. */
392
404
  pageSize?: ISize;
393
405
  pageOrient?: PageOrientType;
394
406
  documentFlavor?: DocumentFlavor;
395
- /** Distance from the page edge to the header, in points (pt). */
407
+ /** Distance from the page edge to the header, in 96-DPI layout pixels. */
396
408
  marginHeader?: number;
397
- /** Distance from the page edge to the footer, in points (pt). */
409
+ /** Distance from the page edge to the footer, in 96-DPI layout pixels. */
398
410
  marginFooter?: number;
399
411
  renderConfig?: IDocumentRenderConfig;
400
412
  }
@@ -474,9 +486,10 @@ export interface ISectionBreak extends IDocStyleBase, ISectionBreakBase, IHeader
474
486
  export declare enum SectionType {
475
487
  SECTION_TYPE_UNSPECIFIED = 0,// The section type is unspecified.
476
488
  CONTINUOUS = 1,// The section starts immediately after the last paragraph of the previous section.
477
- NEXT_PAGE = 2,// The section starts on the next page.
478
- EVEN_PAGE = 3,// The section starts on the next page.
479
- ODD_PAGE = 4
489
+ NEXT_COLUMN = 2,// The section starts in the next column, or on the next page when no column remains.
490
+ NEXT_PAGE = 3,// The section starts on the next page.
491
+ EVEN_PAGE = 4,// The section starts on the next even-numbered page.
492
+ ODD_PAGE = 5
480
493
  }
481
494
  /**
482
495
  * The style of column separators between columns.
@@ -498,14 +511,16 @@ export declare enum TextDirectionType {
498
511
  * Properties of section column
499
512
  */
500
513
  export interface ISectionColumnProperties {
501
- /** Column width in points (pt). */
514
+ /** Column width in 96-DPI layout pixels. */
502
515
  width: number;
503
- /** Trailing space after the column in points (pt). */
516
+ /** Trailing space after the column in 96-DPI layout pixels. */
504
517
  paddingEnd: number;
505
518
  }
506
519
  export interface IParagraph {
507
520
  startIndex: number;
508
521
  paragraphId: string;
522
+ /** Optional stable named-style reference. Direct paragraph style has higher precedence. */
523
+ styleId?: string;
509
524
  paragraphStyle?: IParagraphStyle;
510
525
  bullet?: IBullet;
511
526
  }
@@ -565,15 +580,25 @@ export declare enum WrapTextType {
565
580
  LARGEST = 3
566
581
  }
567
582
  /**
568
- * The possible layouts of a [PositionedObject]
583
+ * Controls how a positioned object participates in document text layout.
584
+ *
585
+ * `WRAP_NONE` does not by itself determine whether the object is in front of or behind text. Drawing data uses
586
+ * `behindDoc` for that stacking choice.
569
587
  */
570
588
  export declare enum PositionedObjectLayoutType {
589
+ /** Places the object in the text flow like a character and lets it affect the containing line's metrics. */
571
590
  INLINE = 0,
591
+ /** Floats the object without reflowing text. The object and text can overlap. */
572
592
  WRAP_NONE = 1,
593
+ /** Floats the object and wraps text around the custom polygon defined by its wrap path. */
573
594
  WRAP_POLYGON = 2,
595
+ /** Floats the object and wraps text around its rectangular bounds. */
574
596
  WRAP_SQUARE = 3,
597
+ /** Floats the object and allows text to flow through eligible open regions in its wrap contour. */
575
598
  WRAP_THROUGH = 4,
599
+ /** Floats the object and wraps text closely around its contour instead of its rectangular bounds. */
576
600
  WRAP_TIGHT = 5,
601
+ /** Floats the object in a horizontal band, leaving text only above and below it. */
577
602
  WRAP_TOP_AND_BOTTOM = 6
578
603
  }
579
604
  /**
@@ -638,6 +663,20 @@ export interface ITextStyle extends IStyleBase {
638
663
  pos?: number;
639
664
  sa?: number;
640
665
  textFill?: IDocTextFill;
666
+ /**
667
+ * DrawingML-style glow around the rendered glyphs.
668
+ *
669
+ * This is primarily intended for embedded rich text such as Shape text. A standalone document product may
670
+ * preserve and render the value without exposing dedicated authoring controls.
671
+ */
672
+ glow?: IGlowEffect;
673
+ /**
674
+ * DrawingML-style outer shadow around the rendered glyphs.
675
+ *
676
+ * This is primarily intended for embedded rich text such as Shape text. A standalone document product may
677
+ * preserve and render the value without exposing dedicated authoring controls.
678
+ */
679
+ outerShadow?: IShadowEffect;
641
680
  }
642
681
  export interface IIndentStart {
643
682
  indentFirstLine?: INumberUnit;
@@ -672,9 +711,51 @@ export interface IParagraphProperties extends IIndentStart {
672
711
  borderBottom?: IParagraphBorder;
673
712
  borderLeft?: IParagraphBorder;
674
713
  borderRight?: IParagraphBorder;
714
+ /**
715
+ * Keeps all measured lines of this paragraph on one physical page when they fit.
716
+ *
717
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
718
+ * inherited value. An oversized paragraph still splits after starting on a
719
+ * fresh page. This Word-compatible pagination rule is rendered only by
720
+ * Traditional Docs.
721
+ *
722
+ * OOXML: 17.3.1.14 `keepLines`.
723
+ */
675
724
  keepLines?: BooleanNumber;
725
+ /**
726
+ * Keeps this paragraph with the following paragraph when they fit together.
727
+ *
728
+ * Consecutive `TRUE` values form a bounded keep chain. Set the final
729
+ * paragraph to `FALSE` when it must terminate an inherited or authored chain.
730
+ * `undefined` inherits. This Word-compatible pagination rule is rendered only
731
+ * by Traditional Docs.
732
+ *
733
+ * OOXML: 17.3.1.15 `keepNext`.
734
+ */
676
735
  keepNext?: BooleanNumber;
736
+ /**
737
+ * Starts this paragraph on the next physical page unless it is already at a
738
+ * page boundary.
739
+ *
740
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
741
+ * inherited value. Use a Section Break instead when the following content
742
+ * also needs different page geometry, columns, headers, or footers. This
743
+ * Word-compatible pagination rule is rendered only by Traditional Docs.
744
+ *
745
+ * OOXML: 17.3.1.23 `pageBreakBefore`.
746
+ */
747
+ pageBreakBefore?: BooleanNumber;
677
748
  wordWrap?: BooleanNumber;
749
+ /**
750
+ * Avoids leaving a single measured first or last line on a separate page
751
+ * when the paragraph can be adjusted without violating stronger keep rules.
752
+ *
753
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
754
+ * inherited value. This Word-compatible pagination rule is rendered only by
755
+ * Traditional Docs.
756
+ *
757
+ * OOXML: 17.3.1.44 `widowControl`.
758
+ */
678
759
  widowControl?: BooleanNumber;
679
760
  shading?: IShading;
680
761
  suppressHyphenation?: BooleanNumber;