@univerjs/core 1.0.0-alpha.7 → 1.0.0-beta.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 (40) hide show
  1. package/lib/cjs/facade.js +7 -139
  2. package/lib/cjs/index.js +832 -929
  3. package/lib/es/facade.js +9 -135
  4. package/lib/es/index.js +826 -932
  5. package/lib/facade.js +9 -135
  6. package/lib/index.js +826 -932
  7. package/lib/types/bases/index.d.ts +3 -2
  8. package/lib/types/bases/record-identity.d.ts +22 -0
  9. package/lib/types/bases/typedef.d.ts +255 -23
  10. package/lib/types/docs/data-model/index.d.ts +1 -1
  11. package/lib/types/docs/data-model/paragraph-style.d.ts +7 -1
  12. package/lib/types/docs/data-model/rich-text-builder.d.ts +28 -9
  13. package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +1 -1
  14. package/lib/types/docs/data-model/text-x/utils.d.ts +1 -0
  15. package/lib/types/docs/data-model/types.d.ts +0 -2
  16. package/lib/types/facade/f-event.d.ts +9 -9
  17. package/lib/types/facade/f-univer.d.ts +1 -22
  18. package/lib/types/facade/index.d.ts +0 -1
  19. package/lib/types/services/context/context.d.ts +0 -2
  20. package/lib/types/services/instance/instance.service.d.ts +0 -8
  21. package/lib/types/shared/cache/image-cache.d.ts +1 -1
  22. package/lib/types/shared/common.d.ts +0 -5
  23. package/lib/types/shared/object-matrix.d.ts +0 -14
  24. package/lib/types/shared/rectangle.d.ts +0 -15
  25. package/lib/types/shared/tools.d.ts +0 -2
  26. package/lib/types/sheets/sheet-skeleton.d.ts +3 -7
  27. package/lib/types/sheets/typedef.d.ts +0 -14
  28. package/lib/types/sheets/workbook.d.ts +0 -2
  29. package/lib/types/sheets/worksheet.d.ts +0 -6
  30. package/lib/types/types/const/page-size.d.ts +2 -0
  31. package/lib/types/types/enum/text-style.d.ts +3 -1
  32. package/lib/types/types/enum/theme-color-type.d.ts +0 -4
  33. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +0 -2
  34. package/lib/types/types/interfaces/i-document-data.d.ts +113 -12
  35. package/lib/types/types/interfaces/i-need-check-disposable.d.ts +1 -1
  36. package/lib/types/types/interfaces/i-style-data.d.ts +43 -0
  37. package/lib/umd/facade.js +1 -1
  38. package/lib/umd/index.js +22 -21
  39. package/package.json +4 -4
  40. package/lib/types/facade/f-hooks.d.ts +0 -74
@@ -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>;
@@ -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 { Injector } from '@wendellhu/redi';
16
+ import type { Injector } from '../../common/di';
17
17
  import { ImageSourceType } from '../../services/image-io/image-io.service';
