@univerjs/core 0.2.8 → 0.2.10
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 +7 -9
- package/lib/es/index.js +220 -688
- package/lib/types/common/equal.d.ts +15 -3
- package/lib/types/common/interceptor.d.ts +1 -1
- package/lib/types/{types/interfaces/i-extra-model-data.d.ts → common/mixin.d.ts} +9 -11
- 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 -9
- package/lib/types/services/authz-io/type.d.ts +2 -2
- package/lib/types/services/command/command.service.d.ts +111 -28
- 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/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/numfmt.d.ts +2 -1
- 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/numfmt.type.d.ts +227 -0
- package/lib/types/shared/types.d.ts +7 -13
- 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/const/const.d.ts +4 -0
- 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 +7 -9
- package/package.json +5 -5
- package/lib/types/common/type-util.d.ts +0 -16
- package/lib/types/common/type-utils.d.ts +0 -16
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +0 -22
- package/lib/types/services/snapshot/snapshot-server.service.d.ts +0 -42
- package/lib/types/services/snapshot/snapshot-transform.d.ts +0 -31
- package/lib/types/services/snapshot/snapshot-utils.d.ts +0 -19
- 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-freeze.d.ts +0 -21
- 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-service-data.d.ts +0 -17
- 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/services/{snapshot/__tests__/snapshot-transform.spec.d.ts → __tests__/resources.spec.d.ts} +0 -0
- /package/lib/types/{types/interfaces/__tests__/i-cell-data.spec.d.ts → sheets/__tests__/cell-data.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core library for Univer.",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
|
50
50
|
"rxjs": ">=7.0.0",
|
|
51
|
-
"@univerjs/core": "0.2.
|
|
51
|
+
"@univerjs/core": "0.2.10"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@types/lodash.mergewith": "^4.6.9",
|
|
55
|
-
"@univerjs/protocol": "0.1.39-alpha.
|
|
55
|
+
"@univerjs/protocol": "0.1.39-alpha.15",
|
|
56
56
|
"@wendellhu/redi": "0.16.1",
|
|
57
57
|
"lodash.mergewith": "^4.6.2",
|
|
58
58
|
"nanoid": "5.0.7",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"@types/numeral": "^2.0.5",
|
|
65
65
|
"rxjs": "^7.8.1",
|
|
66
66
|
"typescript": "^5.5.4",
|
|
67
|
-
"vite": "^5.4.
|
|
67
|
+
"vite": "^5.4.2",
|
|
68
68
|
"vitest": "^2.0.5",
|
|
69
|
-
"@univerjs/shared": "0.2.
|
|
69
|
+
"@univerjs/shared": "0.2.10"
|
|
70
70
|
},
|
|
71
71
|
"univerSpace": {
|
|
72
72
|
".": {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
export type Nullable<T> = T | null | undefined | void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
export type Nullable<T> = T | null | undefined | void;
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
import { ILogContext } from '../../log/context';
|
|
4
|
-
import { ISnapshotServerService } from '../snapshot-server.service';
|
|
5
|
-
export declare const testSnapshot: () => ISnapshot;
|
|
6
|
-
export declare const testSheetBlocks: () => ISheetBlock[];
|
|
7
|
-
export declare const testWorkbookData: () => IWorkbookData;
|
|
8
|
-
export declare class MockSnapshotServerService implements ISnapshotServerService {
|
|
9
|
-
/** Load snapshot from a database. */
|
|
10
|
-
getUnitOnRev(context: ILogContext, params: IGetUnitOnRevRequest): Promise<IGetUnitOnRevResponse>;
|
|
11
|
-
/** Load sheet block from a database. */
|
|
12
|
-
getSheetBlock(context: ILogContext, params: IGetSheetBlockRequest): Promise<IGetSheetBlockResponse>;
|
|
13
|
-
/** Fetch missing changeset */
|
|
14
|
-
fetchMissingChangesets(context: ILogContext, params: IFetchMissingChangesetsRequest): Promise<IFetchMissingChangesetsResponse>;
|
|
15
|
-
getResourcesRequest(context: ILogContext, params: IGetResourcesRequest): Promise<IGetResourcesResponse>;
|
|
16
|
-
/** Save snapshot to a database. */
|
|
17
|
-
saveSnapshot(context: ILogContext, params: ISaveSnapshotRequest): Promise<ISaveSnapshotResponse>;
|
|
18
|
-
/** Save sheet block to a database. */
|
|
19
|
-
saveSheetBlock(context: ILogContext, params: ISaveSheetBlockRequest): Promise<ISaveSheetBlockResponse>;
|
|
20
|
-
/** Save changeset to a database. */
|
|
21
|
-
saveChangeset(context: ILogContext, params: ISaveChangesetRequest): Promise<ISaveChangesetResponse>;
|
|
22
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse } from '@univerjs/protocol';
|
|
2
|
-
import { ILogContext } from '../log/context';
|
|
3
|
-
/**
|
|
4
|
-
* It provides implementations for server side controllers to load or save
|
|
5
|
-
* or load snapshots. This service should be implemented by the host environment.
|
|
6
|
-
* And it shouldn't contain any business logic.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ISnapshotServerService: import('../../common/di').IdentifierDecorator<ISnapshotServerService>;
|
|
9
|
-
export interface ISnapshotServerService {
|
|
10
|
-
/** Load snapshot from a database. */
|
|
11
|
-
getUnitOnRev: (context: ILogContext, params: IGetUnitOnRevRequest) => Promise<IGetUnitOnRevResponse>;
|
|
12
|
-
/** Load sheet block from a database. */
|
|
13
|
-
getSheetBlock: (context: ILogContext, params: IGetSheetBlockRequest) => Promise<IGetSheetBlockResponse>;
|
|
14
|
-
/** Fetch missing changeset */
|
|
15
|
-
fetchMissingChangesets: (context: ILogContext, params: IFetchMissingChangesetsRequest) => Promise<IFetchMissingChangesetsResponse>;
|
|
16
|
-
getResourcesRequest: (context: ILogContext, params: IGetResourcesRequest) => Promise<IGetResourcesResponse>;
|
|
17
|
-
/** Save snapshot to a database. */
|
|
18
|
-
saveSnapshot: (context: ILogContext, params: ISaveSnapshotRequest) => Promise<ISaveSnapshotResponse>;
|
|
19
|
-
/** Save sheet block to a database. */
|
|
20
|
-
saveSheetBlock: (context: ILogContext, params: ISaveSheetBlockRequest) => Promise<ISaveSheetBlockResponse>;
|
|
21
|
-
/** Save changeset to a database. */
|
|
22
|
-
saveChangeset: (context: ILogContext, params: ISaveChangesetRequest) => Promise<ISaveChangesetResponse>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The server needs to fully implement all interfaces, but when used by the client, use saveSheetBlock to cache the sheet block locally, and use getSheetBlock to obtain the sheet block.
|
|
26
|
-
*/
|
|
27
|
-
export declare class ClientSnapshotServerService implements ISnapshotServerService {
|
|
28
|
-
private _sheetBlockCache;
|
|
29
|
-
/** Load snapshot from a database. */
|
|
30
|
-
getUnitOnRev(context: ILogContext, params: IGetUnitOnRevRequest): Promise<IGetUnitOnRevResponse>;
|
|
31
|
-
/** Load sheet block from a database. */
|
|
32
|
-
getSheetBlock(context: ILogContext, params: IGetSheetBlockRequest): Promise<IGetSheetBlockResponse>;
|
|
33
|
-
/** Fetch missing changeset */
|
|
34
|
-
fetchMissingChangesets(context: ILogContext, params: IFetchMissingChangesetsRequest): Promise<IFetchMissingChangesetsResponse>;
|
|
35
|
-
getResourcesRequest(context: ILogContext, params: IGetResourcesRequest): Promise<IGetResourcesResponse>;
|
|
36
|
-
/** Save snapshot to a database. */
|
|
37
|
-
saveSnapshot(context: ILogContext, params: ISaveSnapshotRequest): Promise<ISaveSnapshotResponse>;
|
|
38
|
-
/** Save sheet block to a database. */
|
|
39
|
-
saveSheetBlock(context: ILogContext, params: ISaveSheetBlockRequest): Promise<ISaveSheetBlockResponse>;
|
|
40
|
-
/** Save changeset to a database. */
|
|
41
|
-
saveChangeset(context: ILogContext, params: ISaveChangesetRequest): Promise<ISaveChangesetResponse>;
|
|
42
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ISheetBlock, ISnapshot } from '@univerjs/protocol';
|
|
2
|
-
import { ILogContext } from '../log/context';
|
|
3
|
-
import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
|
|
4
|
-
import { IDocumentData } from '../../types/interfaces/i-document-data';
|
|
5
|
-
import { ISnapshotServerService } from './snapshot-server.service';
|
|
6
|
-
export declare function generateTempDocumentSnapshot(_context: ILogContext, document: IDocumentData, unitID: string, rev: number): Promise<{
|
|
7
|
-
snapshot: ISnapshot;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function generateTemporarySnap(context: ILogContext, workbook: IWorkbookData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
|
|
10
|
-
snapshotRes: ISnapshot;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function transformWorkbookDataToSnapshot(context: ILogContext, workbook: IWorkbookData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
|
|
13
|
-
snapshot: ISnapshot;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* Assemble a snapshot to a workbook.
|
|
17
|
-
* @param snapshot
|
|
18
|
-
* @param sheetBlocks
|
|
19
|
-
*/
|
|
20
|
-
export declare function transformSnapshotToWorkbookData(snapshot: ISnapshot, sheetBlocks: ISheetBlock[], _context?: ILogContext): IWorkbookData;
|
|
21
|
-
export declare function transformSnapshotToDocumentData(snapshot: ISnapshot): IDocumentData;
|
|
22
|
-
export declare function transformDocumentDataToSnapshot(context: ILogContext, document: IDocumentData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
|
|
23
|
-
snapshot: ISnapshot;
|
|
24
|
-
}>;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param snapshot
|
|
28
|
-
* @param snapshotService
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare function getSheetBlocksFromSnapshot(snapshot: ISnapshot, snapshotService: ISnapshotServerService): Promise<ISheetBlock[]>;
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
import { IDocumentData } from '../../types/interfaces/i-document-data';
|
|
5
|
-
import { ICellData } from '../../types/interfaces/i-cell-data';
|
|
6
|
-
import { IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
|
|
7
|
-
export declare const textEncoder: TextEncoder;
|
|
8
|
-
export declare const textDecoder: TextDecoder;
|
|
9
|
-
/**
|
|
10
|
-
* @param worksheet
|
|
11
|
-
*/
|
|
12
|
-
export declare function encodeWorksheetOtherMetas(worksheet: Partial<IWorksheetData>): Uint8Array;
|
|
13
|
-
export declare function encodeWorkbookOtherMetas(workbook: IWorkbookData): Uint8Array;
|
|
14
|
-
export declare function encodeDocOriginalMeta(document: IDocumentData): Uint8Array;
|
|
15
|
-
export declare function decodeWorksheetOtherMetas(buffer: Uint8Array | string): Partial<IWorksheetData>;
|
|
16
|
-
export declare function decodeWorkbookOtherMetas(buffer: Uint8Array | string): Partial<IWorkbookData>;
|
|
17
|
-
export declare function decodePartOfCellData(buffer: Uint8Array | string): IObjectMatrixPrimitiveType<ICellData>;
|
|
18
|
-
export declare function decodeDocOriginalMeta(buffer: Uint8Array | string): Partial<IDocumentData>;
|
|
19
|
-
export declare function splitCellDataToBlocks(cellData: IObjectMatrixPrimitiveType<ICellData>, maxColumn: number): ISheetBlock[];
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '../../shared/types';
|
|
2
|
-
import { CellValueType } from '../enum/text-style';
|
|
3
|
-
import { ICellCustomRender } from './i-cell-custom-render';
|
|
4
|
-
import { IDocumentData } from './i-document-data';
|
|
5
|
-
import { IStyleData } from './i-style-data';
|
|
6
|
-
import { ICellValidationData } from './i-cell-validation-data';
|
|
7
|
-
/**
|
|
8
|
-
* Cell value type
|
|
9
|
-
*/
|
|
10
|
-
export type CellValue = string | number | boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Cell data
|
|
13
|
-
*/
|
|
14
|
-
export interface ICellData {
|
|
15
|
-
/**
|
|
16
|
-
* The unique key, a random string, is used for the plug-in to associate the cell. When the cell information changes,
|
|
17
|
-
* the plug-in does not need to change the data, reducing the pressure on the back-end interface id?: string.
|
|
18
|
-
*/
|
|
19
|
-
p?: Nullable<IDocumentData>;
|
|
20
|
-
/** style id */
|
|
21
|
-
s?: Nullable<IStyleData | string>;
|
|
22
|
-
/**
|
|
23
|
-
* Origin value
|
|
24
|
-
*/
|
|
25
|
-
v?: Nullable<CellValue>;
|
|
26
|
-
t?: Nullable<CellValueType>;
|
|
27
|
-
/**
|
|
28
|
-
* Raw formula string. For example `=SUM(A1:B4)`.
|
|
29
|
-
*/
|
|
30
|
-
f?: Nullable<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Id of the formula.
|
|
33
|
-
*/
|
|
34
|
-
si?: Nullable<string>;
|
|
35
|
-
/**
|
|
36
|
-
* User stored custom fields
|
|
37
|
-
*/
|
|
38
|
-
custom?: Nullable<Record<string, any>>;
|
|
39
|
-
}
|
|
40
|
-
export interface ICellMarksStyle {
|
|
41
|
-
color: string;
|
|
42
|
-
size: number;
|
|
43
|
-
}
|
|
44
|
-
export interface ICellMarks {
|
|
45
|
-
tl?: ICellMarksStyle;
|
|
46
|
-
tr?: ICellMarksStyle;
|
|
47
|
-
bl?: ICellMarksStyle;
|
|
48
|
-
br?: ICellMarksStyle;
|
|
49
|
-
isSkip?: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface ICellDataForSheetInterceptor extends ICellData {
|
|
52
|
-
interceptorStyle?: Nullable<IStyleData>;
|
|
53
|
-
isInArrayFormulaRange?: Nullable<boolean>;
|
|
54
|
-
dataValidation?: Nullable<ICellValidationData>;
|
|
55
|
-
markers?: ICellMarks;
|
|
56
|
-
customRender?: Nullable<ICellCustomRender[]>;
|
|
57
|
-
interceptorAutoHeight?: number;
|
|
58
|
-
/**
|
|
59
|
-
* can cell be covered when sibling is overflow
|
|
60
|
-
*/
|
|
61
|
-
coverable?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export declare function isICellData(value: any): value is ICellData;
|
|
64
|
-
export declare function getCellValueType(cell: ICellData): CellValueType | null | undefined;
|
|
65
|
-
export declare function isNullCell(cell: Nullable<ICellData>): boolean;
|
|
66
|
-
export declare function isCellV(cell: Nullable<ICellData | CellValue>): cell is string | number | boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
export interface IFreeze {
|
|
17
|
-
xSplit: number;
|
|
18
|
-
ySplit: number;
|
|
19
|
-
startRow: number;
|
|
20
|
-
startColumn: number;
|
|
21
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
export declare enum RANGE_TYPE {
|
|
17
|
-
NORMAL = 0,
|
|
18
|
-
ROW = 1,
|
|
19
|
-
COLUMN = 2,
|
|
20
|
-
ALL = 3
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* none: A1
|
|
24
|
-
* row: A$1
|
|
25
|
-
* column: $A1
|
|
26
|
-
* all: $A$1
|
|
27
|
-
*/
|
|
28
|
-
export declare enum AbsoluteRefType {
|
|
29
|
-
NONE = 0,
|
|
30
|
-
ROW = 1,
|
|
31
|
-
COLUMN = 2,
|
|
32
|
-
ALL = 3
|
|
33
|
-
}
|
|
34
|
-
interface IRangeLocation {
|
|
35
|
-
/**
|
|
36
|
-
* Id of the Workbook the range belongs to.
|
|
37
|
-
* When this field is not defined, it should be considered as the range in the currently activated worksheet.
|
|
38
|
-
*/
|
|
39
|
-
unitId?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Id of the Worksheet the range belongs to.
|
|
42
|
-
* When this field is not defined, it should be considered as the range in the currently activated worksheet.
|
|
43
|
-
*/
|
|
44
|
-
sheetId?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface IRowRange extends IRangeLocation {
|
|
47
|
-
/**
|
|
48
|
-
* The start row (inclusive) of the range
|
|
49
|
-
* startRow
|
|
50
|
-
*/
|
|
51
|
-
startRow: number;
|
|
52
|
-
/**
|
|
53
|
-
* The end row (exclusive) of the range
|
|
54
|
-
* endRow
|
|
55
|
-
*/
|
|
56
|
-
endRow: number;
|
|
57
|
-
}
|
|
58
|
-
export interface IColumnRange extends IRangeLocation {
|
|
59
|
-
/**
|
|
60
|
-
* The start column (inclusive) of the range
|
|
61
|
-
* startColumn
|
|
62
|
-
*/
|
|
63
|
-
startColumn: number;
|
|
64
|
-
/**
|
|
65
|
-
* The end column (exclusive) of the range
|
|
66
|
-
* endColumn
|
|
67
|
-
*/
|
|
68
|
-
endColumn: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Range data structure
|
|
72
|
-
*
|
|
73
|
-
* One of the range types,
|
|
74
|
-
*
|
|
75
|
-
* e.g.,
|
|
76
|
-
* {
|
|
77
|
-
* startRow:0 ,
|
|
78
|
-
* startColumn:0,
|
|
79
|
-
* endRow:1,
|
|
80
|
-
* endColumn:1,
|
|
81
|
-
* }
|
|
82
|
-
*
|
|
83
|
-
* means "A1:B2"
|
|
84
|
-
*/
|
|
85
|
-
export interface IRange extends IRowRange, IColumnRange {
|
|
86
|
-
rangeType?: RANGE_TYPE;
|
|
87
|
-
startAbsoluteRefType?: AbsoluteRefType;
|
|
88
|
-
endAbsoluteRefType?: AbsoluteRefType;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Transform an `IRange` object to an array.
|
|
92
|
-
* @param range
|
|
93
|
-
* @returns [rowStart, colStart, rowEnd, colEnd]
|
|
94
|
-
*/
|
|
95
|
-
export declare function selectionToArray(range: IRange): [number, number, number, number];
|
|
96
|
-
/**
|
|
97
|
-
* Range data of grid
|
|
98
|
-
*/
|
|
99
|
-
export interface IGridRange {
|
|
100
|
-
sheetId: string;
|
|
101
|
-
range: IRange;
|
|
102
|
-
}
|
|
103
|
-
export interface IUnitRangeName {
|
|
104
|
-
unitId: string;
|
|
105
|
-
sheetName: string;
|
|
106
|
-
range: IRange;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Range data of Unit
|
|
110
|
-
*/
|
|
111
|
-
export interface IUnitRange extends IGridRange {
|
|
112
|
-
unitId: string;
|
|
113
|
-
}
|
|
114
|
-
export interface IUnitRangeWithName extends IUnitRange {
|
|
115
|
-
sheetName: string;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* One of the range types,
|
|
119
|
-
*
|
|
120
|
-
* e.g.,"A1:B2","sheet1!A1:B2","A1","1:1","A:A","AA1:BB2"
|
|
121
|
-
*/
|
|
122
|
-
export type IRangeStringData = string;
|
|
123
|
-
/**
|
|
124
|
-
* Row data type
|
|
125
|
-
*/
|
|
126
|
-
export type IRowStartEndData = [startRow: number, endRow: number] | number[];
|
|
127
|
-
/**
|
|
128
|
-
* Column data type
|
|
129
|
-
*/
|
|
130
|
-
export type IColumnStartEndData = [startColumn: number, endColumn: number] | number[];
|
|
131
|
-
/**
|
|
132
|
-
* One of the range types,
|
|
133
|
-
*
|
|
134
|
-
* e.g.,
|
|
135
|
-
* {
|
|
136
|
-
* row:[0,1],
|
|
137
|
-
* column:[0,1]
|
|
138
|
-
* }
|
|
139
|
-
*todo
|
|
140
|
-
|
|
141
|
-
true false 枚举
|
|
142
|
-
* means "A1:B2"
|
|
143
|
-
*/
|
|
144
|
-
export interface IRangeArrayData {
|
|
145
|
-
/**
|
|
146
|
-
* row
|
|
147
|
-
*/
|
|
148
|
-
row: IRowStartEndData;
|
|
149
|
-
/**
|
|
150
|
-
* column
|
|
151
|
-
*/
|
|
152
|
-
column: IColumnStartEndData;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* The row and column numbers represent a cell
|
|
156
|
-
*/
|
|
157
|
-
export interface IRangeCellData {
|
|
158
|
-
/**
|
|
159
|
-
* row
|
|
160
|
-
*/
|
|
161
|
-
row: number;
|
|
162
|
-
/**
|
|
163
|
-
* column
|
|
164
|
-
*/
|
|
165
|
-
column: number;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* range types
|
|
169
|
-
*
|
|
170
|
-
* Allow users to provide one of three formats, we need to convert to IRange to store
|
|
171
|
-
*/
|
|
172
|
-
export type IRangeType = IRange | IRangeStringData | IRangeArrayData | IRangeCellData;
|
|
173
|
-
/**
|
|
174
|
-
* Whether to clear only the contents. Whether to clear only the format; note that clearing format also clears data validation rules.
|
|
175
|
-
*/
|
|
176
|
-
export interface IOptionData {
|
|
177
|
-
/**
|
|
178
|
-
* 1. designates that only the format should be copied
|
|
179
|
-
*
|
|
180
|
-
* 2. Whether to clear only the format; note that clearing format also clears data validation rules.
|
|
181
|
-
*
|
|
182
|
-
* 3. worksheet Whether to clear the format.
|
|
183
|
-
*/
|
|
184
|
-
formatOnly?: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* 1. designates that only the content should be copied
|
|
187
|
-
*
|
|
188
|
-
* 2. Whether to clear only the contents.
|
|
189
|
-
*
|
|
190
|
-
* 3. worksheet Whether to clear the content.
|
|
191
|
-
*
|
|
192
|
-
*/
|
|
193
|
-
contentsOnly?: boolean;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Option of copyTo function
|
|
197
|
-
*/
|
|
198
|
-
export interface ICopyToOptionsData extends IOptionData {
|
|
199
|
-
}
|
|
200
|
-
export interface IRectLTRB {
|
|
201
|
-
left: number;
|
|
202
|
-
top: number;
|
|
203
|
-
right: number;
|
|
204
|
-
bottom: number;
|
|
205
|
-
width?: number;
|
|
206
|
-
height?: number;
|
|
207
|
-
}
|
|
208
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BooleanNumber } from '../enum';
|
|
2
|
-
/**
|
|
3
|
-
* Properties of row data
|
|
4
|
-
*/
|
|
5
|
-
export interface IRowData {
|
|
6
|
-
/**
|
|
7
|
-
* height in pixel
|
|
8
|
-
*/
|
|
9
|
-
h?: number;
|
|
10
|
-
/**
|
|
11
|
-
* is current row self-adaptive to its content, use `ah` to set row height when true, else use `h`.
|
|
12
|
-
*/
|
|
13
|
-
ia?: BooleanNumber;
|
|
14
|
-
/**
|
|
15
|
-
* auto height
|
|
16
|
-
*/
|
|
17
|
-
ah?: number;
|
|
18
|
-
/**
|
|
19
|
-
* hidden
|
|
20
|
-
*/
|
|
21
|
-
hd?: BooleanNumber;
|
|
22
|
-
}
|
|
23
|
-
export interface IRowAutoHeightInfo {
|
|
24
|
-
row: number;
|
|
25
|
-
autoHeight?: number;
|
|
26
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '../../shared/types';
|
|
2
|
-
import { IRange } from './i-range';
|
|
3
|
-
/**
|
|
4
|
-
* Properties of selection data
|
|
5
|
-
*/
|
|
6
|
-
export interface IPosition {
|
|
7
|
-
startX: number;
|
|
8
|
-
startY: number;
|
|
9
|
-
endX: number;
|
|
10
|
-
endY: number;
|
|
11
|
-
}
|
|
12
|
-
export interface ISingleCell {
|
|
13
|
-
actualRow: number;
|
|
14
|
-
actualColumn: number;
|
|
15
|
-
isMerged: boolean;
|
|
16
|
-
isMergedMainCell: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface IRangeWithCoord extends IPosition, IRange {
|
|
19
|
-
}
|
|
20
|
-
export interface ISelectionCell extends IRange, ISingleCell {
|
|
21
|
-
}
|
|
22
|
-
export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
|
|
23
|
-
mergeInfo: IRangeWithCoord;
|
|
24
|
-
}
|
|
25
|
-
export interface ISelection {
|
|
26
|
-
/**
|
|
27
|
-
* Sheet selection range.
|
|
28
|
-
*/
|
|
29
|
-
range: IRange;
|
|
30
|
-
/**
|
|
31
|
-
* The highlighted cell in the selection range. If there are several selections, only one selection would have a primary cell.
|
|
32
|
-
*/
|
|
33
|
-
primary: Nullable<ISelectionCell>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Selection range Info, contains selectionrange & primaryrange
|
|
37
|
-
* primaryrange is the range of the highlighted cell.
|
|
38
|
-
*/
|
|
39
|
-
export interface ISelectionWithCoord {
|
|
40
|
-
rangeWithCoord: IRangeWithCoord;
|
|
41
|
-
primaryWithCoord: Nullable<ISelectionCellWithMergeInfo>;
|
|
42
|
-
}
|
|
43
|
-
export interface ITextRangeStart {
|
|
44
|
-
startOffset: number;
|
|
45
|
-
}
|
|
46
|
-
export interface ITextRange extends ITextRangeStart {
|
|
47
|
-
endOffset: number;
|
|
48
|
-
collapsed: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface ITextRangeParam extends ITextRange {
|
|
51
|
-
segmentId?: string;
|
|
52
|
-
segmentPage?: number;
|
|
53
|
-
isActive?: boolean;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Determines whether the cell(row, column) is within the range of the merged cells.
|
|
57
|
-
*/
|
|
58
|
-
export declare function getCellInfoInMergeData(row: number, column: number, mergeData?: IRange[]): ISelectionCell;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
export interface IServiceData {
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../../services/log/log.service';
|
|
2
|
-
import { DependencyOverride } from '../../services/plugin/plugin-override';
|
|
3
|
-
import { IStyleSheet } from '../../services/theme/theme.service';
|
|
4
|
-
import { ILocales } from '../../shared/locale';
|
|
5
|
-
import { LocaleType } from '../enum';
|
|
6
|
-
export interface IUniverData {
|
|
7
|
-
theme: IStyleSheet;
|
|
8
|
-
locale: LocaleType;
|
|
9
|
-
locales: ILocales;
|
|
10
|
-
logLevel: LogLevel;
|
|
11
|
-
id: string;
|
|
12
|
-
override?: DependencyOverride;
|
|
13
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { IKeyType, Nullable } from '../../shared/types';
|
|
2
|
-
import { LocaleType } from '../enum';
|
|
3
|
-
import { IExtraModelData } from './i-extra-model-data';
|
|
4
|
-
import { IStyleData } from './i-style-data';
|
|
5
|
-
import { IWorksheetData } from './i-worksheet-data';
|
|
6
|
-
export type Resources = Array<{
|
|
7
|
-
id?: string;
|
|
8
|
-
name: string;
|
|
9
|
-
data: string;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* Properties of a workbook's configuration
|
|
13
|
-
*/
|
|
14
|
-
export interface IWorkbookData extends IExtraModelData {
|
|
15
|
-
/**
|
|
16
|
-
* unit id
|
|
17
|
-
*/
|
|
18
|
-
id: string;
|
|
19
|
-
/**
|
|
20
|
-
* Revision of this spreadsheet. Would be used in collaborated editing. Starts from one.
|
|
21
|
-
*/
|
|
22
|
-
rev?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the spreadsheet.
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
/**
|
|
28
|
-
* Version of Univer model definition.
|
|
29
|
-
*/
|
|
30
|
-
appVersion: string;
|
|
31
|
-
locale: LocaleType;
|
|
32
|
-
/** Style reference. */
|
|
33
|
-
styles: IKeyType<Nullable<IStyleData>>;
|
|
34
|
-
sheetOrder: string[];
|
|
35
|
-
sheets: {
|
|
36
|
-
[sheetId: string]: Partial<IWorksheetData>;
|
|
37
|
-
};
|
|
38
|
-
resources?: Resources;
|
|
39
|
-
}
|