@univerjs/core 0.5.4 → 0.5.5-experimental.20250123-34738ff
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/index.js +11 -10
- package/lib/es/index.js +12167 -11289
- package/lib/types/common/const.d.ts +1 -0
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -3
- package/lib/types/docs/data-model/rich-text-builder.d.ts +68 -13
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/utils.d.ts +48 -1
- package/lib/types/facade/f-base.d.ts +17 -0
- package/lib/types/facade/f-blob.d.ts +3 -0
- package/lib/types/facade/f-doc.d.ts +4 -0
- package/lib/types/facade/f-enum.d.ts +93 -1
- package/lib/types/facade/f-event.d.ts +28 -18
- package/lib/types/facade/f-hooks.d.ts +11 -24
- package/lib/types/facade/f-univer.d.ts +35 -20
- package/lib/types/facade/f-usermanager.d.ts +3 -0
- package/lib/types/facade/f-util.d.ts +9 -0
- package/lib/types/index.d.ts +2 -3
- package/lib/types/services/config/config.service.d.ts +1 -1
- package/lib/types/services/context/context.d.ts +1 -0
- package/lib/types/shared/index.d.ts +1 -1
- package/lib/types/shared/numfmt.d.ts +2 -2
- package/lib/types/shared/types/numfmt.type.d.ts +1 -1
- package/lib/umd/index.js +11 -10
- package/package.json +5 -5
- package/LICENSE +0 -176
- package/lib/types/common/__tests__/array.spec.d.ts +0 -16
- package/lib/types/common/__tests__/interceptor.spec.d.ts +0 -16
- package/lib/types/common/__tests__/url.spec.d.ts +0 -16
- package/lib/types/docs/data-model/__tests__/replacement.spec.d.ts +0 -16
- package/lib/types/docs/data-model/json-x/__tests__/json-x.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/action-iterator.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/apply-consistency.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/apply-utils.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/apply.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/common.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/compose.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/delete-apply.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/invert.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/text-x.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform-custom-decorations.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform-custom-range.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform-paragraph.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform-position.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform-textrun.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/transform.spec.d.ts +0 -16
- package/lib/types/docs/data-model/text-x/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/observer/__tests__/observable.spec.d.ts +0 -16
- package/lib/types/services/__tests__/index.d.ts +0 -18
- package/lib/types/services/__tests__/permission.spec.d.ts +0 -16
- package/lib/types/services/__tests__/resources.spec.d.ts +0 -16
- package/lib/types/services/command/__tests__/command.service.spec.d.ts +0 -16
- package/lib/types/services/context/__tests__/context.service.spec.d.ts +0 -16
- package/lib/types/services/lifecycle/__tests__/lifecycle.service.spec.d.ts +0 -16
- package/lib/types/services/locale/__tests__/locale.service.spec.d.ts +0 -16
- package/lib/types/services/plugin/__tests__/plugin-override.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/array-search.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/common.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/compose.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/doc-tool.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/name.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/object-matrix.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/range.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/rectangle.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/ref-alias.spec.d.ts +0 -16
- package/lib/types/shared/__tests__/rxjs.spec.d.ts +0 -16
- package/lib/types/shared/lru/__tests__/lru-map.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/cell-data.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +0 -14
- package/lib/types/sheets/__tests__/ranges.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/span-mode.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/styles.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/workbook.spec.d.ts +0 -16
- package/lib/types/sheets/__tests__/worksheet.spec.d.ts +0 -16
|
@@ -18,5 +18,6 @@ export declare const DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = "__INTERNAL_EDITOR__D
|
|
|
18
18
|
export declare const DOCS_ZEN_EDITOR_UNIT_ID_KEY = "__INTERNAL_EDITOR__ZEN_EDITOR";
|
|
19
19
|
export declare const DEFAULT_EMPTY_DOCUMENT_VALUE = "\r\n";
|
|
20
20
|
export declare const IS_ROW_STYLE_PRECEDE_COLUMN_STYLE = "isRowStylePrecedeColumnStyle";
|
|
21
|
+
export declare const AUTO_HEIGHT_FOR_MERGED_CELLS: unique symbol;
|
|
21
22
|
export declare function createInternalEditorID(id: string): string;
|
|
22
23
|
export declare function isInternalEditorID(id: string): boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { UnitModel, UniverInstanceType } from '../../common/unit';
|
|
3
|
-
import { SliceBodyType } from './text-x/utils';
|
|
4
1
|
import { Nullable } from '../../shared';
|
|
5
2
|
import { IDocumentBody, IDocumentData, IDocumentRenderConfig, IDocumentStyle, IDrawings, IListData } from '../../types/interfaces/i-document-data';
|
|
6
3
|
import { IPaddingData } from '../../types/interfaces/i-style-data';
|
|
7
4
|
import { JSONXActions } from './json-x/json-x';
|
|
5
|
+
import { BehaviorSubject } from 'rxjs';
|
|
6
|
+
import { UnitModel, UniverInstanceType } from '../../common/unit';
|
|
7
|
+
import { SliceBodyType } from './text-x/utils';
|
|
8
8
|
export declare const DEFAULT_DOC: {
|
|
9
9
|
id: string;
|
|
10
10
|
documentStyle: {};
|
|
@@ -46,6 +46,7 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
|
|
|
46
46
|
private _unitId;
|
|
47
47
|
headerModelMap: Map<string, DocumentDataModel>;
|
|
48
48
|
footerModelMap: Map<string, DocumentDataModel>;
|
|
49
|
+
change$: BehaviorSubject<number>;
|
|
49
50
|
constructor(snapshot: Partial<IDocumentData>);
|
|
50
51
|
dispose(): void;
|
|
51
52
|
getDrawings(): IDrawings | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Nullable } from '../../shared';
|
|
2
2
|
import { BaselineOffset, HorizontalAlign, TextDecoration, TextDirection, BooleanNumber } from '../../types/enum';
|
|
3
3
|
import { IBorderData, IColorStyle, IDocumentBody, IDocumentData, INumberUnit, IParagraphBorder, IParagraphStyle, IShading, ITabStop, ITextDecoration, ITextStyle, NamedStyleType, SpacingRule } from '../../types/interfaces';
|
|
4
|
+
export declare function normalizeBody(body: IDocumentBody): IDocumentBody;
|
|
5
|
+
export declare function normalizeData(data: IDocumentData): IDocumentData;
|
|
4
6
|
/**
|
|
5
7
|
* Represents a read-only font style value object.
|
|
6
8
|
* This class provides access to font style properties without modification capabilities.
|
|
@@ -1084,18 +1086,31 @@ export declare class RichTextValue {
|
|
|
1084
1086
|
* Creates a new RichTextValue instance
|
|
1085
1087
|
* @param {IDocumentData} data The initial data for the rich text value
|
|
1086
1088
|
* @returns {RichTextValue} A new RichTextValue instance
|
|
1089
|
+
* @example
|
|
1090
|
+
* ```ts
|
|
1091
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1092
|
+
* ```
|
|
1087
1093
|
*/
|
|
1088
1094
|
static create(data: IDocumentData): RichTextValue;
|
|
1089
1095
|
/**
|
|
1090
1096
|
* Creates a new RichTextValue instance
|
|
1091
1097
|
* @param {IDocumentBody} data The initial data for the rich text value
|
|
1092
1098
|
* @returns {RichTextValue} A new RichTextValue instance
|
|
1099
|
+
* @example
|
|
1100
|
+
* ```ts
|
|
1101
|
+
* const richText = RichTextValue.createByBody({ dataStream: 'Hello World\r\n' });
|
|
1102
|
+
* ```
|
|
1093
1103
|
*/
|
|
1094
1104
|
static createByBody(data: IDocumentBody): RichTextValue;
|
|
1095
1105
|
constructor(data: IDocumentData);
|
|
1096
1106
|
/**
|
|
1097
1107
|
* Creates a copy of the current RichTextValue instance
|
|
1098
1108
|
* @returns {RichTextValue} A new instance of RichTextValue with the same data
|
|
1109
|
+
* @example
|
|
1110
|
+
* ```ts
|
|
1111
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1112
|
+
* const copy = richText.copy();
|
|
1113
|
+
* ```
|
|
1099
1114
|
*/
|
|
1100
1115
|
copy(): RichTextBuilder;
|
|
1101
1116
|
/**
|
|
@@ -1103,31 +1118,61 @@ export declare class RichTextValue {
|
|
|
1103
1118
|
* @param {number} start The start index
|
|
1104
1119
|
* @param {number} end The end index
|
|
1105
1120
|
* @returns {RichTextBuilder} A new instance of RichTextBuilder with the sliced data
|
|
1121
|
+
* @example
|
|
1122
|
+
* ```ts
|
|
1123
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1124
|
+
* const sliced = richText.slice(0, 5);
|
|
1125
|
+
* ```
|
|
1106
1126
|
*/
|
|
1107
1127
|
slice(start: number, end: number): RichTextBuilder;
|
|
1108
1128
|
/**
|
|
1109
1129
|
* Converts the current RichTextValue instance to plain text
|
|
1110
1130
|
* @returns {string} The plain text representation of the current RichTextValue instance
|
|
1131
|
+
* @example
|
|
1132
|
+
* ```ts
|
|
1133
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1134
|
+
* const plainText = richText.toPlainText();
|
|
1135
|
+
* ```
|
|
1111
1136
|
*/
|
|
1112
1137
|
toPlainText(): string;
|
|
1113
1138
|
/**
|
|
1114
1139
|
* Gets the paragraph style of the current RichTextValue instance
|
|
1115
1140
|
* @returns {ParagraphStyleValue} The paragraph style of the current RichTextValue instance
|
|
1141
|
+
* @example
|
|
1142
|
+
* ```ts
|
|
1143
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1144
|
+
* const style = richText.getParagraphStyle();
|
|
1145
|
+
* ```
|
|
1116
1146
|
*/
|
|
1117
1147
|
getParagraphStyle(): ParagraphStyleValue;
|
|
1118
1148
|
/**
|
|
1119
1149
|
* Gets the paragraph bullet of the current RichTextValue instance
|
|
1120
1150
|
* @returns {ParagraphBulletValue} The paragraph bullet of the current RichTextValue instance
|
|
1151
|
+
* @example
|
|
1152
|
+
* ```ts
|
|
1153
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1154
|
+
* const bullet = richText.getParagraphBullet();
|
|
1155
|
+
* ```
|
|
1121
1156
|
*/
|
|
1122
1157
|
getParagraphBullet(): import('../..').IBullet | undefined;
|
|
1123
1158
|
/**
|
|
1124
1159
|
* Gets the paragraphs of the current RichTextValue instance
|
|
1125
1160
|
* @returns {RichTextValue[]} The paragraphs of the current RichTextValue instance
|
|
1161
|
+
* @example
|
|
1162
|
+
* ```ts
|
|
1163
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1164
|
+
* const paragraphs = richText.getParagraphs();
|
|
1165
|
+
* ```
|
|
1126
1166
|
*/
|
|
1127
1167
|
getParagraphs(): RichTextValue[];
|
|
1128
1168
|
/**
|
|
1129
1169
|
* Gets the text runs of the current RichTextValue instance
|
|
1130
1170
|
* @returns {TextRunValue[]} The text runs of the current RichTextValue instance
|
|
1171
|
+
* @example
|
|
1172
|
+
* ```ts
|
|
1173
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1174
|
+
* const textRuns = richText.getTextRuns();
|
|
1175
|
+
* ```
|
|
1131
1176
|
*/
|
|
1132
1177
|
getTextRuns(): {
|
|
1133
1178
|
ts: TextStyleValue | null;
|
|
@@ -1137,12 +1182,22 @@ export declare class RichTextValue {
|
|
|
1137
1182
|
}[];
|
|
1138
1183
|
/**
|
|
1139
1184
|
* Gets the links of the current RichTextValue instance
|
|
1140
|
-
* @returns {
|
|
1185
|
+
* @returns {ICustomRange[]} The links of the current RichTextValue instance
|
|
1186
|
+
* @example
|
|
1187
|
+
* ```ts
|
|
1188
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1189
|
+
* const links = richText.getLinks();
|
|
1190
|
+
* ```
|
|
1141
1191
|
*/
|
|
1142
1192
|
getLinks(): import('../..').ICustomRange<Record<string, any>>[];
|
|
1143
1193
|
/**
|
|
1144
1194
|
* Gets the data of the current RichTextValue instance
|
|
1145
1195
|
* @returns {IDocumentData} The data of the current RichTextValue instance
|
|
1196
|
+
* @example
|
|
1197
|
+
* ```ts
|
|
1198
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1199
|
+
* const data = richText.getData();
|
|
1200
|
+
* ```
|
|
1146
1201
|
*/
|
|
1147
1202
|
getData(): IDocumentData;
|
|
1148
1203
|
}
|
|
@@ -1167,7 +1222,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1167
1222
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1168
1223
|
* @example
|
|
1169
1224
|
* ```ts
|
|
1170
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello' } });
|
|
1225
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1171
1226
|
* const newRichText = richText.insertText(0, 'World');
|
|
1172
1227
|
* ```
|
|
1173
1228
|
*/
|
|
@@ -1180,7 +1235,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1180
1235
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1181
1236
|
* @example
|
|
1182
1237
|
* ```ts
|
|
1183
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello' } });
|
|
1238
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1184
1239
|
* const newRichText = richText.insertText(5, 'World', { ff: 'Arial', fs: 12 });
|
|
1185
1240
|
* ```
|
|
1186
1241
|
*/
|
|
@@ -1191,7 +1246,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1191
1246
|
* @returns {RichTextValue | IDocumentData} The current RichTextBuilder instance
|
|
1192
1247
|
* @example
|
|
1193
1248
|
* ```ts
|
|
1194
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello' } });
|
|
1249
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1195
1250
|
* const newRichText = richText.insertRichText(RichTextValue.create({ body: { dataStream: 'World' } }));
|
|
1196
1251
|
* ```
|
|
1197
1252
|
*/
|
|
@@ -1203,7 +1258,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1203
1258
|
* @returns {RichTextValue | IDocumentData} The current RichTextBuilder instance
|
|
1204
1259
|
* @example
|
|
1205
1260
|
* ```ts
|
|
1206
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello' } });
|
|
1261
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1207
1262
|
* const newRichText = richText.insertRichText(5, RichTextValue.create({ body: { dataStream: 'World' } }));
|
|
1208
1263
|
* ```
|
|
1209
1264
|
*/
|
|
@@ -1214,7 +1269,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1214
1269
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1215
1270
|
* @example
|
|
1216
1271
|
* ```ts
|
|
1217
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1272
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1218
1273
|
* const newRichText = richText.delete(5);
|
|
1219
1274
|
* ```
|
|
1220
1275
|
*/
|
|
@@ -1226,7 +1281,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1226
1281
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1227
1282
|
* @example
|
|
1228
1283
|
* ```ts
|
|
1229
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1284
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1230
1285
|
* const newRichText = richText.delete(5, 5);
|
|
1231
1286
|
* ```
|
|
1232
1287
|
*/
|
|
@@ -1239,7 +1294,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1239
1294
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1240
1295
|
* @example
|
|
1241
1296
|
* ```ts
|
|
1242
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1297
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1243
1298
|
* const newRichText = richText.setStyle(5, 10, { ff: 'Arial', fs: 12 });
|
|
1244
1299
|
* ```
|
|
1245
1300
|
*/
|
|
@@ -1252,7 +1307,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1252
1307
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1253
1308
|
* @example
|
|
1254
1309
|
* ```ts
|
|
1255
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1310
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1256
1311
|
* const newRichText = richText.setLink(5, 10, 'https://www.example.com');
|
|
1257
1312
|
* ```
|
|
1258
1313
|
*/
|
|
@@ -1265,7 +1320,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1265
1320
|
* ```ts
|
|
1266
1321
|
* const richText = RichTextValue.create({
|
|
1267
1322
|
* body: {
|
|
1268
|
-
* dataStream: 'Hello World',
|
|
1323
|
+
* dataStream: 'Hello World\r\n',
|
|
1269
1324
|
* customRanges: [
|
|
1270
1325
|
* {
|
|
1271
1326
|
* rangeType: CustomRangeType.HYPERLINK,
|
|
@@ -1289,7 +1344,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1289
1344
|
* ```ts
|
|
1290
1345
|
* const richText = RichTextValue.create({
|
|
1291
1346
|
* body: {
|
|
1292
|
-
* dataStream: 'Hello World',
|
|
1347
|
+
* dataStream: 'Hello World\r\n',
|
|
1293
1348
|
* customRanges: [
|
|
1294
1349
|
* {
|
|
1295
1350
|
* rangeType: CustomRangeType.HYPERLINK,
|
|
@@ -1312,7 +1367,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1312
1367
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1313
1368
|
* @example
|
|
1314
1369
|
* ```ts
|
|
1315
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1370
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1316
1371
|
* const newRichText = richText.insertParagraph();
|
|
1317
1372
|
* ```
|
|
1318
1373
|
*/
|
|
@@ -1324,7 +1379,7 @@ export declare class RichTextBuilder extends RichTextValue {
|
|
|
1324
1379
|
* @returns {RichTextBuilder} The current RichTextBuilder instance
|
|
1325
1380
|
* @example
|
|
1326
1381
|
* ```ts
|
|
1327
|
-
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World' } });
|
|
1382
|
+
* const richText = RichTextValue.create({ body: { dataStream: 'Hello World\r\n' } });
|
|
1328
1383
|
* const newRichText = richText.insertParagraph(5, { ff: 'Arial', fs: 12 });
|
|
1329
1384
|
* ```
|
|
1330
1385
|
*/
|
|
@@ -19,6 +19,7 @@ export declare class BuildTextUtils {
|
|
|
19
19
|
makeSelection: typeof makeSelection;
|
|
20
20
|
normalizeSelection: typeof normalizeSelection;
|
|
21
21
|
delete: typeof deleteSelectionTextX;
|
|
22
|
+
replaceTextRuns: (params: import('./text-x-utils').IReplaceSelectionTextXParams) => false | import('../text-x').TextX;
|
|
22
23
|
retain: typeof retainSelectionTextX;
|
|
23
24
|
};
|
|
24
25
|
static range: {
|
|
@@ -38,3 +38,4 @@ export interface IReplaceSelectionTextXParams {
|
|
|
38
38
|
doc: DocumentDataModel;
|
|
39
39
|
}
|
|
40
40
|
export declare const replaceSelectionTextX: (params: IReplaceSelectionTextXParams) => false | TextX;
|
|
41
|
+
export declare const replaceSelectionTextRuns: (params: IReplaceSelectionTextXParams) => false | TextX;
|
|
@@ -1,10 +1,57 @@
|
|
|
1
|
-
import { ICustomDecoration, IDocumentBody } from '../../../types/interfaces/i-document-data';
|
|
1
|
+
import { ICustomDecoration, IDocumentBody, ITextRun } from '../../../types/interfaces/i-document-data';
|
|
2
2
|
import { IRetainAction } from './action-types';
|
|
3
3
|
import { UpdateDocsAttributeType } from '../../../shared/command-enum';
|
|
4
4
|
export declare enum SliceBodyType {
|
|
5
5
|
copy = 0,
|
|
6
6
|
cut = 1
|
|
7
7
|
}
|
|
8
|
+
export declare function getTextRunSlice(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyTextRuns?: boolean): ITextRun[] | undefined;
|
|
9
|
+
export declare function getTableSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
10
|
+
startIndex: number;
|
|
11
|
+
endIndex: number;
|
|
12
|
+
tableId: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
15
|
+
startIndex: number;
|
|
16
|
+
paragraphStyle?: import('../../..').IParagraphStyle;
|
|
17
|
+
bullet?: import('../../..').IBullet;
|
|
18
|
+
}[] | undefined;
|
|
19
|
+
export declare function getSectionBreakSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
20
|
+
startIndex: number;
|
|
21
|
+
pageNumberStart?: number;
|
|
22
|
+
pageSize?: import('../../..').ISize;
|
|
23
|
+
pageOrient?: import('../../..').PageOrientType;
|
|
24
|
+
documentFlavor?: import('../../..').DocumentFlavor;
|
|
25
|
+
marginHeader?: number;
|
|
26
|
+
marginFooter?: number;
|
|
27
|
+
renderConfig?: import('../../..').IDocumentRenderConfig;
|
|
28
|
+
marginTop?: number;
|
|
29
|
+
marginBottom?: number;
|
|
30
|
+
marginRight?: number;
|
|
31
|
+
marginLeft?: number;
|
|
32
|
+
charSpace?: number;
|
|
33
|
+
linePitch?: number;
|
|
34
|
+
gridType?: import('../../..').GridType;
|
|
35
|
+
columnProperties?: import('../../..').ISectionColumnProperties[];
|
|
36
|
+
columnSeparatorType?: import('../../..').ColumnSeparatorType;
|
|
37
|
+
contentDirection?: import('../../..').TextDirection;
|
|
38
|
+
sectionType?: import('../../..').SectionType;
|
|
39
|
+
sectionTypeNext?: import('../../..').SectionType;
|
|
40
|
+
textDirection?: import('../../..').TextDirectionType;
|
|
41
|
+
defaultHeaderId?: string;
|
|
42
|
+
defaultFooterId?: string;
|
|
43
|
+
evenPageHeaderId?: string;
|
|
44
|
+
evenPageFooterId?: string;
|
|
45
|
+
firstPageHeaderId?: string;
|
|
46
|
+
firstPageFooterId?: string;
|
|
47
|
+
useFirstPageHeaderFooter?: import('../../..').BooleanNumber;
|
|
48
|
+
evenAndOddHeaders?: import('../../..').BooleanNumber;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
export declare function getCustomBlockSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
51
|
+
startIndex: number;
|
|
52
|
+
blockType?: import('../../..').BlockType;
|
|
53
|
+
blockId: string;
|
|
54
|
+
}[] | undefined;
|
|
8
55
|
export declare function getBodySlice(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyArray?: boolean, type?: SliceBodyType): IDocumentBody;
|
|
9
56
|
export declare function normalizeBody(body: IDocumentBody): IDocumentBody;
|
|
10
57
|
export declare function getCustomRangeSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
@@ -4,16 +4,33 @@ import { Disposable } from '../shared';
|
|
|
4
4
|
* `FBase` is a base class for all facade classes.
|
|
5
5
|
* It provides a way to extend classes with static and instance methods.
|
|
6
6
|
* The `_initialize` as a special method that will be called after the constructor. You should never call it directly.
|
|
7
|
+
* @ignore
|
|
7
8
|
*/
|
|
8
9
|
export declare abstract class FBase extends Disposable {
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
9
13
|
static extend(source: any): void;
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
11
18
|
declare const InitializerSymbol: unique symbol;
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
* @hideconstructor
|
|
22
|
+
*/
|
|
12
23
|
export declare class FBaseInitialable extends Disposable {
|
|
13
24
|
protected _injector: Injector;
|
|
14
25
|
private [InitializerSymbol];
|
|
15
26
|
constructor(_injector: Injector);
|
|
27
|
+
/**
|
|
28
|
+
* @ignore
|
|
29
|
+
*/
|
|
16
30
|
_initialize(injector: Injector): void;
|
|
31
|
+
/**
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
17
34
|
static extend(source: any): void;
|
|
18
35
|
}
|
|
19
36
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DocumentDataModel } from '../docs';
|
|
2
2
|
import { Injector } from '../common/di';
|
|
3
3
|
import { FBaseInitialable } from './f-base';
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
* @hideconstructor
|
|
7
|
+
*/
|
|
4
8
|
export declare class FDoc extends FBaseInitialable {
|
|
5
9
|
protected doc: DocumentDataModel;
|
|
6
10
|
constructor(doc: DocumentDataModel, _injector: Injector);
|
|
@@ -1,15 +1,39 @@
|
|
|
1
1
|
import { UniverInstanceType } from '../common/unit';
|
|
2
2
|
import { CommandType } from '../services/command/command.service';
|
|
3
3
|
import { LifecycleStages } from '../services/lifecycle/lifecycle';
|
|
4
|
-
import { BaselineOffset, BooleanNumber, HorizontalAlign, TextDecoration, TextDirection, VerticalAlign } from '../types/enum';
|
|
4
|
+
import { BaselineOffset, BooleanNumber, BorderStyleTypes, BorderType, HorizontalAlign, TextDecoration, TextDirection, VerticalAlign } from '../types/enum';
|
|
5
|
+
import { AutoFillSeries } from '../types/enum/auto-fill-series';
|
|
6
|
+
import { ColorType } from '../types/enum/color-type';
|
|
7
|
+
import { CommonHideTypes } from '../types/enum/common-hide-types';
|
|
8
|
+
import { CopyPasteType } from '../types/enum/copy-paste-type';
|
|
5
9
|
import { DataValidationErrorStyle } from '../types/enum/data-validation-error-style';
|
|
6
10
|
import { DataValidationOperator } from '../types/enum/data-validation-operator';
|
|
7
11
|
import { DataValidationRenderMode } from '../types/enum/data-validation-render-mode';
|
|
8
12
|
import { DataValidationStatus } from '../types/enum/data-validation-status';
|
|
9
13
|
import { DataValidationType } from '../types/enum/data-validation-type';
|
|
14
|
+
import { DeleteDirection } from '../types/enum/delete-direction';
|
|
15
|
+
import { DeveloperMetadataVisibility } from '../types/enum/developer-metadata-visibility';
|
|
16
|
+
import { Dimension } from '../types/enum/dimension';
|
|
17
|
+
import { Direction } from '../types/enum/direction';
|
|
18
|
+
import { InterpolationPointType } from '../types/enum/interpolation-point-type';
|
|
19
|
+
import { LocaleType } from '../types/enum/locale-type';
|
|
20
|
+
import { MentionType } from '../types/enum/mention-type';
|
|
21
|
+
import { ProtectionType } from '../types/enum/protection-type';
|
|
22
|
+
import { RelativeDate } from '../types/enum/relative-date';
|
|
23
|
+
import { SheetTypes } from '../types/enum/sheet-types';
|
|
24
|
+
import { ThemeColorType } from '../types/enum/theme-color-type';
|
|
25
|
+
/**
|
|
26
|
+
* @hideconstructor
|
|
27
|
+
*/
|
|
10
28
|
export declare class FEnum {
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
11
32
|
static _instance: FEnum | null;
|
|
12
33
|
static get(): FEnum;
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
13
37
|
static extend(source: any): void;
|
|
14
38
|
constructor();
|
|
15
39
|
/**
|
|
@@ -68,4 +92,72 @@ export declare class FEnum {
|
|
|
68
92
|
* Different vertical text alignment options
|
|
69
93
|
*/
|
|
70
94
|
get VerticalAlign(): typeof VerticalAlign;
|
|
95
|
+
/**
|
|
96
|
+
* Different border types
|
|
97
|
+
*/
|
|
98
|
+
get BorderType(): typeof BorderType;
|
|
99
|
+
/**
|
|
100
|
+
* Different border style types
|
|
101
|
+
*/
|
|
102
|
+
get BorderStyleTypes(): typeof BorderStyleTypes;
|
|
103
|
+
/**
|
|
104
|
+
* Auto fill series types
|
|
105
|
+
*/
|
|
106
|
+
get AutoFillSeries(): typeof AutoFillSeries;
|
|
107
|
+
/**
|
|
108
|
+
* Color types
|
|
109
|
+
*/
|
|
110
|
+
get ColorType(): typeof ColorType;
|
|
111
|
+
/**
|
|
112
|
+
* Common hide types
|
|
113
|
+
*/
|
|
114
|
+
get CommonHideTypes(): typeof CommonHideTypes;
|
|
115
|
+
/**
|
|
116
|
+
* Copy paste types
|
|
117
|
+
*/
|
|
118
|
+
get CopyPasteType(): typeof CopyPasteType;
|
|
119
|
+
/**
|
|
120
|
+
* Delete direction types
|
|
121
|
+
*/
|
|
122
|
+
get DeleteDirection(): typeof DeleteDirection;
|
|
123
|
+
/**
|
|
124
|
+
* Developer metadata visibility types
|
|
125
|
+
*/
|
|
126
|
+
get DeveloperMetadataVisibility(): typeof DeveloperMetadataVisibility;
|
|
127
|
+
/**
|
|
128
|
+
* Dimension types
|
|
129
|
+
*/
|
|
130
|
+
get Dimension(): typeof Dimension;
|
|
131
|
+
/**
|
|
132
|
+
* Direction types
|
|
133
|
+
*/
|
|
134
|
+
get Direction(): typeof Direction;
|
|
135
|
+
/**
|
|
136
|
+
* Interpolation point types
|
|
137
|
+
*/
|
|
138
|
+
get InterpolationPointType(): typeof InterpolationPointType;
|
|
139
|
+
/**
|
|
140
|
+
* Locale types
|
|
141
|
+
*/
|
|
142
|
+
get LocaleType(): typeof LocaleType;
|
|
143
|
+
/**
|
|
144
|
+
* Mention types
|
|
145
|
+
*/
|
|
146
|
+
get MentionType(): typeof MentionType;
|
|
147
|
+
/**
|
|
148
|
+
* Protection types
|
|
149
|
+
*/
|
|
150
|
+
get ProtectionType(): typeof ProtectionType;
|
|
151
|
+
/**
|
|
152
|
+
* Relative date types
|
|
153
|
+
*/
|
|
154
|
+
get RelativeDate(): typeof RelativeDate;
|
|
155
|
+
/**
|
|
156
|
+
* Sheet types
|
|
157
|
+
*/
|
|
158
|
+
get SheetTypes(): typeof SheetTypes;
|
|
159
|
+
/**
|
|
160
|
+
* Theme color types
|
|
161
|
+
*/
|
|
162
|
+
get ThemeColorType(): typeof ThemeColorType;
|
|
71
163
|
}
|
|
@@ -6,6 +6,7 @@ import { FDoc } from './f-doc';
|
|
|
6
6
|
/**
|
|
7
7
|
* Base interface for all event parameters
|
|
8
8
|
* @interface IEventBase
|
|
9
|
+
* @ignore
|
|
9
10
|
*/
|
|
10
11
|
export interface IEventBase {
|
|
11
12
|
/** Flag to cancel the event if supported */
|
|
@@ -61,9 +62,18 @@ export interface ICommandEvent extends IEventBase {
|
|
|
61
62
|
/** Type of the command */
|
|
62
63
|
type: CommandType;
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* @hideconstructor
|
|
67
|
+
*/
|
|
64
68
|
export declare class FEventName {
|
|
69
|
+
/**
|
|
70
|
+
* @ignore
|
|
71
|
+
*/
|
|
65
72
|
static _instance: FEventName | null;
|
|
66
73
|
static get(): FEventName;
|
|
74
|
+
/**
|
|
75
|
+
* @ignore
|
|
76
|
+
*/
|
|
67
77
|
static extend(source: any): void;
|
|
68
78
|
constructor();
|
|
69
79
|
/**
|
|
@@ -72,8 +82,8 @@ export declare class FEventName {
|
|
|
72
82
|
* @example
|
|
73
83
|
* ```ts
|
|
74
84
|
* univerAPI.addEvent(univerAPI.event.DocCreated, (params) => {
|
|
75
|
-
*
|
|
76
|
-
*
|
|
85
|
+
* const { unitId, type, doc, unit } = params;
|
|
86
|
+
* console.log('doc created', params);
|
|
77
87
|
* });
|
|
78
88
|
* ```
|
|
79
89
|
*/
|
|
@@ -84,8 +94,8 @@ export declare class FEventName {
|
|
|
84
94
|
* @example
|
|
85
95
|
* ```ts
|
|
86
96
|
* univerAPI.addEvent(univerAPI.event.DocDisposed, (params) => {
|
|
87
|
-
*
|
|
88
|
-
*
|
|
97
|
+
* const { unitId, unitType, snapshot } = params;
|
|
98
|
+
* console.log('doc disposed', params);
|
|
89
99
|
* });
|
|
90
100
|
* ```
|
|
91
101
|
*/
|
|
@@ -96,8 +106,8 @@ export declare class FEventName {
|
|
|
96
106
|
* @example
|
|
97
107
|
* ```ts
|
|
98
108
|
* univerAPI.addEvent(univerAPI.event.LifeCycleChanged, (params) => {
|
|
99
|
-
*
|
|
100
|
-
*
|
|
109
|
+
* const { stage } = params;
|
|
110
|
+
* console.log('life cycle changed', params);
|
|
101
111
|
* });
|
|
102
112
|
* ```
|
|
103
113
|
*/
|
|
@@ -108,8 +118,8 @@ export declare class FEventName {
|
|
|
108
118
|
* @example
|
|
109
119
|
* ```ts
|
|
110
120
|
* univerAPI.addEvent(univerAPI.event.Redo, (event) => {
|
|
111
|
-
*
|
|
112
|
-
*
|
|
121
|
+
* const { params, id, type } = event;
|
|
122
|
+
* console.log('command executed', event);
|
|
113
123
|
* });
|
|
114
124
|
* ```
|
|
115
125
|
*/
|
|
@@ -120,8 +130,8 @@ export declare class FEventName {
|
|
|
120
130
|
* @example
|
|
121
131
|
* ```ts
|
|
122
132
|
* univerAPI.addEvent(univerAPI.event.Undo, (event) => {
|
|
123
|
-
*
|
|
124
|
-
*
|
|
133
|
+
* const { params, id, type } = event;
|
|
134
|
+
* console.log('command executed', event);
|
|
125
135
|
* });
|
|
126
136
|
* ```
|
|
127
137
|
*/
|
|
@@ -132,8 +142,8 @@ export declare class FEventName {
|
|
|
132
142
|
* @example
|
|
133
143
|
* ```ts
|
|
134
144
|
* univerAPI.addEvent(univerAPI.event.BeforeRedo, (event) => {
|
|
135
|
-
*
|
|
136
|
-
*
|
|
145
|
+
* const { params, id, type } = event;
|
|
146
|
+
* console.log('command executed', event);
|
|
137
147
|
* });
|
|
138
148
|
* ```
|
|
139
149
|
*/
|
|
@@ -144,8 +154,8 @@ export declare class FEventName {
|
|
|
144
154
|
* @example
|
|
145
155
|
* ```ts
|
|
146
156
|
* univerAPI.addEvent(univerAPI.event.BeforeUndo, (event) => {
|
|
147
|
-
*
|
|
148
|
-
*
|
|
157
|
+
* const { params, id, type } = event;
|
|
158
|
+
* console.log('command executed', event);
|
|
149
159
|
* });
|
|
150
160
|
* ```
|
|
151
161
|
*/
|
|
@@ -156,8 +166,8 @@ export declare class FEventName {
|
|
|
156
166
|
* @example
|
|
157
167
|
* ```ts
|
|
158
168
|
* univerAPI.addEvent(univerAPI.event.CommandExecuted, (event) => {
|
|
159
|
-
*
|
|
160
|
-
*
|
|
169
|
+
* const { params, id, type } = event;
|
|
170
|
+
* console.log('command executed', event);
|
|
161
171
|
* });
|
|
162
172
|
* ```
|
|
163
173
|
*/
|
|
@@ -168,8 +178,8 @@ export declare class FEventName {
|
|
|
168
178
|
* @example
|
|
169
179
|
* ```ts
|
|
170
180
|
* univerAPI.addEvent(univerAPI.event.BeforeCommandExecute, (event) => {
|
|
171
|
-
*
|
|
172
|
-
*
|
|
181
|
+
* const { params, id, type } = event;
|
|
182
|
+
* console.log('command executed', event);
|
|
173
183
|
* });
|
|
174
184
|
* ```
|
|
175
185
|
*/
|