@univerjs/core 0.25.1 → 1.0.0-alpha.1

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 (36) hide show
  1. package/lib/cjs/facade.js +32 -8
  2. package/lib/cjs/index.js +2697 -1892
  3. package/lib/es/facade.js +32 -8
  4. package/lib/es/index.js +2684 -1892
  5. package/lib/facade.js +32 -8
  6. package/lib/index.js +2684 -1892
  7. package/lib/types/bases/base-data-model.d.ts +33 -0
  8. package/lib/types/bases/empty-snapshot.d.ts +27 -0
  9. package/lib/types/bases/index.d.ts +18 -0
  10. package/lib/types/bases/typedef.d.ts +642 -0
  11. package/lib/types/common/const.d.ts +0 -1
  12. package/lib/types/common/equal.d.ts +0 -15
  13. package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +11 -2
  14. package/lib/types/docs/data-model/text-x/build-utils/drawings.d.ts +0 -1
  15. package/lib/types/docs/data-model/text-x/utils.d.ts +5 -1
  16. package/lib/types/docs/data-model/types.d.ts +6 -0
  17. package/lib/types/docs/paragraph-id.d.ts +24 -0
  18. package/lib/types/facade/f-univer.d.ts +20 -0
  19. package/lib/types/facade/f-util.d.ts +1 -1
  20. package/lib/types/index.d.ts +32 -16
  21. package/lib/types/services/config/config.service.d.ts +2 -3
  22. package/lib/types/services/locale/locale.service.d.ts +1 -1
  23. package/lib/types/services/resource-loader/resource-loader.service.d.ts +2 -1
  24. package/lib/types/services/resource-manager/resource-manager.service.d.ts +1 -4
  25. package/lib/types/services/resource-manager/type.d.ts +1 -1
  26. package/lib/types/services/theme/theme.service.d.ts +2 -2
  27. package/lib/types/shared/index.d.ts +1 -0
  28. package/lib/types/shared/locale.d.ts +3 -0
  29. package/lib/types/{docs/data-model/text-x/build-utils/__test__/text-x.d.ts → shared/random-id.d.ts} +2 -1
  30. package/lib/types/shared/tools.d.ts +0 -1
  31. package/lib/types/sheets/typedef.d.ts +20 -32
  32. package/lib/types/types/const/const.d.ts +1 -1
  33. package/lib/types/types/interfaces/i-document-data.d.ts +98 -8
  34. package/lib/umd/facade.js +1 -1
  35. package/lib/umd/index.js +11 -10
  36. package/package.json +7 -8
@@ -23,5 +23,4 @@ export interface IAddDrawingParam {
23
23
  drawings: any[];
24
24
  }
25
25
  export declare function getCustomBlockIdsInSelections(body: IDocumentBody, selections: ITextRange[]): string[];
26
- export declare function getRichTextEditPath(docDataModel: DocumentDataModel, segmentId?: string): string[];
27
26
  export declare const addDrawing: (param: IAddDrawingParam) => false | JSONXActions;
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICustomDecoration, IDocumentBlockRange, IDocumentBody, ITextRun } from '../../../types/interfaces/i-document-data';
16
+ import type { ICustomColumnGroup, ICustomDecoration, IDocumentBlockRange, IDocumentBody, ITextRun } from '../../../types/interfaces/i-document-data';
17
+ import type { DocumentDataModel } from '../../data-model';
17
18
  import type { IRetainAction } from './action-types';
18
19
  import { UpdateDocsAttributeType } from '../../../shared/command-enum';
19
20
  export declare enum SliceBodyType {
@@ -27,8 +28,10 @@ export declare function getTableSlice(body: IDocumentBody, startOffset: number,
27
28
  tableId: string;
28
29
  }[];
29
30
  export declare function getBlockRangeSlice(body: IDocumentBody, startOffset: number, endOffset: number): IDocumentBlockRange[];
31
+ export declare function getColumnGroupSlice(body: IDocumentBody, startOffset: number, endOffset: number): ICustomColumnGroup[];
30
32
  export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number, type?: SliceBodyType): {
31
33
  startIndex: number;
34
+ paragraphId: string;
32
35
  paragraphStyle?: import("../../..").IParagraphStyle;
33
36
  bullet?: import("../../..").IBullet;
34
37
  }[] | undefined;
