@univerjs/core 0.2.8 → 0.2.9
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 +8 -8
- package/lib/es/index.js +205 -212
- package/lib/types/common/equal.d.ts +15 -3
- package/lib/types/common/interceptor.d.ts +1 -1
- package/lib/types/{types/interfaces/i-freeze.d.ts → common/mixin.d.ts} +9 -5
- package/lib/types/common/unit.d.ts +2 -1
- package/lib/types/docs/data-model/document-data-model.d.ts +2 -3
- package/lib/types/index.d.ts +5 -2
- package/lib/types/services/lifecycle/lifecycle.d.ts +5 -0
- package/lib/types/services/permission/type.d.ts +2 -2
- package/lib/types/services/resource-loader/resource-loader.service.d.ts +3 -5
- package/lib/types/services/resource-loader/type.d.ts +4 -6
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -4
- package/lib/types/services/resource-manager/type.d.ts +9 -5
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +1 -1
- package/lib/types/services/snapshot/snapshot-transform.d.ts +1 -1
- package/lib/types/services/snapshot/snapshot-utils.d.ts +1 -3
- package/lib/types/services/undoredo/undoredo.service.d.ts +1 -1
- package/lib/types/shared/check-if-move.d.ts +1 -1
- package/lib/types/shared/color/color.d.ts +1 -1
- package/lib/types/shared/common.d.ts +2 -4
- package/lib/types/shared/object-matrix-query.d.ts +1 -1
- package/lib/types/shared/object-matrix.d.ts +1 -1
- package/lib/types/shared/range.d.ts +1 -1
- package/lib/types/shared/rectangle.d.ts +1 -1
- package/lib/types/shared/tools.d.ts +1 -2
- package/lib/types/shared/types.d.ts +4 -13
- package/lib/types/{types/interfaces/i-service-data.d.ts → sheets/__tests__/cell-data.spec.d.ts} +1 -2
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +1 -1
- package/lib/types/sheets/column-manager.d.ts +2 -2
- package/lib/types/sheets/empty-snapshot.d.ts +1 -1
- package/lib/types/sheets/range.d.ts +2 -1
- package/lib/types/sheets/row-manager.d.ts +1 -1
- package/lib/types/sheets/sheet-snapshot-utils.d.ts +1 -1
- package/lib/types/sheets/styles.d.ts +2 -1
- package/lib/types/sheets/typedef.d.ts +451 -0
- package/lib/types/sheets/util.d.ts +3 -0
- package/lib/types/sheets/view-model.d.ts +2 -2
- package/lib/types/sheets/workbook.d.ts +13 -4
- package/lib/types/sheets/worksheet.d.ts +11 -1
- package/lib/types/slides/slide-model.d.ts +0 -1
- package/lib/types/types/enum/locale-type.d.ts +3 -1
- package/lib/types/types/enum/text-style.d.ts +1 -1
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +2 -2
- package/lib/types/types/interfaces/i-data-validation.d.ts +1 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +2 -4
- package/lib/types/types/interfaces/i-slide-data.d.ts +5 -3
- package/lib/types/types/interfaces/index.d.ts +0 -11
- package/lib/types/univer.d.ts +14 -2
- package/lib/umd/index.js +8 -8
- package/package.json +4 -4
- package/lib/types/common/type-util.d.ts +0 -16
- package/lib/types/common/type-utils.d.ts +0 -16
- package/lib/types/types/interfaces/i-cell-data.d.ts +0 -66
- package/lib/types/types/interfaces/i-column-data.d.ts +0 -14
- package/lib/types/types/interfaces/i-extra-model-data.d.ts +0 -27
- package/lib/types/types/interfaces/i-range.d.ts +0 -208
- package/lib/types/types/interfaces/i-row-data.d.ts +0 -26
- package/lib/types/types/interfaces/i-selection-data.d.ts +0 -58
- package/lib/types/types/interfaces/i-univer-data.d.ts +0 -13
- package/lib/types/types/interfaces/i-workbook-data.d.ts +0 -39
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +0 -54
- package/lib/types/types/interfaces/i-worksheet-order-data.d.ts +0 -17
- /package/lib/types/{types/interfaces/__tests__/i-cell-data.spec.d.ts → services/__tests__/resources.spec.d.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IRange, IUnitRange } from '../types/interfaces';
|
|
2
1
|
/**
|
|
3
2
|
* Copyright 2023-present DreamNum Inc.
|
|
4
3
|
*
|
|
@@ -14,6 +13,19 @@ import { IRange, IUnitRange } from '../types/interfaces';
|
|
|
14
13
|
* See the License for the specific language governing permissions and
|
|
15
14
|
* limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Copyright 2023-present DreamNum Inc.
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License.
|
|
21
|
+
* You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
19
31
|
export declare function shallowEqual(objA: any, objB: any): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nullable } from '
|
|
1
|
+
import { Nullable } from '../shared/types';
|
|
2
2
|
export type InterceptorHandler<M = unknown, C = unknown> = (value: Nullable<M>, context: C, next: (value: Nullable<M>) => Nullable<M>) => Nullable<M>;
|
|
3
3
|
export interface IInterceptor<M, C> {
|
|
4
4
|
priority?: number;
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ySplit: number;
|
|
19
|
-
startRow: number;
|
|
20
|
-
startColumn: number;
|
|
16
|
+
interface IMixinProperty<T> {
|
|
17
|
+
[fnName: string]: (this: T, ...args: any[]) => any;
|
|
21
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Mixin some methods to targetObject as prototype, the static methods will not be mixed in
|
|
21
|
+
* @param {T} targetClassPrototype The target class to mixin
|
|
22
|
+
* @param {IMixinProperty<T>} mixin The mixin object which contains the methods to mixin.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mixinClass<T>(targetClassPrototype: T, mixin: IMixinProperty<T>): void;
|
|
25
|
+
export {};
|
|
@@ -3,9 +3,10 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { Disposable } from '../shared';
|
|
4
4
|
export { UniverType as UniverInstanceType } from '@univerjs/protocol';
|
|
5
5
|
export type UnitType = UniverType | number;
|
|
6
|
-
export declare abstract class UnitModel<
|
|
6
|
+
export declare abstract class UnitModel<D = object, T extends UnitType = UnitType> extends Disposable {
|
|
7
7
|
abstract readonly type: T;
|
|
8
8
|
abstract getUnitId(): string;
|
|
9
9
|
abstract name$: Observable<string>;
|
|
10
10
|
abstract setName(name: string): void;
|
|
11
|
+
abstract getSnapshot(): D;
|
|
11
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
2
|
import { Nullable } from '../../shared';
|
|
3
|
-
import { IDocumentBody, IDocumentData, IDocumentRenderConfig, IDocumentStyle, IDrawings } from '../../types/interfaces/i-document-data';
|
|
3
|
+
import { IDocumentBody, IDocumentData, IDocumentRenderConfig, IDocumentStyle, IDrawings, IListData } from '../../types/interfaces/i-document-data';
|
|
4
4
|
import { IPaddingData } from '../../types/interfaces/i-style-data';
|
|
5
5
|
import { UnitModel, UniverInstanceType } from '../../common/unit';
|
|
6
6
|
import { SliceBodyType } from './text-x/utils';
|
|
@@ -29,9 +29,8 @@ declare class DocumentDataModelSimple extends UnitModel<IDocumentData, UniverIns
|
|
|
29
29
|
get zoomRatio(): number;
|
|
30
30
|
resetDrawing(drawings: IDrawings, drawingsOrder: string[]): void;
|
|
31
31
|
getBody(): IDocumentBody | undefined;
|
|
32
|
-
getShouldRenderLoopImmediately(): boolean;
|
|
33
|
-
getContainer(): string | undefined;
|
|
34
32
|
getSnapshot(): IDocumentData;
|
|
33
|
+
getBulletPresetList(): Record<string, IListData>;
|
|
35
34
|
updateDocumentId(unitId: string): void;
|
|
36
35
|
updateDocumentRenderConfig(config: IDocumentRenderConfig): void;
|
|
37
36
|
updateDocumentStyle(config: IDocumentStyle): void;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { type UnitType, UnitModel, UniverInstanceType } from './common/unit';
|
|
|
19
19
|
export { Registry, RegistryAsMap } from './common/registry';
|
|
20
20
|
export { CustomCommandExecutionError } from './common/error';
|
|
21
21
|
export { Univer } from './univer';
|
|
22
|
-
export { shallowEqual
|
|
22
|
+
export { shallowEqual } from './common/equal';
|
|
23
23
|
export { isNumeric, isSafeNumeric } from './common/number';
|
|
24
24
|
export { isBooleanString } from './common/boolean';
|
|
25
25
|
export { dedupe, remove, rotate, groupBy, makeArray } from './common/array';
|
|
@@ -76,10 +76,12 @@ export * from './types/interfaces';
|
|
|
76
76
|
export { UniverInstanceService } from './services/instance/instance.service';
|
|
77
77
|
export { LifecycleInitializerService } from './services/lifecycle/lifecycle.service';
|
|
78
78
|
export { ConfigService } from './services/config/config.service';
|
|
79
|
+
export { isRangesEqual, isUnitRangesEqual } from './sheets/util';
|
|
79
80
|
export { Range } from './sheets/range';
|
|
80
81
|
export { Styles } from './sheets/styles';
|
|
81
82
|
export { DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, mergeWorksheetSnapshotWithDefault, } from './sheets/sheet-snapshot-utils';
|
|
82
83
|
export { SheetViewModel } from './sheets/view-model';
|
|
84
|
+
export * from './sheets/typedef';
|
|
83
85
|
export { getWorksheetUID, Workbook } from './sheets/workbook';
|
|
84
86
|
export { Worksheet, extractPureTextFromCell } from './sheets/worksheet';
|
|
85
87
|
export { SlideDataModel } from './slides/slide-model';
|
|
@@ -102,7 +104,7 @@ export { DataValidationImeMode } from './types/enum/data-validation-ime-mode';
|
|
|
102
104
|
export { DataValidationOperator } from './types/enum/data-validation-operator';
|
|
103
105
|
export { DataValidationType } from './types/enum/data-validation-type';
|
|
104
106
|
export { DataValidationStatus } from './types/enum/data-validation-status';
|
|
105
|
-
export type { IPermissionTypes, WorkbookPermissionPointConstructor } from './services/permission/type';
|
|
107
|
+
export type { IPermissionTypes, WorkbookPermissionPointConstructor, WorkSheetPermissionPointConstructor, RangePermissionPointConstructor } from './services/permission/type';
|
|
106
108
|
export { PermissionService } from './services/permission/permission.service';
|
|
107
109
|
export { AuthzIoLocalService } from './services/authz-io/authz-io-local.service';
|
|
108
110
|
export { IAuthzIoService } from './services/authz-io/type';
|
|
@@ -112,4 +114,5 @@ export { normalizeBody, getCustomRangeSlice, getCustomDecorationSlice } from './
|
|
|
112
114
|
export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
|
|
113
115
|
export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
|
|
114
116
|
export { nameCharacterCheck } from './shared/name';
|
|
117
|
+
export { mixinClass } from './common/mixin';
|
|
115
118
|
export * from './common/di';
|
|
@@ -35,6 +35,8 @@ export declare const LifecycleToModules: Map<LifecycleStages, DependencyIdentifi
|
|
|
35
35
|
* @param identifier The dependency identifier of the class. Usually, it is the class itself unless you bind this class
|
|
36
36
|
* with another injection identifier.
|
|
37
37
|
*
|
|
38
|
+
* @deprecated This API does not work as expected and will be removed in future versions. Please call
|
|
39
|
+
* `this._injector.get(YourDependency)` in plugins' lifecycle hooks instead.
|
|
38
40
|
*
|
|
39
41
|
* @example
|
|
40
42
|
* // Ignore the `\` below. This is JSDoc's bug.
|
|
@@ -56,6 +58,9 @@ export declare function OnLifecycle(lifecycleStage: LifecycleStages, identifier:
|
|
|
56
58
|
* @param identifier The dependencies' identifier. **Beware** that if the dependency (e.g. a class) is bound to an
|
|
57
59
|
* identifier, you should register the identifier instead of the dependency itself.
|
|
58
60
|
*
|
|
61
|
+
* @deprecated This API does not work as expected and will be removed in future versions. Please call
|
|
62
|
+
* `this._injector.get(YourDependency)` in plugins' lifecycle hooks instead.
|
|
63
|
+
*
|
|
59
64
|
* @example
|
|
60
65
|
* runOnLifecycle(LifecycleStages.Ready, MyService);
|
|
61
66
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
2
2
|
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { IRange } from '../../sheets/typedef';
|
|
4
|
+
import { Nullable } from '../../shared/types';
|
|
5
5
|
export declare enum PermissionStatus {
|
|
6
6
|
INIT = "init",
|
|
7
7
|
FETCHING = "fetching",
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { Workbook } from '../../sheets/workbook';
|
|
2
|
-
import { IWorkbookData } from '../../types/interfaces';
|
|
3
1
|
import { IResourceManagerService } from '../resource-manager/type';
|
|
4
2
|
import { IUniverInstanceService } from '../instance/instance.service';
|
|
5
3
|
import { Disposable } from '../../shared/lifecycle';
|
|
6
|
-
import { DocumentDataModel } from '../../docs';
|
|
7
4
|
import { IResourceLoaderService } from './type';
|
|
8
5
|
export declare class ResourceLoaderService extends Disposable implements IResourceLoaderService {
|
|
9
6
|
private readonly _resourceManagerService;
|
|
10
7
|
private readonly _univerInstanceService;
|
|
11
8
|
constructor(_resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService);
|
|
12
9
|
private _init;
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
saveUnit<T = object>(unitId: string): ({
|
|
11
|
+
resources: import('../resource-manager/type').IResources;
|
|
12
|
+
} & T) | null;
|
|
15
13
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
|
|
3
|
-
import { IDocumentData } from '../../types/interfaces';
|
|
4
|
-
import { DocumentDataModel } from '../../docs';
|
|
1
|
+
import { IResources } from '../resource-manager/type';
|
|
5
2
|
export interface IResourceLoaderService {
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
saveUnit<T = object>(unitId: string): T & {
|
|
4
|
+
resources: IResources;
|
|
5
|
+
} | null;
|
|
8
6
|
}
|
|
9
7
|
export declare const IResourceLoaderService: import('../../common/di').IdentifierDecorator<IResourceLoaderService>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Disposable } from '../../shared/lifecycle';
|
|
2
|
-
import { Resources } from '../../types/interfaces/i-workbook-data';
|
|
3
2
|
import { UniverInstanceType } from '../../common/unit';
|
|
3
|
+
import { IResources } from '../resource-manager/type';
|
|
4
4
|
import { IResourceHook, IResourceManagerService, IResourceName } from './type';
|
|
5
5
|
export declare class ResourceManagerService extends Disposable implements IResourceManagerService {
|
|
6
6
|
private _resourceMap;
|
|
7
7
|
private _register$;
|
|
8
8
|
register$: import('rxjs').Observable<IResourceHook<any>>;
|
|
9
9
|
getAllResourceHooks(): IResourceHook<any>[];
|
|
10
|
-
getResources(unitId: string):
|
|
11
|
-
getResources(unitId: string, type: UniverInstanceType):
|
|
10
|
+
getResources(unitId: string): IResources;
|
|
11
|
+
getResources(unitId: string, type: UniverInstanceType): IResources;
|
|
12
12
|
getResourcesByType(unitId: string, type: UniverInstanceType): {
|
|
13
13
|
name: `SHEET_${string}_PLUGIN` | `DOC_${string}_PLUGIN`;
|
|
14
14
|
data: string;
|
|
15
15
|
}[];
|
|
16
16
|
registerPluginResource<T = unknown>(hook: IResourceHook<T>): import('@wendellhu/redi').IDisposable;
|
|
17
17
|
disposePluginResource(pluginName: IResourceName): void;
|
|
18
|
-
loadResources(unitId: string, resources?:
|
|
18
|
+
loadResources(unitId: string, resources?: IResources): void;
|
|
19
19
|
unloadResources(unitId: string): void;
|
|
20
20
|
dispose(): void;
|
|
21
21
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
import { IDisposable } from '../../common/di';
|
|
4
|
-
|
|
4
|
+
export type IResources = Array<{
|
|
5
|
+
id?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
data: string;
|
|
8
|
+
}>;
|
|
5
9
|
type IBusinessName = 'SHEET' | 'DOC';
|
|
6
10
|
export type IResourceName = `${IBusinessName}_${string}_PLUGIN`;
|
|
7
11
|
export interface IResourceHook<T = any> {
|
|
@@ -20,10 +24,10 @@ export interface IResourceManagerService {
|
|
|
20
24
|
/**
|
|
21
25
|
* @deprecated You should get resource with type specified.
|
|
22
26
|
*/
|
|
23
|
-
getResources(unitId: string):
|
|
24
|
-
getResources(unitId: string, type: UniverInstanceType):
|
|
25
|
-
getResourcesByType: (unitId: string, type: UniverInstanceType) =>
|
|
26
|
-
loadResources: (unitId: string, resources?:
|
|
27
|
+
getResources(unitId: string): IResources;
|
|
28
|
+
getResources(unitId: string, type: UniverInstanceType): IResources;
|
|
29
|
+
getResourcesByType: (unitId: string, type: UniverInstanceType) => IResources;
|
|
30
|
+
loadResources: (unitId: string, resources?: IResources) => void;
|
|
27
31
|
unloadResources(unitId: string): void;
|
|
28
32
|
}
|
|
29
33
|
export declare const IResourceManagerService: import('@univerjs/core').IdentifierDecorator<IResourceManagerService>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISheetBlock, ISnapshot } from '@univerjs/protocol';
|
|
2
|
-
import { IWorkbookData } from '../../../types/interfaces/i-workbook-data';
|
|
3
2
|
import { ILogContext } from '../../log/context';
|
|
4
3
|
import { ISnapshotServerService } from '../snapshot-server.service';
|
|
4
|
+
import { IWorkbookData } from '../../../sheets/typedef';
|
|
5
5
|
export declare const testSnapshot: () => ISnapshot;
|
|
6
6
|
export declare const testSheetBlocks: () => ISheetBlock[];
|
|
7
7
|
export declare const testWorkbookData: () => IWorkbookData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISheetBlock, ISnapshot } from '@univerjs/protocol';
|
|
2
2
|
import { ILogContext } from '../log/context';
|
|
3
|
-
import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
|
|
4
3
|
import { IDocumentData } from '../../types/interfaces/i-document-data';
|
|
4
|
+
import { IWorkbookData } from '../../sheets/typedef';
|
|
5
5
|
import { ISnapshotServerService } from './snapshot-server.service';
|
|
6
6
|
export declare function generateTempDocumentSnapshot(_context: ILogContext, document: IDocumentData, unitID: string, rev: number): Promise<{
|
|
7
7
|
snapshot: ISnapshot;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ISheetBlock } from '@univerjs/protocol';
|
|
2
|
-
import { IWorksheetData } from '../../types/interfaces/i-worksheet-data';
|
|
3
|
-
import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
|
|
4
2
|
import { IDocumentData } from '../../types/interfaces/i-document-data';
|
|
5
|
-
import { ICellData } from '../../types/interfaces/i-cell-data';
|
|
6
3
|
import { IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
|
|
4
|
+
import { ICellData, IWorkbookData, IWorksheetData } from '../../sheets/typedef';
|
|
7
5
|
export declare const textEncoder: TextEncoder;
|
|
8
6
|
export declare const textDecoder: TextDecoder;
|
|
9
7
|
/**
|
|
@@ -4,7 +4,7 @@ import { Disposable } from '../../shared/lifecycle';
|
|
|
4
4
|
import { IMutationInfo, CommandType, ICommandService } from '../command/command.service';
|
|
5
5
|
import { IContextService } from '../context/context.service';
|
|
6
6
|
import { IUniverInstanceService } from '../instance/instance.service';
|
|
7
|
-
import { Nullable } from '../../
|
|
7
|
+
import { Nullable } from '../../shared/types';
|
|
8
8
|
export interface IUndoRedoItem {
|
|
9
9
|
/** unitID maps to unitId for UniverSheet / UniverDoc / UniverSlide */
|
|
10
10
|
unitID: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Nullable } from '../common/type-util';
|
|
2
1
|
import { ITransformState } from '../types/interfaces/i-document-data';
|
|
2
|
+
import { Nullable } from './types';
|
|
3
3
|
export declare const MOVE_BUFFER_VALUE = 2;
|
|
4
4
|
export declare const ROTATE_BUFFER_VALUE = 1;
|
|
5
5
|
export declare function checkIfMove(transform: Nullable<ITransformState>, previousTransform: Nullable<ITransformState>): boolean;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { IRange } from '../
|
|
2
|
-
import { ICellData, ICellDataForSheetInterceptor } from '../types/interfaces/i-cell-data';
|
|
1
|
+
import { ICellData, ICellDataForSheetInterceptor, IRange, IRangeWithCoord, ISelectionCell, ISelectionCellWithMergeInfo } from '../sheets/typedef';
|
|
3
2
|
import { IDocumentData } from '../types/interfaces/i-document-data';
|
|
4
|
-
import { IRangeWithCoord, ISelectionCell, ISelectionCellWithMergeInfo } from '../types/interfaces/i-selection-data';
|
|
5
3
|
import { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
|
|
6
4
|
import { Nullable } from './types';
|
|
7
5
|
export declare function makeCellToSelection(cellInfo: ISelectionCellWithMergeInfo): IRangeWithCoord;
|
|
@@ -28,7 +26,7 @@ export declare function isFormulaId(value: any): boolean;
|
|
|
28
26
|
*/
|
|
29
27
|
export declare function handleStyleToString(style: IStyleData, isCell?: boolean): string;
|
|
30
28
|
export declare function getBorderStyleType(type: string): number;
|
|
31
|
-
export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import('../types/interfaces').IDocumentBody | undefined;
|
|
29
|
+
export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import('../types/interfaces/i-document-data').IDocumentBody | undefined;
|
|
32
30
|
export declare function isValidRange(range: IRange): boolean;
|
|
33
31
|
/**
|
|
34
32
|
* Covert row/column to range object
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IRange } from '../
|
|
1
|
+
import { IRange } from '../sheets/typedef';
|
|
2
2
|
export declare function moveRangeByOffset(range: IRange, refOffsetX: number, refOffsetY: number, ignoreAbsolute?: boolean): IRange;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IKeyValue } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Universal tool library
|
|
4
4
|
*/
|
|
@@ -23,7 +23,6 @@ export declare class Tools {
|
|
|
23
23
|
static getValueType(value: any): string;
|
|
24
24
|
static isDefine<T>(value?: T | void): value is T;
|
|
25
25
|
static isBlank(value: any): boolean;
|
|
26
|
-
static isAssignableFrom<T>(object: any, clazz: Class<T>): object is T;
|
|
27
26
|
static isBoolean(value?: any): value is boolean;
|
|
28
27
|
static isPlainObject(value: any): value is object;
|
|
29
28
|
static isFunction(value?: any): value is boolean;
|
|
@@ -14,28 +14,19 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export type Nullable<T> = T | null | undefined | void;
|
|
17
|
-
/**
|
|
18
|
-
* wrap any
|
|
19
|
-
*/
|
|
20
|
-
export type NoNeedCheckedType = any;
|
|
21
|
-
/**
|
|
22
|
-
* Class type
|
|
23
|
-
*/
|
|
24
|
-
export interface Class<T> {
|
|
25
|
-
new (...param: any): T;
|
|
26
|
-
}
|
|
27
17
|
/**
|
|
28
18
|
* Key value object
|
|
29
19
|
*
|
|
30
|
-
* @
|
|
20
|
+
* @ignore
|
|
21
|
+
* @deprecated As it has
|
|
31
22
|
*/
|
|
32
23
|
export interface IKeyValue {
|
|
33
24
|
[key: string]: any;
|
|
34
25
|
}
|
|
35
26
|
/**
|
|
36
|
-
*
|
|
27
|
+
* @ignore
|
|
28
|
+
* @deprecated, use {@link Record} instead.
|
|
37
29
|
*/
|
|
38
30
|
export interface IKeyType<T> {
|
|
39
31
|
[key: string]: T;
|
|
40
32
|
}
|
|
41
|
-
export type AsyncFunction<T = void, R = void> = (value: T) => Promise<R>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Nullable } from '../common/type-util';
|
|
2
1
|
import { IObjectArrayPrimitiveType } from '../shared/object-matrix';
|
|
3
|
-
import {
|
|
2
|
+
import { Nullable } from '../shared/types';
|
|
3
|
+
import { IColumnData, IRange, IWorksheetData } from './typedef';
|
|
4
4
|
/**
|
|
5
5
|
* Manage configuration information of all columns, get column width, column length, set column width, etc.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IObjectMatrixPrimitiveType, Nullable, ObjectMatrix } from '../shared';
|
|
2
2
|
import { HorizontalAlign, VerticalAlign, BooleanNumber, FontItalic, FontWeight, WrapStrategy } from '../types/enum';
|
|
3
|
-
import { IBorderData,
|
|
3
|
+
import { IBorderData, IDocumentBody, IDocumentData, IStyleBase, IStyleData, ITextDecoration, ITextRotation } from '../types/interfaces';
|
|
4
4
|
import { Styles } from './styles';
|
|
5
|
+
import { ICellData, IRange } from './typedef';
|
|
5
6
|
import { Worksheet } from './worksheet';
|
|
6
7
|
/**
|
|
7
8
|
* getObjectValues options type
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IObjectArrayPrimitiveType } from '../shared/object-matrix';
|
|
2
2
|
import { Nullable } from '../shared/types';
|
|
3
|
-
import { IRange, IRowData, IWorksheetData } from '
|
|
3
|
+
import { IRange, IRowData, IWorksheetData } from './typedef';
|
|
4
4
|
import { SheetViewModel } from './view-model';
|
|
5
5
|
/**
|
|
6
6
|
* Manage configuration information of all rows, get row height, row length, set row height, etc.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IWorksheetData } from '
|
|
1
|
+
import { IWorksheetData } from './typedef';
|
|
2
2
|
export declare const DEFAULT_WORKSHEET_ROW_COUNT_KEY = "DEFAULT_WORKSHEET_ROW_COUNT";
|
|
3
3
|
export declare const DEFAULT_WORKSHEET_ROW_COUNT = 1000;
|
|
4
4
|
export declare const DEFAULT_WORKSHEET_COLUMN_COUNT_KEY = "DEFAULT_WORKSHEET_COLUMN_COUNT";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IKeyType, Nullable } from '../shared';
|
|
2
|
-
import {
|
|
2
|
+
import { IStyleData } from '../types/interfaces';
|
|
3
|
+
import { ICellDataForSheetInterceptor } from './typedef';
|
|
3
4
|
/**
|
|
4
5
|
* Styles in a workbook, cells locate styles based on style IDs
|
|
5
6
|
*
|