@univerjs/core 1.5.1 → 1.6.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.
- package/lib/cjs/facade.js +6 -6
- package/lib/cjs/index.js +1170 -778
- package/lib/es/facade.js +6 -6
- package/lib/es/index.js +1165 -779
- package/lib/facade.js +6 -6
- package/lib/index.js +1165 -779
- package/lib/types/docs/data-model/document-data-model.d.ts +1 -1
- package/lib/types/docs/data-model/index.d.ts +0 -2
- package/lib/types/docs/data-model/paragraph-style.d.ts +10 -1
- package/lib/types/docs/data-model/rich-text-builder.d.ts +3 -3
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/utils.d.ts +2 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/services/instance/instance.service.d.ts +2 -0
- package/lib/types/services/locale/currency-symbol.d.ts +17 -0
- package/lib/types/services/undoredo/undoredo.service.d.ts +1 -1
- package/lib/types/shared/common.d.ts +8 -5
- package/lib/types/sheets/typedef.d.ts +4 -0
- package/lib/types/sheets/worksheet.d.ts +2 -2
- package/lib/types/types/interfaces/i-document-data.d.ts +137 -9
- package/lib/umd/index.js +26 -26
- package/package.json +6 -6
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { BehaviorSubject } from 'rxjs';
|
|
16
17
|
import type { Nullable } from '../../shared';
|
|
17
18
|
import type { ITextRangeParam } from '../../sheets/typedef';
|
|
18
19
|
import type { LocaleType } from '../../types/enum';
|
|
19
20
|
import type { IDocumentBody, IDocumentData, IDocumentRenderConfig, IDocumentStyle, IDrawings, IListData } from '../../types/interfaces/i-document-data';
|
|
20
21
|
import type { IPaddingData } from '../../types/interfaces/i-style-data';
|
|
21
22
|
import type { JSONXActions } from './json-x/json-x';
|
|
22
|
-
import { BehaviorSubject } from 'rxjs';
|
|
23
23
|
import { UnitModel, UniverInstanceType } from '../../common/unit';
|
|
24
24
|
import { SliceBodyType } from './text-x/utils';
|
|
25
25
|
export declare const DEFAULT_DOC: {
|
|
@@ -17,8 +17,6 @@ export * from './document-data-model';
|
|
|
17
17
|
export { getEmptySnapshot as getDocsEmptySnapshot } from './empty-snapshot';
|
|
18
18
|
export { JSON1, JSONX } from './json-x/json-x';
|
|
19
19
|
export type { JSONXActions, JSONXPath } from './json-x/json-x';
|
|
20
|
-
export { resolveDocumentParagraphStyle } from './paragraph-style';
|
|
21
|
-
export type { IResolveDocumentParagraphStyleOptions } from './paragraph-style';
|
|
22
20
|
export * from './preset-list-type';
|
|
23
21
|
export { replaceInDocumentBody } from './replacement';
|
|
24
22
|
export { ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextParagraphBuilder, RichTextRunBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue, } from './rich-text-builder';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Nullable } from '../../shared/types';
|
|
17
|
-
import type { IDocStyles, IDocumentData, IDocumentStyle, IParagraph, IParagraphStyle } from '../../types/interfaces/i-document-data';
|
|
17
|
+
import type { IBullet, IDocStyles, IDocumentData, IDocumentStyle, IParagraph, IParagraphStyle, ITextStyle } from '../../types/interfaces/i-document-data';
|
|
18
18
|
import { BooleanNumber } from '../../types/enum/text-style';
|
|
19
19
|
export interface IResolveDocumentParagraphStyleOptions {
|
|
20
20
|
/** Exclude document-level outer spacing while retaining all other defaults. */
|
|
@@ -25,7 +25,16 @@ export interface IResolveDocumentParagraphStyleOptions {
|
|
|
25
25
|
styles?: IDocStyles;
|
|
26
26
|
/** Named paragraph style referenced by the paragraph. */
|
|
27
27
|
paragraphStyleId?: string;
|
|
28
|
+
/** List definitions used by inherited or direct paragraph numbering. */
|
|
29
|
+
lists?: IDocumentData['lists'];
|
|
30
|
+
/** Omitted numbering inherits; null explicitly disables it. */
|
|
31
|
+
bullet?: IParagraph['bullet'];
|
|
28
32
|
}
|
|
33
|
+
/** Resolves style numbering and partial direct overrides without changing persisted paragraph data. */
|
|
34
|
+
export declare function resolveDocumentParagraphBullet(document: Partial<Pick<IDocumentData, 'styles' | 'lists' | 'documentStyle'>>, paragraph: Pick<IParagraph, 'styleId' | 'bullet'>): IBullet | undefined;
|
|
35
|
+
export declare function resolveDocumentTextStyle(styles: IDocStyles | undefined, styleId: string | undefined): ITextStyle;
|
|
29
36
|
export declare function resolveDocumentParagraphStyle(documentStyle: Nullable<IDocumentStyle>, paragraphStyle: Nullable<IParagraphStyle>, options?: IResolveDocumentParagraphStyleOptions): IParagraphStyle;
|
|
37
|
+
/** Applies absolute edits while clearing Word's inherited relative components. */
|
|
38
|
+
export declare function getDocumentParagraphStyleForUpdate(document: Partial<Pick<IDocumentData, 'styles' | 'lists' | 'documentStyle'>>, paragraph: Pick<IParagraph, 'styleId' | 'bullet' | 'paragraphStyle'>, update: IParagraphStyle): IParagraphStyle;
|
|
30
39
|
/** Resolves word splitting without materializing inherited defaults in the snapshot. */
|
|
31
40
|
export declare function resolveDocumentParagraphWordWrap(document: IDocumentData, paragraph?: IParagraph): BooleanNumber;
|
|
@@ -1325,7 +1325,7 @@ export declare class RichTextValue {
|
|
|
1325
1325
|
* const bullet = richText.getParagraphBullet();
|
|
1326
1326
|
* ```
|
|
1327
1327
|
*/
|
|
1328
|
-
getParagraphBullet(): import("../..").IBullet | undefined;
|
|
1328
|
+
getParagraphBullet(): Partial<import("../..").IBullet> | null | undefined;
|
|
1329
1329
|
/**
|
|
1330
1330
|
* Gets the paragraphs of the current RichTextValue instance
|
|
1331
1331
|
* @returns {RichTextValue[]} The paragraphs of the current RichTextValue instance
|
|
@@ -1856,10 +1856,10 @@ export declare class RichTextParagraphBuilder extends RichTextValue {
|
|
|
1856
1856
|
*/
|
|
1857
1857
|
getTextRuns(): RichTextRunBuilder[];
|
|
1858
1858
|
getParagraphStyle(): ParagraphStyleValue;
|
|
1859
|
-
getParagraphBullet(): import("../..").IBullet | undefined;
|
|
1859
|
+
getParagraphBullet(): Partial<import("../..").IBullet> | null | undefined;
|
|
1860
1860
|
getLinks(): import("../..").ICustomRange<Record<string, any>>[];
|
|
1861
1861
|
/** Agent-friendly alias of `getParagraphBullet()`. */
|
|
1862
|
-
getBullet(): import("../..").IBullet | undefined;
|
|
1862
|
+
getBullet(): Partial<import("../..").IBullet> | null | undefined;
|
|
1863
1863
|
getData(): IDocumentData;
|
|
1864
1864
|
copy(): RichTextBuilder;
|
|
1865
1865
|
private _getParagraph;
|
|
@@ -40,7 +40,7 @@ export declare function normalizeInsertedParagraphIdsForDocument(paragraphs: IPa
|
|
|
40
40
|
preserveMissingParagraphIds?: boolean;
|
|
41
41
|
reservedParagraphIds?: Set<string>;
|
|
42
42
|
dataStream?: string;
|
|
43
|
-
}):
|
|
43
|
+
}): boolean;
|
|
44
44
|
export declare function insertSectionBreaks(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
45
45
|
export declare function normalizeInsertedSectionIdsForDocument(sectionBreaks: ISectionBreak[] | undefined, insertSectionBreaks: ISectionBreak[] | undefined, reservedSectionIds?: Set<string>): void;
|
|
46
46
|
export declare function insertCustomBlocks(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
@@ -40,7 +40,7 @@ export declare function getParagraphsSlice(body: IDocumentBody, startOffset: num
|
|
|
40
40
|
headingCollapsed?: boolean;
|
|
41
41
|
styleId?: string;
|
|
42
42
|
paragraphStyle?: import("../../..").IParagraphStyle;
|
|
43
|
-
bullet?: import("../../..").IBullet;
|
|
43
|
+
bullet?: Partial<import("../../..").IBullet> | null;
|
|
44
44
|
sourceBullet?: import("../../..").IBullet | null;
|
|
45
45
|
directBullet?: import("../../..").IBullet | null;
|
|
46
46
|
startIndex: number;
|
|
@@ -60,6 +60,7 @@ export declare function getSectionBreakSlice(body: IDocumentBody, startOffset: n
|
|
|
60
60
|
evenAndOddHeaders?: import("../../..").BooleanNumber;
|
|
61
61
|
pageBorders?: import("../../..").IPageBorders;
|
|
62
62
|
pageNumberStart?: number;
|
|
63
|
+
pageNumberFormat?: string;
|
|
63
64
|
pageSize?: import("../../..").ISize;
|
|
64
65
|
pageOrient?: import("../../..").PageOrientType;
|
|
65
66
|
documentFlavor?: import("../../..").DocumentFlavor;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ export { mergeSets } from './common/set';
|
|
|
42
42
|
export { UnitModel, UniverInstanceType } from './common/unit';
|
|
43
43
|
export { isSafeUrl, normalizeUrl, resolveWithBasePath } from './common/url';
|
|
44
44
|
export * from './docs';
|
|
45
|
-
export { resolveDocumentParagraphWordWrap } from './docs/data-model/paragraph-style';
|
|
45
|
+
export { getDocumentParagraphStyleForUpdate, resolveDocumentParagraphBullet, resolveDocumentParagraphStyle, resolveDocumentParagraphWordWrap, resolveDocumentTextStyle, } from './docs/data-model/paragraph-style';
|
|
46
|
+
export type { IResolveDocumentParagraphStyleOptions } from './docs/data-model/paragraph-style';
|
|
46
47
|
export { getSdtBindingKey, getSdtBindingValue } from './docs/sdt-binding';
|
|
47
48
|
export { EventState, EventSubject, fromEventSubject } from './observer/observable';
|
|
48
49
|
export type { IEventObserver } from './observer/observable';
|
|
@@ -65,6 +66,7 @@ export type { ICreateUnitOptions } from './services/instance/instance.service';
|
|
|
65
66
|
export { LifecycleStages } from './services/lifecycle/lifecycle';
|
|
66
67
|
export { LifecycleService, LifecycleUnreachableError } from './services/lifecycle/lifecycle.service';
|
|
67
68
|
export { ILocalStorageService } from './services/local-storage/local-storage.service';
|
|
69
|
+
export { getCurrencySymbolByLocale } from './services/locale/currency-symbol';
|
|
68
70
|
export { LocaleService } from './services/locale/locale.service';
|
|
69
71
|
export { DesktopLogService, ILogService, LogLevel } from './services/log/log.service';
|
|
70
72
|
export { MentionIOLocalService } from './services/mention-io/mention-io-local.service';
|
|
@@ -30,6 +30,8 @@ export interface ICreateUnitOptions {
|
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
32
|
makeCurrent?: boolean;
|
|
33
|
+
/** Host whose workbench menus remain active while this inline editor has focus. */
|
|
34
|
+
workbenchHostUnitId?: string;
|
|
33
35
|
/**
|
|
34
36
|
* If product UI render services should skip their default main-canvas render
|
|
35
37
|
* creation. Embedded units create their render explicitly into a host-owned
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { LocaleType } from '../../types/enum/locale-type';
|
|
17
|
+
export declare function getCurrencySymbolByLocale(locale: LocaleType): string;
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Observable } from 'rxjs';
|
|
17
|
+
import { BehaviorSubject } from 'rxjs';
|
|
17
18
|
import type { IAccessor, IDisposable } from '../../common/di';
|
|
18
19
|
import type { Nullable } from '../../shared/types';
|
|
19
20
|
import type { IMutationInfo } from '../command/command.service';
|
|
20
|
-
import { BehaviorSubject } from 'rxjs';
|
|
21
21
|
import { Disposable } from '../../shared/lifecycle';
|
|
22
22
|
import { CommandType, ICommandService } from '../command/command.service';
|
|
23
23
|
import { IConfigService } from '../config/config.service';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { CellValue, ICellData, ICellDataForSheetInterceptor, ICellWithCoord, IRange, IRangeWithCoord, ISelectionCell } from '../sheets/typedef';
|
|
17
17
|
import type { Worksheet } from '../sheets/worksheet';
|
|
18
18
|
import type { IDocumentData } from '../types/interfaces/i-document-data';
|
|
19
|
-
import type { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
|
|
19
|
+
import type { IColorStyle, IStyleBase, IStyleData } from '../types/interfaces/i-style-data';
|
|
20
20
|
import type { IObjectMatrixPrimitiveType } from './object-matrix';
|
|
21
21
|
import type { Nullable } from './types';
|
|
22
22
|
/**
|
|
@@ -41,12 +41,15 @@ export declare function isFormulaString(value: any): boolean;
|
|
|
41
41
|
* @returns
|
|
42
42
|
*/
|
|
43
43
|
export declare function isFormulaId(value: any): boolean;
|
|
44
|
+
export declare function handleStyleToString(style: IStyleData, isCell?: boolean): string;
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* Mark every line a `text-decoration` value names on a style object.
|
|
47
|
+
*
|
|
48
|
+
* A single `text-decoration` can name several lines at once, e.g. `underline line-through`,
|
|
49
|
+
* so every line has to be read instead of only the first one. Existing data of a line, such
|
|
50
|
+
* as its color or line style, is kept.
|
|
48
51
|
*/
|
|
49
|
-
export declare function
|
|
52
|
+
export declare function setTextDecorationLines(style: Pick<IStyleBase, 'ul' | 'st' | 'ol'>, value: string): void;
|
|
50
53
|
export declare function getBorderStyleType(type: string): number;
|
|
51
54
|
export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import("..").IDocumentBody | undefined;
|
|
52
55
|
export declare function isValidRange(range: IRange, worksheet?: Worksheet): boolean;
|
|
@@ -158,6 +158,10 @@ export interface IWorksheetData {
|
|
|
158
158
|
gridlinesColor?: string;
|
|
159
159
|
/** Image tiled behind the worksheet grid. It is not included when printing. */
|
|
160
160
|
backgroundImage?: IWorksheetBackgroundImage;
|
|
161
|
+
/**
|
|
162
|
+
* Right-to-left sheet view flag, persisted with the worksheet snapshot for file and collaboration round-trips.
|
|
163
|
+
* Chart Sheet drawing placement reads it; grid rendering does not currently mirror the sheet.
|
|
164
|
+
*/
|
|
161
165
|
rightToLeft: BooleanNumber;
|
|
162
166
|
/**
|
|
163
167
|
* User stored custom fields.
|
|
@@ -388,8 +388,8 @@ export declare class Worksheet {
|
|
|
388
388
|
*/
|
|
389
389
|
getVisibleCols(): IRange[];
|
|
390
390
|
/**
|
|
391
|
-
*
|
|
392
|
-
* @returns
|
|
391
|
+
* Get the worksheet right-to-left view flag.
|
|
392
|
+
* @returns {BooleanNumber} `BooleanNumber.TRUE` when the flag is enabled, otherwise `BooleanNumber.FALSE`.
|
|
393
393
|
*/
|
|
394
394
|
isRightToLeft(): BooleanNumber;
|
|
395
395
|
/**
|
|
@@ -30,6 +30,10 @@ export interface IDocumentData extends IReferenceSource {
|
|
|
30
30
|
rev?: number;
|
|
31
31
|
locale?: LocaleType;
|
|
32
32
|
title?: string;
|
|
33
|
+
/** Organization associated with the document, used by built-in property fields. */
|
|
34
|
+
company?: string;
|
|
35
|
+
/** Editable metadata referenced by document-property fields. */
|
|
36
|
+
customProperties?: Record<string, IDocumentCustomProperty>;
|
|
33
37
|
body?: IDocumentBody;
|
|
34
38
|
/** Independent rich-text segments addressed by footnote or endnote references in the main body. */
|
|
35
39
|
notes?: Record<string, IDocumentNote>;
|
|
@@ -41,6 +45,16 @@ export interface IDocumentData extends IReferenceSource {
|
|
|
41
45
|
resources?: IResources;
|
|
42
46
|
disabled?: boolean;
|
|
43
47
|
}
|
|
48
|
+
export type IDocumentCustomProperty = {
|
|
49
|
+
type: 'string' | 'date';
|
|
50
|
+
value: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'integer' | 'number';
|
|
53
|
+
value: number;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'boolean';
|
|
56
|
+
value: boolean;
|
|
57
|
+
};
|
|
44
58
|
export interface IReferenceSource {
|
|
45
59
|
tableSource?: ITables;
|
|
46
60
|
footers?: IFooters;
|
|
@@ -65,10 +79,14 @@ export interface IFootnoteProperties {
|
|
|
65
79
|
/** Zero matches the body section's column count. */
|
|
66
80
|
columnCount?: number;
|
|
67
81
|
}
|
|
82
|
+
/** Editable note decorations may contain tables as well as ordinary paragraphs. */
|
|
83
|
+
export interface IDocumentNoteDecoration extends IDocumentBody {
|
|
84
|
+
tableSource?: ITables;
|
|
85
|
+
}
|
|
68
86
|
export interface IFootnoteSettings extends IFootnoteProperties {
|
|
69
|
-
separator?:
|
|
70
|
-
continuationSeparator?:
|
|
71
|
-
continuationNotice?:
|
|
87
|
+
separator?: IDocumentNoteDecoration;
|
|
88
|
+
continuationSeparator?: IDocumentNoteDecoration;
|
|
89
|
+
continuationNotice?: IDocumentNoteDecoration;
|
|
72
90
|
}
|
|
73
91
|
export type DocumentNoteType = 'footnote' | 'endnote';
|
|
74
92
|
export interface IEndnoteProperties extends Omit<IFootnoteProperties, 'position' | 'restart' | 'columnCount'> {
|
|
@@ -76,9 +94,9 @@ export interface IEndnoteProperties extends Omit<IFootnoteProperties, 'position'
|
|
|
76
94
|
restart?: 'continuous' | 'eachSect';
|
|
77
95
|
}
|
|
78
96
|
export interface IEndnoteSettings extends IEndnoteProperties {
|
|
79
|
-
separator?:
|
|
80
|
-
continuationSeparator?:
|
|
81
|
-
continuationNotice?:
|
|
97
|
+
separator?: IDocumentNoteDecoration;
|
|
98
|
+
continuationSeparator?: IDocumentNoteDecoration;
|
|
99
|
+
continuationNotice?: IDocumentNoteDecoration;
|
|
82
100
|
}
|
|
83
101
|
export interface INoteSettings {
|
|
84
102
|
footnote?: IFootnoteSettings;
|
|
@@ -218,11 +236,23 @@ export declare enum DocumentBlockType {
|
|
|
218
236
|
}
|
|
219
237
|
export interface IDocStyle {
|
|
220
238
|
name: string;
|
|
239
|
+
/** Whether this is a user-defined style, independent of its display name. */
|
|
240
|
+
customStyle?: boolean;
|
|
241
|
+
/** Alternate names used by named-style references and directories. */
|
|
242
|
+
aliases?: string[];
|
|
221
243
|
basedOn?: string;
|
|
222
244
|
link?: string;
|
|
223
245
|
type: DocStyleType;
|
|
224
246
|
textStyle?: ITextStyle;
|
|
225
247
|
paragraphStyle?: IParagraphStyle;
|
|
248
|
+
/** Authored table defaults inherited through basedOn. */
|
|
249
|
+
tableProperties?: Pick<ITable, 'cellSpacing'>;
|
|
250
|
+
/** Authored row defaults inherited through the named table style. */
|
|
251
|
+
rowProperties?: Pick<ITableRow, 'cellSpacing'>;
|
|
252
|
+
/** Typography inherited by the matching regions of a named table style. */
|
|
253
|
+
conditionalStyles?: Partial<Record<'wholeTable' | 'firstRow' | 'lastRow' | 'firstCol' | 'lastCol' | 'band1Horz' | 'band2Horz' | 'band1Vert' | 'band2Vert' | 'nwCell' | 'neCell' | 'swCell' | 'seCell', Pick<IDocStyle, 'textStyle' | 'paragraphStyle'>>>;
|
|
254
|
+
/** Numbering properties inherited by paragraphs using this style; null disables numbering. */
|
|
255
|
+
bullet?: Partial<IBullet> | null;
|
|
226
256
|
}
|
|
227
257
|
export declare enum DocStyleType {
|
|
228
258
|
character = 0,
|
|
@@ -250,6 +280,10 @@ export interface IHeaderData extends IReferenceSource {
|
|
|
250
280
|
export interface IListData {
|
|
251
281
|
listType: string;
|
|
252
282
|
nestingLevel: INestingLevel[];
|
|
283
|
+
/** Imported list instances that continue the same counters. Other list IDs start independently. */
|
|
284
|
+
counterIds?: string[];
|
|
285
|
+
/** Imported instance/level restart offsets, applied once when that instance and level first occur. */
|
|
286
|
+
counterStarts?: Record<string, Record<number, number>>;
|
|
253
287
|
}
|
|
254
288
|
/**
|
|
255
289
|
* Contains properties describing the look and feel of a list bullet at a given level of nesting.
|
|
@@ -258,6 +292,8 @@ export interface INestingLevel {
|
|
|
258
292
|
paragraphProperties?: IParagraphStyle;
|
|
259
293
|
bulletAlignment: BulletAlignment;
|
|
260
294
|
glyphFormat: string;
|
|
295
|
+
/** Separator after the number, corresponding to OOXML w:suff. */
|
|
296
|
+
followNumberWith?: FollowNumberWithType;
|
|
261
297
|
textStyle?: ITextStyle;
|
|
262
298
|
startNumber: number;
|
|
263
299
|
glyphType?: ListGlyphType;
|
|
@@ -371,6 +407,8 @@ export interface IHyperlink {
|
|
|
371
407
|
headingId?: string;
|
|
372
408
|
/** Use authored text formatting instead of the default link color and underline. */
|
|
373
409
|
textStyleMode?: 'link' | 'text';
|
|
410
|
+
/** Navigation supplied by the enclosing reference field's hyperlink switch. */
|
|
411
|
+
referenceFieldLink?: boolean;
|
|
374
412
|
}
|
|
375
413
|
/**
|
|
376
414
|
* A ParagraphElement that represents a run of text that all has the same styling.
|
|
@@ -404,6 +442,22 @@ export interface ICustomRange<T extends Record<string, any> = Record<string, any
|
|
|
404
442
|
properties?: T;
|
|
405
443
|
}
|
|
406
444
|
export type IHyperLinkCustomRange = ICustomRange<IHyperlink>;
|
|
445
|
+
export declare enum SpecialCharacterKind {
|
|
446
|
+
NON_BREAKING_HYPHEN = "nonBreakingHyphen",
|
|
447
|
+
OPTIONAL_HYPHEN = "optionalHyphen",
|
|
448
|
+
EM_SPACE = "emSpace",
|
|
449
|
+
EN_SPACE = "enSpace"
|
|
450
|
+
}
|
|
451
|
+
/** A single editable character atom, distinct from an ordinary Unicode text character. */
|
|
452
|
+
export interface ISpecialCharacterCustomRange extends ICustomRange<{
|
|
453
|
+
kind: SpecialCharacterKind;
|
|
454
|
+
}> {
|
|
455
|
+
rangeType: CustomRangeType.CUSTOM;
|
|
456
|
+
wholeEntity: true;
|
|
457
|
+
properties: {
|
|
458
|
+
kind: SpecialCharacterKind;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
407
461
|
/** Legacy Word form field settings. Macro names are retained as data, never executed by the SDK. */
|
|
408
462
|
export interface IFormFieldData {
|
|
409
463
|
name?: string;
|
|
@@ -439,8 +493,19 @@ export interface IFormFieldData {
|
|
|
439
493
|
};
|
|
440
494
|
}
|
|
441
495
|
export interface IFieldRangeProperties {
|
|
442
|
-
/**
|
|
496
|
+
/** Field instruction text; nested field structure is retained in instructionParts. */
|
|
443
497
|
instruction: string;
|
|
498
|
+
/** Editable character styles at UTF-16 offsets within instruction, separate from the visible result. */
|
|
499
|
+
instructionTextRuns?: ITextRun[];
|
|
500
|
+
/** Text and nested fields occurring inside the instruction, separate from its visible result. */
|
|
501
|
+
instructionParts?: Array<string | {
|
|
502
|
+
instruction: string;
|
|
503
|
+
cachedResult?: string;
|
|
504
|
+
dirty?: BooleanNumber;
|
|
505
|
+
locked?: BooleanNumber;
|
|
506
|
+
instructionTextRuns?: ITextRun[];
|
|
507
|
+
instructionParts?: IFieldRangeProperties['instructionParts'];
|
|
508
|
+
}>;
|
|
444
509
|
/** Upper-case first token of `instruction`, used only for field dispatch. */
|
|
445
510
|
fieldType: string;
|
|
446
511
|
sourceKind?: 'complex' | 'simple';
|
|
@@ -642,6 +707,8 @@ export interface IPageBorders {
|
|
|
642
707
|
export interface IDocStyleBase extends IMargin {
|
|
643
708
|
pageBorders?: IPageBorders;
|
|
644
709
|
pageNumberStart?: number;
|
|
710
|
+
/** OOXML printed page-number format; omitted means decimal. */
|
|
711
|
+
pageNumberFormat?: string;
|
|
645
712
|
/** Page size in 96-DPI layout pixels. */
|
|
646
713
|
pageSize?: ISize;
|
|
647
714
|
pageOrient?: PageOrientType;
|
|
@@ -682,9 +749,34 @@ export interface IDocumentStyle extends IDocStyleBase, IDocumentLayout, IHeaderA
|
|
|
682
749
|
/** Imported OOXML compatSetting values, including the Word compatibilityMode. */
|
|
683
750
|
compatibilitySettings?: Record<string, string>;
|
|
684
751
|
textStyle?: ITextStyle;
|
|
752
|
+
/** Theme group used only when no document, named-style or direct font family is declared. */
|
|
753
|
+
defaultFontTheme?: 'major' | 'minor';
|
|
754
|
+
/** Editable Latin theme families; omitted entries inherit the application's Office theme. */
|
|
755
|
+
latinFontScheme?: {
|
|
756
|
+
major?: string;
|
|
757
|
+
minor?: string;
|
|
758
|
+
};
|
|
685
759
|
/** Document-declared alternate families, tried only after the authored font is unavailable. */
|
|
686
760
|
fontFamilyFallbacks?: Record<string, string>;
|
|
761
|
+
/** Document-declared font classifications used when an authored font lacks a glyph. */
|
|
762
|
+
fontFamilyClasses?: Record<string, 'auto' | 'decorative' | 'modern' | 'roman' | 'script' | 'swiss'>;
|
|
763
|
+
/** Editable East Asian major/minor theme fonts and language-specific script mappings. */
|
|
764
|
+
eastAsiaFontScheme?: {
|
|
765
|
+
major: {
|
|
766
|
+
fontFamily?: string;
|
|
767
|
+
scriptFonts?: Record<string, string>;
|
|
768
|
+
};
|
|
769
|
+
minor: {
|
|
770
|
+
fontFamily?: string;
|
|
771
|
+
scriptFonts?: Record<string, string>;
|
|
772
|
+
};
|
|
773
|
+
language?: string;
|
|
774
|
+
};
|
|
687
775
|
defaultParagraphStyle?: IDocumentDefaultParagraphStyle;
|
|
776
|
+
/** Named paragraph style inherited when a paragraph has no explicit style reference. */
|
|
777
|
+
defaultParagraphStyleId?: string;
|
|
778
|
+
/** Named table style inherited when a table has no explicit style reference. */
|
|
779
|
+
defaultTableStyleId?: string;
|
|
688
780
|
background?: IDocumentBackground;
|
|
689
781
|
}
|
|
690
782
|
export interface IDocumentBackground {
|
|
@@ -784,7 +876,11 @@ export interface IParagraph {
|
|
|
784
876
|
/** Optional stable named-style reference. Direct paragraph style has higher precedence. */
|
|
785
877
|
styleId?: string;
|
|
786
878
|
paragraphStyle?: IParagraphStyle;
|
|
787
|
-
|
|
879
|
+
/**
|
|
880
|
+
* Direct numbering overrides. Omitted properties inherit from the named style and null disables numbering.
|
|
881
|
+
* Use `resolveDocumentParagraphBullet(document, paragraph)` to read the effective list and nesting level.
|
|
882
|
+
*/
|
|
883
|
+
bullet?: Partial<IBullet> | null;
|
|
788
884
|
/** Imported resolved numbering, used to distinguish later edits from unchanged inheritance. */
|
|
789
885
|
sourceBullet?: IBullet | null;
|
|
790
886
|
/** Imported direct numbering. Absent inherits from the style; null explicitly disables numbering. */
|
|
@@ -950,6 +1046,8 @@ export interface ITextStyle extends IStyleBase {
|
|
|
950
1046
|
hidden?: boolean;
|
|
951
1047
|
/** Word font-type hint for characters shared by Latin, East Asian and complex scripts. */
|
|
952
1048
|
fontHint?: 'default' | 'eastAsia' | 'cs';
|
|
1049
|
+
/** East Asian theme binding; null explicitly selects the authored font family instead. */
|
|
1050
|
+
eastAsiaFontTheme?: 'major' | 'minor' | null;
|
|
953
1051
|
/** Alignment tab anchored to the page margins or paragraph indents. Applies only to a tab character. */
|
|
954
1052
|
positionedTab?: {
|
|
955
1053
|
alignment: TabStopAlignment;
|
|
@@ -965,6 +1063,8 @@ export interface ITextStyle extends IStyleBase {
|
|
|
965
1063
|
lang?: string;
|
|
966
1064
|
/** Alternate language from the authored text properties (BCP 47). Absent inherits. */
|
|
967
1065
|
altLang?: string;
|
|
1066
|
+
/** Language for complex-script text (BCP 47), independent of its writing direction. Absent inherits. */
|
|
1067
|
+
bidiLang?: string;
|
|
968
1068
|
/** Minimum font size for pair kerning, in the same units as fs. Zero disables it; absent inherits. */
|
|
969
1069
|
kerning?: number;
|
|
970
1070
|
/** Display capital letters without changing the source text. Absent inherits. */
|
|
@@ -1010,12 +1110,14 @@ export interface IParagraphStyle extends IParagraphProperties {
|
|
|
1010
1110
|
textStyle?: ITextStyle;
|
|
1011
1111
|
/** Formatting of the paragraph terminator only, not inherited by body text. */
|
|
1012
1112
|
paragraphMarkTextStyle?: ITextStyle;
|
|
1113
|
+
/** Named character style of the paragraph terminator, below its direct formatting. */
|
|
1114
|
+
paragraphMarkStyleId?: string;
|
|
1013
1115
|
}
|
|
1014
1116
|
/**
|
|
1015
1117
|
* Paragraph properties that may be inherited from the document defaults.
|
|
1016
1118
|
* Paragraph identity and named/text styles have their own inheritance mechanisms.
|
|
1017
1119
|
*/
|
|
1018
|
-
export type IDocumentDefaultParagraphStyle = Omit<IParagraphStyle, 'headingId' | 'namedStyleType' | 'outlineLevel' | 'textStyle' | 'paragraphMarkTextStyle'>;
|
|
1120
|
+
export type IDocumentDefaultParagraphStyle = Omit<IParagraphStyle, 'headingId' | 'namedStyleType' | 'outlineLevel' | 'textStyle' | 'paragraphMarkTextStyle' | 'paragraphMarkStyleId'>;
|
|
1019
1121
|
export interface IParagraphProperties extends IIndentStart {
|
|
1020
1122
|
headingId?: string;
|
|
1021
1123
|
namedStyleType?: NamedStyleType;
|
|
@@ -1149,6 +1251,8 @@ export interface IDocsBorder {
|
|
|
1149
1251
|
*/
|
|
1150
1252
|
export interface IParagraphBorder extends IDocsBorder {
|
|
1151
1253
|
padding: number;
|
|
1254
|
+
/** Word line border style; preserves compound strokes beyond the legacy dash pattern. */
|
|
1255
|
+
style?: string;
|
|
1152
1256
|
}
|
|
1153
1257
|
/**
|
|
1154
1258
|
* The kinds of dashes with which linear geometry can be rendered.
|
|
@@ -1267,6 +1371,8 @@ export interface IColumn {
|
|
|
1267
1371
|
* Properties of table
|
|
1268
1372
|
*/
|
|
1269
1373
|
export interface ITable {
|
|
1374
|
+
/** Named table style in the document's styles collection. */
|
|
1375
|
+
styleId?: string;
|
|
1270
1376
|
tableRows: ITableRow[];
|
|
1271
1377
|
tableColumns: ITableColumn[];
|
|
1272
1378
|
align: TableAlignmentType;
|
|
@@ -1279,6 +1385,10 @@ export interface ITable {
|
|
|
1279
1385
|
size: IWidthInTableSize;
|
|
1280
1386
|
tableId: string;
|
|
1281
1387
|
cellMargin?: ITableCellMargin;
|
|
1388
|
+
/** Default distance between cell edges, outside the table text margins. */
|
|
1389
|
+
cellSpacing?: INumberUnit;
|
|
1390
|
+
/** Default table edges; explicit cell borders override these values. */
|
|
1391
|
+
borderDefaults?: ITableBorderDefaults;
|
|
1282
1392
|
layout?: TableLayoutType;
|
|
1283
1393
|
overlap?: BooleanNumber;
|
|
1284
1394
|
description?: string;
|
|
@@ -1299,8 +1409,14 @@ export interface ITableRowSize {
|
|
|
1299
1409
|
* Properties of row of table
|
|
1300
1410
|
*/
|
|
1301
1411
|
export interface ITableRow {
|
|
1412
|
+
/** Row cell spacing inside the table text margins; overrides table defaults. */
|
|
1413
|
+
cellSpacing?: INumberUnit;
|
|
1414
|
+
/** Row-specific table default spacing outside the text margins (OOXML tblPrEx). */
|
|
1415
|
+
defaultCellSpacing?: INumberUnit;
|
|
1302
1416
|
/** Authored row-level default margins (OOXML tblPrEx); imported cells contain resolved margins. */
|
|
1303
1417
|
cellMargin?: ITableCellMargin;
|
|
1418
|
+
/** Row-specific table edges; imported cells also contain their resolved borders. */
|
|
1419
|
+
borderDefaults?: ITableBorderDefaults;
|
|
1304
1420
|
/**
|
|
1305
1421
|
* Rows do not persist stream offsets. Their ordinal position must match the
|
|
1306
1422
|
* corresponding `TABLE_ROW_START`/`TABLE_ROW_END` pair in `dataStream`.
|
|
@@ -1336,6 +1452,8 @@ export interface ITableCell {
|
|
|
1336
1452
|
borderTop?: ITableCellBorder;
|
|
1337
1453
|
borderBottom?: ITableCellBorder;
|
|
1338
1454
|
size?: IWidthInTableSize;
|
|
1455
|
+
/** Original OOXML cell-width unit; retained for percentage-width conversion and export. */
|
|
1456
|
+
tcWidthType?: 'auto' | 'dxa' | 'nil' | 'pct';
|
|
1339
1457
|
tcFitText?: BooleanNumber;
|
|
1340
1458
|
/** Exclude the cell's final paragraph mark from content height (OOXML w:hideMark). */
|
|
1341
1459
|
tcHideMark?: BooleanNumber;
|
|
@@ -1352,6 +1470,14 @@ export interface ITableCellMargin {
|
|
|
1352
1470
|
/**
|
|
1353
1471
|
* Properties of cell border
|
|
1354
1472
|
*/
|
|
1473
|
+
export interface ITableBorderDefaults {
|
|
1474
|
+
top?: ITableCellBorder;
|
|
1475
|
+
left?: ITableCellBorder;
|
|
1476
|
+
bottom?: ITableCellBorder;
|
|
1477
|
+
right?: ITableCellBorder;
|
|
1478
|
+
insideHorizontal?: ITableCellBorder;
|
|
1479
|
+
insideVertical?: ITableCellBorder;
|
|
1480
|
+
}
|
|
1355
1481
|
export interface ITableCellBorder {
|
|
1356
1482
|
color: IColorStyle;
|
|
1357
1483
|
width?: INumberUnit;
|
|
@@ -1387,6 +1513,8 @@ export declare enum FontStyleType {
|
|
|
1387
1513
|
export interface INumberUnit {
|
|
1388
1514
|
v: number;
|
|
1389
1515
|
u?: NumberUnitType;
|
|
1516
|
+
/** Absolute document length used when a relative value is zero or cleared. */
|
|
1517
|
+
fallback?: number;
|
|
1390
1518
|
}
|
|
1391
1519
|
export interface IObjectPositionH {
|
|
1392
1520
|
relativeFrom: ObjectRelativeFromH;
|