18
18
  export declare class ImageCacheMap {
19
19
  private _injector;
@@ -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;
@@ -18,7 +18,7 @@ import type { IDocumentData, IDocumentRenderConfig, IPaddingData } from '../type
18
18
  import type { Styles } from './styles';
19
19
  import type { ICellData, ICellInfo, ICellWithCoord, IPosition, IRange, ISelectionCell, IWorksheetData } from './typedef';
20
20
  import type { Worksheet } from './worksheet';
21
- import { Injector } from '@wendellhu/redi';
21
+ import { Injector } from '../common/di';
22
22
  import { DocumentDataModel } from '../docs/data-model/document-data-model';
23
23
  import { IConfigService } from '../services/config/config.service';
24
24
  import { IContextService } from '../services/context/context.service';
@@ -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;
@@ -42,7 +42,9 @@ export declare enum TextDecoration {
42
42
  WAVE = 14,
43
43
  WAVY_DOUBLE = 15,
44
44
  WAVY_HEAVY = 16,
45
- WORDS = 17
45
+ WORDS = 17,
46
+ SINGLE_ACCOUNTING = 18,
47
+ DOUBLE_ACCOUNTING = 19
46
48
  }
47
49
  /**
48
50
  * An enum that specifies the horizontal alignment of text.
@@ -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
  }
@@ -528,6 +543,10 @@ export interface IBullet {
528
543
  listType: string;
529
544
  listId: string;
530
545
  nestingLevel: number;
546
+ startNumber?: number;
547
+ image?: {
548
+ source: string;
549
+ };
531
550
  textStyle?: ITextStyle;
532
551
  }
533
552
  /**
@@ -565,15 +584,25 @@ export declare enum WrapTextType {
565
584
  LARGEST = 3
566
585
  }
567
586
  /**
568
- * The possible layouts of a [PositionedObject]
587
+ * Controls how a positioned object participates in document text layout.
588
+ *
589
+ * `WRAP_NONE` does not by itself determine whether the object is in front of or behind text. Drawing data uses
590
+ * `behindDoc` for that stacking choice.
569
591
  */
570
592
  export declare enum PositionedObjectLayoutType {
593
+ /** Places the object in the text flow like a character and lets it affect the containing line's metrics. */
571
594
  INLINE = 0,
595
+ /** Floats the object without reflowing text. The object and text can overlap. */
572
596
  WRAP_NONE = 1,
597
+ /** Floats the object and wraps text around the custom polygon defined by its wrap path. */
573
598
  WRAP_POLYGON = 2,
599
+ /** Floats the object and wraps text around its rectangular bounds. */
574
600
  WRAP_SQUARE = 3,
601
+ /** Floats the object and allows text to flow through eligible open regions in its wrap contour. */
575
602
  WRAP_THROUGH = 4,
603
+ /** Floats the object and wraps text closely around its contour instead of its rectangular bounds. */
576
604
  WRAP_TIGHT = 5,
605
+ /** Floats the object in a horizontal band, leaving text only above and below it. */
577
606
  WRAP_TOP_AND_BOTTOM = 6
578
607
  }
579
608
  /**
@@ -633,11 +662,30 @@ export interface IDocTextFill {
633
662
  offsetY?: number;
634
663
  };
635
664
  }
665
+ export interface IDocTextOutline {
666
+ color?: string;
667
+ width?: number;
668
+ }
636
669
  export interface ITextStyle extends IStyleBase {
637
670
  sc?: number;
638
671
  pos?: number;
639
672
  sa?: number;
640
673
  textFill?: IDocTextFill;
674
+ textOutline?: IDocTextOutline;
675
+ /**
676
+ * DrawingML-style glow around the rendered glyphs.
677
+ *
678
+ * This is primarily intended for embedded rich text such as Shape text. A standalone document product may
679
+ * preserve and render the value without exposing dedicated authoring controls.
680
+ */
681
+ glow?: IGlowEffect;
682
+ /**
683
+ * DrawingML-style outer shadow around the rendered glyphs.
684
+ *
685
+ * This is primarily intended for embedded rich text such as Shape text. A standalone document product may
686
+ * preserve and render the value without exposing dedicated authoring controls.
687
+ */
688
+ outerShadow?: IShadowEffect;
641
689
  }