@@ -89,3 +92,4 @@ export declare function getCustomRangeSlice(body: IDocumentBody, startOffset: nu
89
92
  export declare function getCustomDecorationSlice(body: IDocumentBody, startOffset: number, endOffset: number): ICustomDecoration[] | undefined;
90
93
  export declare function composeBody(thisBody: IDocumentBody, otherBody: IDocumentBody, coverType?: UpdateDocsAttributeType): IDocumentBody;
91
94
  export declare function isUselessRetainAction(action: IRetainAction): boolean;
95
+ export declare function getRichTextEditPath(docDataModel: DocumentDataModel, segmentId?: string): string[];
@@ -19,6 +19,8 @@ export declare enum DataStreamTreeNodeType {
19
19
  TABLE = "TABLE",
20
20
  TABLE_ROW = "TABLE_ROW",
21
21
  TABLE_CELL = "TABLE_CELL",
22
+ COLUMN_GROUP = "COLUMN_GROUP",
23
+ COLUMN = "COLUMN",
22
24
  BLOCK = "BLOCK",
23
25
  CUSTOM_BLOCK = "CUSTOM_BLOCK"
24
26
  }
@@ -31,6 +33,10 @@ export declare enum DataStreamTreeTokenType {
31
33
  TABLE_CELL_END = "\u001D",// table cell end
32
34
  TABLE_ROW_END = "\u000E",// table row end
33
35
  TABLE_END = "\u000F",// table end
36
+ COLUMN_GROUP_START = "\u0012",// column group start
37
+ COLUMN_START = "\u0013",// column start
38
+ COLUMN_END = "\u0014",// column end
39
+ COLUMN_GROUP_END = "\u0015",// column group end
34
40
  BLOCK_START = "\u0010",// block start
35
41
  BLOCK_END = "\u0011",// block end
36
42
  /**
@@ -0,0 +1,24 @@
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 type { IDocumentBody, IParagraph } from '../types/interfaces/i-document-data';
17
+ export declare const PARAGRAPH_ID_PREFIX = "para_";
18
+ export interface IParagraphIdScope {
19
+ unitId: string;
20
+ segmentId?: string;
21
+ }
22
+ export declare function createParagraphId(existingIds: Set<string>): string;
23
+ export declare function cloneBodyWithFreshParagraphIds(body: IDocumentBody, _scope: IParagraphIdScope): IDocumentBody;
24
+ export declare function cloneParagraphWithId(paragraph: IParagraph, existingIds: Set<string>, preserveId?: boolean): IParagraph;
@@ -144,6 +144,26 @@ export declare class FUniver extends Disposable {
144
144
  * ```
145
145
  */
146
146
  setLocale(locale: string): void;
147
+ /**
148
+ * Get the current locale.
149
+ * @returns {string} The current locale identifier.
150
+ * @example
151
+ * ```ts
152
+ * const currentLocale = univerAPI.getCurrentLocale();
153
+ * console.log(currentLocale);
154
+ * ```
155
+ */
156
+ getCurrentLocale(): string;
157
+ /**
158
+ * Get the locales for the current locale.
159
+ * @returns {ILanguagePack | undefined} The locales object for the current locale, it returns undefined if the locales is not loaded.
160
+ * @example
161
+ * ```ts
162
+ * const locales = univerAPI.getLocales();
163
+ * console.log(locales);
164
+ * ```
165
+ */
166
+ getLocales(): ILanguagePack | undefined;
147
167
  /**
148
168
  * Register a callback that will be triggered before invoking a command.
149
169
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeCommandExecute, (event) => {})` instead.
@@ -56,7 +56,7 @@ export declare class FUtil {
56
56
  *
57
57
  * @example
58
58
  * ```ts
59
- * const key = univerAPI.Util.tools.generateRandomId(6);
59
+ * const key = univerAPI.Util.tools.isDate();
60
60
  * console.log(key);
61
61
  * ```
62
62
  */
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export * from './bases';
16
17
  export { dedupe, dedupeBy, groupBy, makeArray, remove, rotate } from './common/array';
17
18
  export * from './common/async';
18
19
  export { isBooleanString } from './common/boolean';
@@ -33,7 +34,8 @@ export { mixinClass } from './common/mixin';
33
34
  export { isNumeric, isSafeNumeric, willLoseNumericPrecision } from './common/number';
34
35
  export { Registry, RegistryAsMap } from './common/registry';
35
36
  export { requestImmediateMacroTask } from './common/request-immediate-macro-task';
36
- export { type ISequenceExecuteResult, sequence, sequenceAsync } from './common/sequence';
37
+ export { sequence, sequenceAsync } from './common/sequence';
38
+ export type { ISequenceExecuteResult } from './common/sequence';
37
39
  export { mergeSets } from './common/set';
38
40
  export { UnitModel, UniverInstanceType } from './common/unit';
39
41
  export { isSafeUrl, normalizeUrl, resolveWithBasePath } from './common/url';
@@ -44,41 +46,50 @@ export { replaceInDocumentBody } from './docs/data-model/replacement';
44
46
  export { ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue, } from './docs/data-model/rich-text-builder';
45
47
  export { DEFAULT_DOCUMENT_SUB_COMPONENT_ID } from './docs/data-model/subdocument';
46
48
  export { ActionIterator } from './docs/data-model/text-x/action-iterator';
47
- export { type IDeleteAction, type IInsertAction, type IRetainAction, type TextXAction, TextXActionType, } from './docs/data-model/text-x/action-types';
48
- export { normalizeTextRuns } from './docs/data-model/text-x/apply-utils/common';
49
+ export { TextXActionType } from './docs/data-model/text-x/action-types';
50
+ export type { IDeleteAction, IInsertAction, IRetainAction, TextXAction } from './docs/data-model/text-x/action-types';
51
+ export { normalizeTextRuns, RESTORE_INSERTED_PARAGRAPH_IDS } from './docs/data-model/text-x/apply-utils/common';
49
52
  export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
50
53
  export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
51
54
  export { getPlainText } from './docs/data-model/text-x/build-utils/parse';
52
55
  export { TextX } from './docs/data-model/text-x/text-x';
53
56
  export type { TPriority } from './docs/data-model/text-x/text-x';
54
- export { composeBody, getBodySlice, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getParagraphsSlice, getSectionBreakSlice, getTableSlice, getTextRunSlice, normalizeBody, SliceBodyType, } from './docs/data-model/text-x/utils';
55
- export { EventState, EventSubject, fromEventSubject, type IEventObserver } from './observer/observable';
57
+ export { composeBody, getBodySlice, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getParagraphsSlice, getRichTextEditPath, getSectionBreakSlice, getTableSlice, getTextRunSlice, normalizeBody, SliceBodyType, } from './docs/data-model/text-x/utils';
58
+ export { cloneBodyWithFreshParagraphIds, cloneParagraphWithId, createParagraphId, PARAGRAPH_ID_PREFIX, } from './docs/paragraph-id';
59
+ export type { IParagraphIdScope } from './docs/paragraph-id';
60
+ export { EventState, EventSubject, fromEventSubject } from './observer/observable';
61
+ export type { IEventObserver } from './observer/observable';
56
62
  export { AuthzIoLocalService } from './services/authz-io/authz-io-local.service';
57
63
  export { IAuthzIoService } from './services/authz-io/type';
58
- export { COMMAND_LOG_EXECUTION_CONFIG_KEY, type CommandListener, CommandService, CommandType, type ICommand, type ICommandInfo, ICommandService, type IExecutionOptions, type IMultiCommand, type IMutation, type IMutationCommonParams, type IMutationInfo, type IOperation, type IOperationInfo, NilCommand, sequenceExecute, sequenceExecuteAsync, } from './services/command/command.service';
64
+ export { COMMAND_LOG_EXECUTION_CONFIG_KEY, CommandService, CommandType, ICommandService, NilCommand, sequenceExecute, sequenceExecuteAsync, } from './services/command/command.service';
65
+ export type { CommandListener, ICommand, ICommandInfo, IExecutionOptions, IMultiCommand, IMutation, IMutationCommonParams, IMutationInfo, IOperation, IOperationInfo, } from './services/command/command.service';
59
66
  export { IConfigService } from './services/config/config.service';
60
67
  export { ConfigService } from './services/config/config.service';
61
68
  export { IConfirmService, TestConfirmService } from './services/confirm/confirm.service';
62
69
  export * from './services/context/context';
63
70
  export { ContextService, IContextService } from './services/context/context.service';
64
- export { ErrorService, type IError } from './services/error/error.service';
71
+ export { ErrorService } from './services/error/error.service';
72
+ export type { IError } from './services/error/error.service';
65
73
  export { IImageIoService, ImageSourceType, ImageUploadStatusType } from './services/image-io/image-io.service';
66
74
  export type { IImageIoServiceParam } from './services/image-io/image-io.service';
67
75
  export { IURLImageService } from './services/image-io/url-image.service';
68
- export { type ICreateUnitOptions, IUniverInstanceService, UniverInstanceService } from './services/instance/instance.service';
76
+ export { IUniverInstanceService, UniverInstanceService } from './services/instance/instance.service';
77
+ export type { ICreateUnitOptions } from './services/instance/instance.service';
69
78
  export { LifecycleStages } from './services/lifecycle/lifecycle';
70
79
  export { LifecycleService, LifecycleUnreachableError } from './services/lifecycle/lifecycle.service';
71
80
  export { ILocalStorageService } from './services/local-storage/local-storage.service';
72
81
  export { LocaleService } from './services/locale/locale.service';
73
82
  export { DesktopLogService, ILogService, LogLevel } from './services/log/log.service';
74
83
  export { MentionIOLocalService } from './services/mention-io/mention-io-local.service';
75
- export { type IListMentionParam, type IListMentionResponse, IMentionIOService, type ITypeMentionList } from './services/mention-io/type';
84
+ export { IMentionIOService } from './services/mention-io/type';
85
+ export type { IListMentionParam, IListMentionResponse, ITypeMentionList } from './services/mention-io/type';
76
86
  export { PermissionService } from './services/permission/permission.service';
77
87
  export { IPermissionService, PermissionStatus } from './services/permission/type';
78
88
  export type { IPermissionParam } from './services/permission/type';
79
89
  export type { IPermissionPoint } from './services/permission/type';
80
90
  export type { IPermissionTypes, RangePermissionPointConstructor, WorkbookPermissionPointConstructor, WorkSheetPermissionPointConstructor, } from './services/permission/type';
81
- export { type DependencyOverride, mergeOverrideWithDependencies } from './services/plugin/plugin-override';
91
+ export { mergeOverrideWithDependencies } from './services/plugin/plugin-override';
92
+ export type { DependencyOverride } from './services/plugin/plugin-override';
82
93
  export type { PluginCtor } from './services/plugin/plugin.service';
83
94
  export { DependentOn, Plugin, PluginService } from './services/plugin/plugin.service';
84
95
  export { IResourceLoaderService } from './services/resource-loader/type';
@@ -86,17 +97,21 @@ export { ResourceManagerService } from './services/resource-manager/resource-man
86
97
  export type { IResourceHook, IResources } from './services/resource-manager/type';
87
98
  export { IResourceManagerService } from './services/resource-manager/type';
88
99
  export { ThemeService } from './services/theme/theme.service';
89
- export { type IUndoRedoCommandInfos, type IUndoRedoCommandInfosByInterceptor, type IUndoRedoItem, IUndoRedoService, type IUndoRedoStatus, LocalUndoRedoService, RedoCommand, RedoCommandId, UndoCommand, UndoCommandId, } from './services/undoredo/undoredo.service';
100
+ export { IUndoRedoService, LocalUndoRedoService, RedoCommand, RedoCommandId, UndoCommand, UndoCommandId, } from './services/undoredo/undoredo.service';
101
+ export type { IUndoRedoCommandInfos, IUndoRedoCommandInfosByInterceptor, IUndoRedoItem, IUndoRedoStatus, } from './services/undoredo/undoredo.service';
90
102
  export { createDefaultUser } from './services/user-manager/const';
91
- export { type IUser, UserManagerService } from './services/user-manager/user-manager.service';
103
+ export { UserManagerService } from './services/user-manager/user-manager.service';
104
+ export type { IUser } from './services/user-manager/user-manager.service';
92
105
  export * from './shared';
93
106
  export { ImageCacheMap } from './shared/cache/image-cache';
94
107
  export { isBlackColor, isWhiteColor } from './shared/color/color-kit';
95
108
  export { cellToRange } from './shared/common';
96
109
  export { customNameCharacterCheck, nameCharacterCheck } from './shared/name';
97
- export { type BBox, type IRTreeItem, RBush, RTree } from './shared/r-tree';
110
+ export { RBush, RTree } from './shared/r-tree';
111
+ export type { BBox, IRTreeItem } from './shared/r-tree';
112
+ export { generateRandomId } from './shared/random-id';
98
113
  export { getIntersectRange } from './shared/range';
99
- export { afterTime, bufferDebounceTime, convertObservableToBehaviorSubject, fromCallback, takeAfter } from './shared/rxjs';
114
+ export { afterTime, bufferDebounceTime, convertObservableToBehaviorSubject, fromCallback, takeAfter, } from './shared/rxjs';
100
115
  export { awaitTime, delayAnimationFrame } from './shared/timer';
101
116
  export { isNodeEnv } from './shared/tools';
102
117
  export * from './sheets/clone';
@@ -108,7 +123,7 @@ export { DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEF
108
123
  export { Styles } from './sheets/styles';
109
124
  export * from './sheets/typedef';
110
125
  export type { IPosition } from './sheets/typedef';
111
- export { addLinkToDocumentModel, getEmptyCell, isNotNullOrUndefined, isRangesEqual, isUnitRangesEqual } from './sheets/util';
126
+ export { addLinkToDocumentModel, getEmptyCell, isNotNullOrUndefined, isRangesEqual, isUnitRangesEqual, } from './sheets/util';
112
127
  export { createDocumentModelWithStyle } from './sheets/util';
113
128
  export { SheetViewModel } from './sheets/view-model';
114
129
  export { getWorksheetUID, Workbook } from './sheets/workbook';
@@ -126,4 +141,5 @@ export { DataValidationType } from './types/enum/data-validation-type';
126
141
  export * from './types/interfaces';
127
142
  export type { ICellCustomRender, ICellRenderContext } from './types/interfaces/i-cell-custom-render';
128
143
  export type { IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleInfo, IDataValidationRuleOptions, ISheetDataValidationRule, } from './types/interfaces/i-data-validation';
129
- export { type IUniverConfig, Univer } from './univer';
144
+ export { Univer } from './univer';
145
+ export type { IUniverConfig } from './univer';
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IDisposable } from '../../common/di';
17
- import type { Nullable } from '../../shared/types';
18
17
  import { Observable } from 'rxjs';
19
18
  /**
20
19
  * IConfig provides universal configuration for the whole application.
@@ -34,7 +33,7 @@ interface IConfigOptions {
34
33
  merge?: boolean;
35
34
  }
36
35
  export interface IConfigService {
37
- getConfig<T>(id: string | symbol): Nullable<T>;
36
+ getConfig<T>(id: string | symbol): T;
38
37
  setConfig(id: string | symbol, value: unknown, options?: IConfigOptions): void;
39
38
  deleteConfig(id: string): boolean;
40
39
  subscribeConfigValue$<T = unknown>(key: string): Observable<T>;
@@ -46,7 +45,7 @@ export declare class ConfigService implements IConfigService, IDisposable {
46
45
  }>;
47
46
  private readonly _config;
48
47
  dispose(): void;
49
- getConfig<T>(id: string | symbol): Nullable<T>;
48
+ getConfig<T>(id: string | symbol): T;
50
49
  setConfig(id: string, value: unknown, options?: IConfigOptions): void;
51
50
  deleteConfig(id: string | symbol): boolean;
52
51
  subscribeConfigValue$<T = unknown>(key: string): Observable<T>;
@@ -60,7 +60,7 @@ export declare class LocaleService extends Disposable {
60
60
  * }
61
61
  * t('foo.bar', 'World') => 'Hello World'
62
62
  */
63
- t: (key: string, ...args: string[]) => string;
63
+ t: <TKey extends string = string>(key: TKey, ...args: string[]) => string;
64
64
  setLocale(locale: LocaleType): void;
65
65
  getLocales(): ILanguagePack | undefined;
66
66
  getCurrentLocale(): LocaleType;
@@ -13,6 +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 { IResources } from '../resource-manager/type';
16
17
  import type { IResourceLoaderService } from './type';
17
18
  import { Disposable } from '../../shared/lifecycle';
18
19
  import { IUniverInstanceService } from '../instance/instance.service';
@@ -23,6 +24,6 @@ export declare class ResourceLoaderService extends Disposable implements IResour
23
24
  constructor(_resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService);
24
25
  private _init;
25
26
  saveUnit<T = object>(unitId: string): ({
26
- resources: import("../..").IResources;
27
+ resources: IResources;
27
28
  } & T) | null;
28
29
  }
@@ -26,10 +26,7 @@ export declare class ResourceManagerService extends Disposable implements IResou
26
26
  getAllResourceHooks(): IResourceHook<any>[];
27
27
  getResources(unitId: string): IResources;
28
28
  getResources(unitId: string, type: UniverInstanceType): IResources;
29
- getResourcesByType(unitId: string, type: UniverInstanceType): {
30
- name: `SHEET_${string}_PLUGIN` | `DOC_${string}_PLUGIN`;
31
- data: string;
32
- }[];
29
+ getResourcesByType(unitId: string, type: UniverInstanceType): IResources;
33
30
  registerPluginResource<T = unknown>(hook: IResourceHook<T>): import("@wendellhu/redi").IDisposable;
34
31
  disposePluginResource(pluginName: IResourceName): void;
35
32
  loadResources(unitId: string, resources?: IResources): void;
@@ -21,7 +21,7 @@ export type IResources = Array<{
21
21
  name: string;
22
22
  data: string;
23
23
  }>;
24
- type IBusinessName = 'SHEET' | 'DOC';
24
+ type IBusinessName = 'SHEET' | 'DOC' | 'SLIDE';
25
25
  export type IResourceName = `${IBusinessName}_${string}_PLUGIN`;
26
26
  export interface IResourceHook<T = any> {
27
27
  pluginName: IResourceName;
@@ -55,7 +55,7 @@ export declare class ThemeService extends Disposable {
55
55
  /**
56
56
  * Get a color from the current theme.
57
57
  * @param {string} color - The color key to retrieve.
58
- * @returns {string} The color value from the current theme.
58
+ * @returns The value from the current theme.
59
59
  */
60
- getColorFromTheme(color: string): string;
60
+ getColorFromTheme<T = string>(color: string): T;
61
61
  }
@@ -35,6 +35,7 @@ export type { INumfmtLocaleTag } from './numfmt';
35
35
  export { currencySymbols, DEFAULT_NUMBER_FORMAT, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, getNumfmtParseValueFilter, isDefaultFormat, isPatternEqualWithoutDecimal, isTextFormat, numfmt, } from './numfmt';
36
36
  export * from './object-matrix';
37
37
  export { queryObjectMatrix } from './object-matrix-query';
38
+ export * from './random-id';
38
39
  export { moveRangeByOffset, splitIntoGrid } from './range';
39
40
  export * from './rectangle';
40
41
  export { RefAlias } from './ref-alias';
@@ -20,6 +20,9 @@ export interface ILanguagePack {
20
20
  export interface ILocales {
21
21
  [key: string]: ILanguagePack;
22
22
  }
23
+ export type LocaleLeafKeys<T> = {
24
+ [K in keyof T & string]: T[K] extends string ? K : T[K] extends readonly unknown[] ? never : T[K] extends Record<string, unknown> ? `${K}.${LocaleLeafKeys<T[K]>}` : never;
25
+ }[keyof T & string];
23
26
  type MergeLocalesInput = Record<string, any>;
24
27
  /**
25
28
  * Merges multiple locale objects into a single locale object.
@@ -13,4 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export {};
16
+ export declare function createRandomId(size?: number, alphabet?: string): string;
17
+ export declare function generateRandomId(n?: number, alphabet?: string): string;
@@ -78,7 +78,6 @@ export declare class Tools {
78
78
  static clamp(value: number, min: number, max: number): number;
79
79
  static now(): number;
80
80
  }
81
- export declare function generateRandomId(n?: number, alphabet?: string): string;
82
81
  /**
83
82
  * compose styles by priority, the latter will overwrite the former
84
83
  * @param { Nullable<IStyleData>[]} styles the styles to be composed
@@ -67,7 +67,10 @@ export interface IWorkbookData {
67
67
  */
68
68
  resources?: IResources;
69
69
  /**
70
- * User stored custom fields
70
+ * User stored custom fields.
71
+ *
72
+ * @remarks
73
+ * This field is not recommended for external use. Use it at your own risk.
71
74
  */
72
75
  custom?: CustomData;
73
76
  }
@@ -127,7 +130,10 @@ export interface IWorksheetData {
127
130
  gridlinesColor?: string;
128
131
  rightToLeft: BooleanNumber;
129
132
  /**
130
- * User stored custom fields
133
+ * User stored custom fields.
134
+ *
135
+ * @remarks
136
+ * This field is not recommended for external use. Use it at your own risk.
131
137
  */
132
138
  custom?: CustomData;
133
139
  }
@@ -157,7 +163,10 @@ export interface IRowData {
157
163
  */
158
164
  s?: Nullable<IStyleData | string>;
159
165
  /**
160
- * User stored custom fields
166
+ * User stored custom fields.
167
+ *
168
+ * @remarks
169
+ * This field is not recommended for external use. Use it at your own risk.
161
170
  */
162
171
  custom?: CustomData;
163
172
  }
@@ -182,7 +191,10 @@ export interface IColumnData {
182
191
  */
183
192
  s?: Nullable<IStyleData | string>;
184
193
  /**
185
- * User stored custom fields
194
+ * User stored custom fields.
195
+ *
196
+ * @remarks
197
+ * This field is not recommended for external use. Use it at your own risk.
186
198
  */
187
199
  custom?: CustomData;
188
200
  }
@@ -229,7 +241,10 @@ export interface ICellData {
229
241
  */
230
242
  si?: Nullable<string>;
231
243
  /**
232
- * User stored custom fields
244
+ * User stored custom fields.
245
+ *
246
+ * @remarks
247
+ * This field is not recommended for external use. Use it at your own risk.
233
248
  */
234
249
  custom?: CustomData;
235
250
  }
@@ -446,33 +461,6 @@ export interface IRangeCellData {
446
461
  * Allow users to provide one of three formats, we need to convert to IRange to store
447
462
  */
448
463
  export type IRangeType = IRange | IRangeStringData | IRangeArrayData | IRangeCellData;
449
- /**
450
- * Whether to clear only the contents. Whether to clear only the format; note that clearing format also clears data validation rules.
451
- */
452
- export interface IOptionData {
453
- /**
454
- * 1. designates that only the format should be copied
455
- *
456
- * 2. Whether to clear only the format; note that clearing format also clears data validation rules.
457
- *
458
- * 3. worksheet Whether to clear the format.
459
- */
460
- formatOnly?: boolean;
461
- /**
462
- * 1. designates that only the content should be copied
463
- *
464
- * 2. Whether to clear only the contents.
465
- *
466
- * 3. worksheet Whether to clear the content.
467
- *
468
- */
469
- contentsOnly?: boolean;
470
- }
471
- /**
472
- * Option of copyTo function
473
- */
474
- export interface ICopyToOptionsData extends IOptionData {
475
- }
476
464
  export interface IRectLTRB {
477
465
  left: number;
478
466
  top: number;
@@ -159,7 +159,7 @@ export declare const SHEET_EDITOR_UNITS: string[];
159
159
  export declare const NAMED_STYLE_MAP: Record<NamedStyleType, Nullable<ITextStyle>>;
160
160
  export declare const DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING = 1.5;
161
161
  export declare const DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE = 0;
162
- export declare const DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW = 8;
162
+ export declare const DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW = 12;
163
163
  export declare const NAMED_STYLE_SPACE_MAP: Record<NamedStyleType, Nullable<IParagraphStyle>>;
164
164
  export declare const PRINT_CHART_COMPONENT_KEY = "univer-sheets-chart-print-chart";
165
165
  export declare const DOC_DRAWING_PRINTING_COMPONENT_KEY = "univer-docs-drawing-printing";