642
690
  export interface IIndentStart {
643
691
  indentFirstLine?: INumberUnit;
@@ -646,6 +694,11 @@ export interface IIndentStart {
646
694
  tabStops?: ITabStop[];
647
695
  indentEnd?: INumberUnit;
648
696
  }
697
+ /**
698
+ * Vertical alignment of text runs inside a paragraph line box.
699
+ * This is the normalized form of DrawingML `fontAlgn`.
700
+ */
701
+ export type ParagraphFontAlign = 'auto' | 'top' | 'center' | 'baseline' | 'bottom';
649
702
  /**
650
703
  * Properties of paragraph style
651
704
  */
@@ -660,6 +713,12 @@ export type IDocumentDefaultParagraphStyle = Omit<IParagraphStyle, 'headingId' |
660
713
  export interface IParagraphProperties extends IIndentStart {
661
714
  headingId?: string;
662
715
  namedStyleType?: NamedStyleType;
716
+ defaultTabStop?: number;
717
+ /** Whether East Asian kinsoku line-breaking rules apply to this paragraph. */
718
+ eastAsianLineBreak?: BooleanNumber;
719
+ /** Whether punctuation may hang outside the paragraph text bounds. */
720
+ hangingPunctuation?: BooleanNumber;
721
+ fontAlign?: ParagraphFontAlign;
663
722
  horizontalAlign?: HorizontalAlign;
664
723
  lineSpacing?: number;
665
724
  direction?: TextDirection;
@@ -672,9 +731,51 @@ export interface IParagraphProperties extends IIndentStart {
672
731
  borderBottom?: IParagraphBorder;
673
732
  borderLeft?: IParagraphBorder;
674
733
  borderRight?: IParagraphBorder;
734
+ /**
735
+ * Keeps all measured lines of this paragraph on one physical page when they fit.
736
+ *
737
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
738
+ * inherited value. An oversized paragraph still splits after starting on a
739
+ * fresh page. This Word-compatible pagination rule is rendered only by
740
+ * Traditional Docs.
741
+ *
742
+ * OOXML: 17.3.1.14 `keepLines`.
743
+ */
675
744
  keepLines?: BooleanNumber;
745
+ /**
746
+ * Keeps this paragraph with the following paragraph when they fit together.
747
+ *
748
+ * Consecutive `TRUE` values form a bounded keep chain. Set the final
749
+ * paragraph to `FALSE` when it must terminate an inherited or authored chain.
750
+ * `undefined` inherits. This Word-compatible pagination rule is rendered only
751
+ * by Traditional Docs.
752
+ *
753
+ * OOXML: 17.3.1.15 `keepNext`.
754
+ */
676
755
  keepNext?: BooleanNumber;
756
+ /**
757
+ * Starts this paragraph on the next physical page unless it is already at a
758
+ * page boundary.
759
+ *
760
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
761
+ * inherited value. Use a Section Break instead when the following content
762
+ * also needs different page geometry, columns, headers, or footers. This
763
+ * Word-compatible pagination rule is rendered only by Traditional Docs.
764
+ *
765
+ * OOXML: 17.3.1.23 `pageBreakBefore`.
766
+ */
767
+ pageBreakBefore?: BooleanNumber;
677
768
  wordWrap?: BooleanNumber;
769
+ /**
770
+ * Avoids leaving a single measured first or last line on a separate page
771
+ * when the paragraph can be adjusted without violating stronger keep rules.
772
+ *
773
+ * `undefined` inherits, `TRUE` enables, and an explicit `FALSE` disables an
774
+ * inherited value. This Word-compatible pagination rule is rendered only by
775
+ * Traditional Docs.
776
+ *
777
+ * OOXML: 17.3.1.44 `widowControl`.
778
+ */
678
779
  widowControl?: BooleanNumber;
679
780
  shading?: IShading;
680
781
  suppressHyphenation?: BooleanNumber;
@@ -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 { IDisposable } from '@wendellhu/redi';
16
+ import type { IDisposable } from '../../common/di';
17
17
  export interface INeedCheckDisposable extends IDisposable {
18
18
  canDispose: () => boolean;
19
19
  }
@@ -76,6 +76,49 @@ export interface IColor {
76
76
  b: number;
77
77
  a?: number;
78
78
  }
79
+ /**
80
+ * Glow applied around drawing content.
81
+ *
82
+ * Dimensional values use the owning unit's drawing coordinate system.
83
+ */
84
+ export interface IGlowEffect {
85
+ /** Glow color as a CSS color string. */
86
+ color: string;
87
+ /** Glow radius. */
88
+ radius?: number;
89
+ }
90
+ export type OuterShadowAlignment = 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
91
+ /**
92
+ * Outer shadow applied to drawing content.
93
+ *
94
+ * Dimensional values use the owning unit's drawing coordinate system.
95
+ */
96
+ export interface IShadowEffect {
97
+ /** Shadow color as a CSS color string. */
98
+ color: string;
99
+ /** OOXML preset shadow token, when the effect originated from `prstShdw`. */
100
+ preset?: string;
101
+ /** Shadow opacity, from 0 (transparent) to 1 (opaque). */
102
+ opacity?: number;
103
+ /** Blur radius. */
104
+ blurRadius?: number;
105
+ /** Direction in degrees, with 0 pointing right and 90 pointing down. */
106
+ direction?: number;
107
+ /** Offset distance from the source. */
108
+ distance?: number;
109
+ /** Horizontal scale factor; 1 means 100%. */
110
+ sx?: number;
111
+ /** Vertical scale factor; 1 means 100%. */
112
+ sy?: number;
113
+ /** Horizontal skew angle in degrees. */
114
+ skewX?: number;
115
+ /** Vertical skew angle in degrees. */
116
+ skewY?: number;
117
+ /** Alignment point used while scaling or skewing the shadow. */
118
+ alignment?: OuterShadowAlignment;
119
+ /** Whether the shadow rotates together with its source. */
120
+ rotateWithShape?: boolean;
121
+ }
79
122
  /**
80
123
  * Style properties of border
81
124
  */