@univerjs-pro/bases 0.25.0-insiders.20260608-e4336f7
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/README.md +42 -0
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -0
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/commands/cell.command.d.ts +32 -0
- package/lib/types/commands/field.command.d.ts +53 -0
- package/lib/types/commands/record.command.d.ts +39 -0
- package/lib/types/commands/table.command.d.ts +18 -0
- package/lib/types/commands/undo-redo.d.ts +2 -0
- package/lib/types/commands/view.command.d.ts +107 -0
- package/lib/types/controllers/base-active-dirty.controller.d.ts +16 -0
- package/lib/types/controllers/base-formula-calculation.controller.d.ts +23 -0
- package/lib/types/controllers/base-formula-optional-identifier.d.ts +1 -0
- package/lib/types/controllers/base-remote-formula.controller.d.ts +13 -0
- package/lib/types/facade/f-base.d.ts +362 -0
- package/lib/types/facade/f-event.d.ts +61 -0
- package/lib/types/facade/f-field.d.ts +191 -0
- package/lib/types/facade/f-permission.d.ts +299 -0
- package/lib/types/facade/f-range.d.ts +179 -0
- package/lib/types/facade/f-record.d.ts +137 -0
- package/lib/types/facade/f-table.d.ts +769 -0
- package/lib/types/facade/f-univer.d.ts +148 -0
- package/lib/types/facade/f-view.d.ts +275 -0
- package/lib/types/facade/index.d.ts +10 -0
- package/lib/types/fields/date-format.d.ts +6 -0
- package/lib/types/fields/field-core-plugin.d.ts +21 -0
- package/lib/types/fields/number-format.d.ts +15 -0
- package/lib/types/index.d.ts +48 -0
- package/lib/types/locale/ar-SA.d.ts +3 -0
- package/lib/types/locale/ca-ES.d.ts +3 -0
- package/lib/types/locale/de-DE.d.ts +3 -0
- package/lib/types/locale/en-US.d.ts +59 -0
- package/lib/types/locale/es-ES.d.ts +3 -0
- package/lib/types/locale/fa-IR.d.ts +3 -0
- package/lib/types/locale/fr-FR.d.ts +3 -0
- package/lib/types/locale/id-ID.d.ts +3 -0
- package/lib/types/locale/it-IT.d.ts +3 -0
- package/lib/types/locale/ja-JP.d.ts +3 -0
- package/lib/types/locale/ko-KR.d.ts +3 -0
- package/lib/types/locale/pl-PL.d.ts +3 -0
- package/lib/types/locale/pt-BR.d.ts +3 -0
- package/lib/types/locale/ru-RU.d.ts +3 -0
- package/lib/types/locale/sk-SK.d.ts +3 -0
- package/lib/types/locale/vi-VN.d.ts +3 -0
- package/lib/types/locale/zh-CN.d.ts +3 -0
- package/lib/types/locale/zh-HK.d.ts +3 -0
- package/lib/types/locale/zh-TW.d.ts +3 -0
- package/lib/types/models/base-cell-data.d.ts +14 -0
- package/lib/types/models/base-snapshot.d.ts +1 -0
- package/lib/types/models/default-table.d.ts +12 -0
- package/lib/types/models/field-snapshot.d.ts +1 -0
- package/lib/types/models/record-snapshot.d.ts +1 -0
- package/lib/types/models/table-snapshot.d.ts +1 -0
- package/lib/types/models/value.d.ts +1 -0
- package/lib/types/models/view-snapshot.d.ts +1 -0
- package/lib/types/mutations/json1.mutation.d.ts +7 -0
- package/lib/types/mutations/utils.d.ts +2 -0
- package/lib/types/ot/json1-adapter.d.ts +103 -0
- package/lib/types/ot/json1-invalidation.d.ts +2 -0
- package/lib/types/ot/json1-op-applier.d.ts +6 -0
- package/lib/types/ot/json1-op-factory.d.ts +64 -0
- package/lib/types/ot/json1-path.d.ts +13 -0
- package/lib/types/plugin.d.ts +35 -0
- package/lib/types/search/base-search.d.ts +24 -0
- package/lib/types/services/base-active-dirty.service.d.ts +24 -0
- package/lib/types/services/base-command.service.d.ts +122 -0
- package/lib/types/services/base-compression.service.d.ts +46 -0
- package/lib/types/services/base-field-registry.service.d.ts +17 -0
- package/lib/types/services/base-formula.service.d.ts +71 -0
- package/lib/types/services/base-performance.service.d.ts +5 -0
- package/lib/types/services/base-permission.service.d.ts +76 -0
- package/lib/types/services/base-projection.service.d.ts +97 -0
- package/lib/types/services/base-resource.service.d.ts +15 -0
- package/lib/types/services/base-view-registry.service.d.ts +15 -0
- package/lib/types/views/view-core-plugin.d.ts +21 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -0
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BaseCellValue as CellValue, IBaseCellData, IFieldSnapshot, ITableSnapshot, RecordId } from '@univerjs/core';
|
|
2
|
+
export declare function ensureBaseTableCellLayout(table: ITableSnapshot): ITableSnapshot;
|
|
3
|
+
export declare function syncBaseRecordValuesFromCellData(table: ITableSnapshot): ITableSnapshot;
|
|
4
|
+
export declare function getBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData | undefined;
|
|
5
|
+
export declare function getBaseCellValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): CellValue;
|
|
6
|
+
export declare function getBaseCellFormulaValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData['v'];
|
|
7
|
+
export declare function setBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: CellValue | IBaseCellData): void;
|
|
8
|
+
export declare function toBaseCellData(value: CellValue | IBaseCellData, field?: IFieldSnapshot): IBaseCellData;
|
|
9
|
+
export declare function fromBaseCellData(cell: IBaseCellData | undefined, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): CellValue;
|
|
10
|
+
export declare function toBaseRecordValue(value: CellValue | IBaseCellData, cell: IBaseCellData, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): CellValue;
|
|
11
|
+
export declare function getBaseAttachmentResourceKey(fieldId: string, recordId: RecordId): string;
|
|
12
|
+
export declare function writeAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: unknown): void;
|
|
13
|
+
export declare function readAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string): Record<string, unknown>[] | null;
|
|
14
|
+
export declare function normalizeAttachmentValue(value: unknown): Record<string, unknown>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IBaseSnapshot } from '@univerjs/core';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ITableSnapshot } from '@univerjs/core';
|
|
2
|
+
export interface ICreateDefaultBaseTableSnapshotOptions {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
primaryFieldId?: string;
|
|
6
|
+
primaryFieldName?: string;
|
|
7
|
+
gridViewId?: string;
|
|
8
|
+
recordCount?: number;
|
|
9
|
+
now?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function createDefaultBaseTableSnapshot(options: ICreateDefaultBaseTableSnapshotOptions): ITableSnapshot;
|
|
12
|
+
export type CreateDefaultBaseTableSnapshotOptions = ICreateDefaultBaseTableSnapshotOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IFieldSnapshot } from '@univerjs/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IRecordSnapshot } from '@univerjs/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ITableSnapshot } from '@univerjs/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { BaseCellValue as CellValue } from '@univerjs/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IViewSnapshot } from '@univerjs/core';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { BaseInvalidation, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
|
|
2
|
+
export type BaseJson1Command = {
|
|
3
|
+
type: 'createTable';
|
|
4
|
+
table: ITableSnapshot;
|
|
5
|
+
index?: number;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'renameTable';
|
|
8
|
+
tableId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'deleteTable';
|
|
12
|
+
tableId: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'createField';
|
|
15
|
+
tableId: string;
|
|
16
|
+
field: IFieldSnapshot;
|
|
17
|
+
index?: number;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'updateField';
|
|
20
|
+
tableId: string;
|
|
21
|
+
fieldId: string;
|
|
22
|
+
patch: Partial<IFieldSnapshot>;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'deleteField';
|
|
25
|
+
tableId: string;
|
|
26
|
+
fieldId: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'createRecord';
|
|
29
|
+
tableId: string;
|
|
30
|
+
record: IRecordSnapshot;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'deleteRecord';
|
|
33
|
+
tableId: string;
|
|
34
|
+
recordId: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'updateRecordOrder';
|
|
37
|
+
tableId: string;
|
|
38
|
+
recordId: string;
|
|
39
|
+
orderKey: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'updateCell';
|
|
42
|
+
tableId: string;
|
|
43
|
+
recordId: string;
|
|
44
|
+
fieldId: string;
|
|
45
|
+
value: unknown;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'setRecordValues';
|
|
48
|
+
tableId: string;
|
|
49
|
+
patches: Array<{
|
|
50
|
+
recordId: string;
|
|
51
|
+
values: Record<string, unknown>;
|
|
52
|
+
}>;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'setRangeValues';
|
|
55
|
+
tableId: string;
|
|
56
|
+
patches: Array<{
|
|
57
|
+
row: number;
|
|
58
|
+
col: number;
|
|
59
|
+
value: unknown;
|
|
60
|
+
}>;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'createView';
|
|
63
|
+
tableId: string;
|
|
64
|
+
view: IViewSnapshot;
|
|
65
|
+
index?: number;
|
|
66
|
+
} | {
|
|
67
|
+
type: 'deleteView';
|
|
68
|
+
tableId: string;
|
|
69
|
+
viewId: string;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'updateViewConfig';
|
|
72
|
+
tableId: string;
|
|
73
|
+
viewId: string;
|
|
74
|
+
patch: Record<string, unknown>;
|
|
75
|
+
};
|
|
76
|
+
export interface IBaseCollaborativeOp {
|
|
77
|
+
unitId: string;
|
|
78
|
+
unitType: 'base';
|
|
79
|
+
rev: number;
|
|
80
|
+
op: JSONXActions;
|
|
81
|
+
meta?: {
|
|
82
|
+
commandId: string;
|
|
83
|
+
commandType: string;
|
|
84
|
+
actorId: string;
|
|
85
|
+
timestamp: number;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface IBaseJson1Adapter {
|
|
89
|
+
createOp(command: BaseJson1Command, snapshot: IBaseSnapshot): JSONXActions;
|
|
90
|
+
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
91
|
+
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
92
|
+
getAffectedRanges(op: JSONXActions): BaseInvalidation[];
|
|
93
|
+
}
|
|
94
|
+
export declare class BaseJson1Adapter implements IBaseJson1Adapter {
|
|
95
|
+
private readonly _factory;
|
|
96
|
+
private readonly _applier;
|
|
97
|
+
createOp(command: BaseJson1Command, snapshot: IBaseSnapshot): JSONXActions;
|
|
98
|
+
createCollaborativeOp(input: Omit<IBaseCollaborativeOp, 'unitType'>): IBaseCollaborativeOp;
|
|
99
|
+
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
100
|
+
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
101
|
+
getAffectedRanges(op: JSONXActions): BaseInvalidation[];
|
|
102
|
+
}
|
|
103
|
+
export type BaseCollaborativeOp = IBaseCollaborativeOp;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BaseInvalidation, IBaseSnapshot, JSONXActions } from '@univerjs/core';
|
|
2
|
+
export declare class BaseJson1OpApplier {
|
|
3
|
+
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
4
|
+
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
5
|
+
getAffectedRanges(op: JSONXActions): BaseInvalidation[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { BaseCellValue as CellValue, FilterConfig, GroupConfig, IBaseCellData, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions, SortConfig, TableId } from '@univerjs/core';
|
|
2
|
+
export interface ICreateFieldOpInput {
|
|
3
|
+
field: IFieldSnapshot;
|
|
4
|
+
index?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ISetRecordValuesPatch {
|
|
7
|
+
recordId: string;
|
|
8
|
+
values: Record<string, CellValue>;
|
|
9
|
+
recordPatch?: Partial<Pick<IRecordSnapshot, 'updatedAt' | 'updatedBy'>>;
|
|
10
|
+
}
|
|
11
|
+
export interface ISetRangeValuesPatch {
|
|
12
|
+
row: number;
|
|
13
|
+
col: number;
|
|
14
|
+
value: CellValue | IBaseCellData | null;
|
|
15
|
+
}
|
|
16
|
+
export declare class BaseJson1OpFactory {
|
|
17
|
+
createTable(snapshot: IBaseSnapshot, table: ITableSnapshot, index?: number): JSONXActions;
|
|
18
|
+
renameTable(snapshot: IBaseSnapshot, tableId: TableId, name: string): JSONXActions;
|
|
19
|
+
deleteTable(snapshot: IBaseSnapshot, tableId: TableId): JSONXActions;
|
|
20
|
+
createRecord(snapshot: IBaseSnapshot, tableId: TableId, record: IRecordSnapshot): JSONXActions;
|
|
21
|
+
createRecords(snapshot: IBaseSnapshot, tableId: TableId, records: IRecordSnapshot[]): JSONXActions;
|
|
22
|
+
deleteRecord(snapshot: IBaseSnapshot, tableId: TableId, recordId: string): JSONXActions;
|
|
23
|
+
deleteRecords(snapshot: IBaseSnapshot, tableId: TableId, recordIds: string[]): JSONXActions;
|
|
24
|
+
duplicateRecord(snapshot: IBaseSnapshot, tableId: TableId, sourceRecordId: string, record: IRecordSnapshot): JSONXActions;
|
|
25
|
+
updateRecordOrder(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, orderKey: string): JSONXActions;
|
|
26
|
+
updateCell(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, fieldId: string, value: CellValue): JSONXActions;
|
|
27
|
+
setRecordValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRecordValuesPatch[]): JSONXActions;
|
|
28
|
+
setRangeValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRangeValuesPatch[]): JSONXActions;
|
|
29
|
+
createField(snapshot: IBaseSnapshot, tableId: TableId, input: ICreateFieldOpInput): JSONXActions;
|
|
30
|
+
duplicateField(snapshot: IBaseSnapshot, tableId: TableId, sourceFieldId: string, input: ICreateFieldOpInput): JSONXActions;
|
|
31
|
+
updateField(snapshot: IBaseSnapshot, tableId: TableId, fieldId: string, patch: Partial<IFieldSnapshot>): JSONXActions;
|
|
32
|
+
changeFieldType(snapshot: IBaseSnapshot, tableId: TableId, fieldId: string, input: Pick<IFieldSnapshot, 'type' | 'config'>): JSONXActions;
|
|
33
|
+
deleteField(snapshot: IBaseSnapshot, tableId: TableId, fieldId: string): JSONXActions;
|
|
34
|
+
moveField(snapshot: IBaseSnapshot, tableId: TableId, fieldId: string, target: {
|
|
35
|
+
beforeFieldId?: string;
|
|
36
|
+
afterFieldId?: string;
|
|
37
|
+
}): JSONXActions;
|
|
38
|
+
createView(snapshot: IBaseSnapshot, tableId: TableId, view: IViewSnapshot, index?: number): JSONXActions;
|
|
39
|
+
renameView(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, name: string): JSONXActions;
|
|
40
|
+
deleteView(snapshot: IBaseSnapshot, tableId: TableId, viewId: string): JSONXActions;
|
|
41
|
+
moveView(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, target: {
|
|
42
|
+
beforeViewId?: string;
|
|
43
|
+
afterViewId?: string;
|
|
44
|
+
}): JSONXActions;
|
|
45
|
+
updateViewConfig(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, patch: Record<string, unknown>): JSONXActions;
|
|
46
|
+
setViewFilter(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, filter: FilterConfig | null): JSONXActions;
|
|
47
|
+
setViewSort(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, sort: SortConfig[]): JSONXActions;
|
|
48
|
+
setViewGroup(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, group: GroupConfig[]): JSONXActions;
|
|
49
|
+
setViewFieldVisible(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, visible: boolean): JSONXActions;
|
|
50
|
+
setViewFieldWidth(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, width: number): JSONXActions;
|
|
51
|
+
setViewFieldOrder(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, target: {
|
|
52
|
+
beforeFieldId?: string;
|
|
53
|
+
afterFieldId?: string;
|
|
54
|
+
}): JSONXActions;
|
|
55
|
+
private _setViewFieldSetting;
|
|
56
|
+
private _setDeleted;
|
|
57
|
+
private _createRecordOrderOp;
|
|
58
|
+
private _setFormulaFieldCells;
|
|
59
|
+
private _setAttachmentResources;
|
|
60
|
+
private _replaceOptional;
|
|
61
|
+
}
|
|
62
|
+
export type CreateFieldOpInput = ICreateFieldOpInput;
|
|
63
|
+
export type SetRecordValuesPatch = ISetRecordValuesPatch;
|
|
64
|
+
export type SetRangeValuesPatch = ISetRangeValuesPatch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FieldId, RecordId, TableId, ViewId } from '@univerjs/core';
|
|
2
|
+
export declare const baseJson1Path: {
|
|
3
|
+
table: (tableId: TableId) => string[];
|
|
4
|
+
field: (tableId: TableId, fieldId: FieldId) => string[];
|
|
5
|
+
fieldOrder: (tableId: TableId, index: number) => (string | number)[];
|
|
6
|
+
record: (tableId: TableId, recordId: RecordId) => string[];
|
|
7
|
+
cell: (tableId: TableId, recordId: RecordId, fieldId: FieldId) => string[];
|
|
8
|
+
cellData: (tableId: TableId, row: number, col: number) => string[];
|
|
9
|
+
attachmentSet: (tableId: TableId, key: string) => string[];
|
|
10
|
+
attachment: (tableId: TableId, attachmentId: string) => string[];
|
|
11
|
+
view: (tableId: TableId, viewId: ViewId) => string[];
|
|
12
|
+
viewFieldHidden: (tableId: TableId, viewId: ViewId, fieldId: FieldId) => string[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ICommandService, Injector, IUniverInstanceService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
import { DataSyncPrimaryController } from '@univerjs/rpc';
|
|
3
|
+
export declare const BASES_PLUGIN_NAME = "BASES_PLUGIN";
|
|
4
|
+
export declare const BASE_SYNC_MUTATIONS: readonly [import("@univerjs/core").IMutation<import(".").IApplyBaseJson1MutationParams, boolean>];
|
|
5
|
+
export declare class UniverBasesPlugin extends Plugin {
|
|
6
|
+
private readonly _config;
|
|
7
|
+
protected readonly _injector: Injector;
|
|
8
|
+
private readonly _commandService;
|
|
9
|
+
private readonly _univerInstanceService;
|
|
10
|
+
private readonly _dataSyncPrimaryController?;
|
|
11
|
+
static pluginName: string;
|
|
12
|
+
static packageName: string;
|
|
13
|
+
static version: string;
|
|
14
|
+
static type: UniverInstanceType;
|
|
15
|
+
private readonly _baseSyncDisposables;
|
|
16
|
+
constructor(_config: {} | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
|
|
17
|
+
onReady(): void;
|
|
18
|
+
private _initDependencies;
|
|
19
|
+
private _initCommands;
|
|
20
|
+
private _initDataSync;
|
|
21
|
+
private _syncBaseUnit;
|
|
22
|
+
private _initRegistries;
|
|
23
|
+
}
|
|
24
|
+
export declare class UniverRemoteBasesPlugin extends Plugin {
|
|
25
|
+
private readonly _config;
|
|
26
|
+
protected readonly _injector: Injector;
|
|
27
|
+
private readonly _commandService;
|
|
28
|
+
private readonly _univerInstanceService;
|
|
29
|
+
static pluginName: string;
|
|
30
|
+
static packageName: string;
|
|
31
|
+
static version: string;
|
|
32
|
+
static type: UniverInstanceType;
|
|
33
|
+
constructor(_config: {} | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
|
|
34
|
+
onReady(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FieldId, FieldType, ITableSnapshot, ProjectedRow, RecordId } from '@univerjs/core';
|
|
2
|
+
export interface IBaseTableSearchRequest {
|
|
3
|
+
table: ITableSnapshot;
|
|
4
|
+
rows: ReadonlyArray<Pick<ProjectedRow, 'recordId' | 'values'>>;
|
|
5
|
+
query: string;
|
|
6
|
+
fieldIds: ReadonlyArray<FieldId>;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IBaseTableSearchMatch {
|
|
10
|
+
recordId: RecordId;
|
|
11
|
+
fieldId: FieldId;
|
|
12
|
+
fieldType: FieldType;
|
|
13
|
+
text: string;
|
|
14
|
+
score: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IBaseTableSearchResult {
|
|
17
|
+
query: string;
|
|
18
|
+
total: number;
|
|
19
|
+
matches: IBaseTableSearchMatch[];
|
|
20
|
+
}
|
|
21
|
+
export declare function searchBaseTable(request: IBaseTableSearchRequest): IBaseTableSearchResult;
|
|
22
|
+
export type BaseTableSearchRequest = IBaseTableSearchRequest;
|
|
23
|
+
export type BaseTableSearchMatch = IBaseTableSearchMatch;
|
|
24
|
+
export type BaseTableSearchResult = IBaseTableSearchResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BaseCellValue as CellValue, IBaseCellData } from '@univerjs/core';
|
|
2
|
+
export interface IBaseRangeValueDirtyParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
tableId: string;
|
|
5
|
+
patches: Array<{
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
value: CellValue | IBaseCellData | null;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface IBaseFormulaDirtyRange {
|
|
12
|
+
unitId: string;
|
|
13
|
+
sheetId: string;
|
|
14
|
+
range: {
|
|
15
|
+
startRow: number;
|
|
16
|
+
endRow: number;
|
|
17
|
+
startColumn: number;
|
|
18
|
+
endColumn: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export type BaseFormulaDirtySuperTableMap = Record<string, Record<string, string>>;
|
|
22
|
+
export declare function setBaseRangeValuesToDirtyRanges(params: IBaseRangeValueDirtyParams): IBaseFormulaDirtyRange[];
|
|
23
|
+
export declare function createBaseStructureDirtySuperTableMap(unitId: string, tableIds: string[]): BaseFormulaDirtySuperTableMap;
|
|
24
|
+
export type BaseFormulaDirtyRange = IBaseFormulaDirtyRange;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { BaseDataModel, BaseCellValue as CellValue, FilterConfig, GroupConfig, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions, SortConfig } from '@univerjs/core';
|
|
2
|
+
import { BaseFieldRegistryService } from './base-field-registry.service';
|
|
3
|
+
import { IBasePermissionService } from './base-permission.service';
|
|
4
|
+
export interface IBaseCommandRuntimeContext {
|
|
5
|
+
now?: () => number;
|
|
6
|
+
getCurrentUserId?: () => string | null | undefined;
|
|
7
|
+
getCurrentUser?: () => {
|
|
8
|
+
userID: string;
|
|
9
|
+
name: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
} | null | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface IBaseCommandService {
|
|
14
|
+
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): JSONXActions;
|
|
15
|
+
createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
|
|
16
|
+
recordId: string;
|
|
17
|
+
values: Record<string, CellValue>;
|
|
18
|
+
}>): JSONXActions;
|
|
19
|
+
createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
|
|
20
|
+
createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
|
|
21
|
+
createCreateFieldOp(base: BaseDataModel, tableId: string, field: IFieldSnapshot, index?: number): JSONXActions;
|
|
22
|
+
createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
|
|
23
|
+
renameTable(base: BaseDataModel, tableId: string, name: string): void;
|
|
24
|
+
deleteTable(base: BaseDataModel, tableId: string): void;
|
|
25
|
+
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): void;
|
|
26
|
+
setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
|
|
27
|
+
recordId: string;
|
|
28
|
+
values: Record<string, CellValue>;
|
|
29
|
+
}>): void;
|
|
30
|
+
createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
|
|
31
|
+
deleteRecord(base: BaseDataModel, tableId: string, recordId: string): void;
|
|
32
|
+
duplicateRecord(base: BaseDataModel, tableId: string, sourceRecordId: string, record: IRecordSnapshot): void;
|
|
33
|
+
updateRecordOrder(base: BaseDataModel, tableId: string, recordId: string, orderKey: string): void;
|
|
34
|
+
createField(base: BaseDataModel, tableId: string, field: IFieldSnapshot, index?: number): void;
|
|
35
|
+
updateField(base: BaseDataModel, tableId: string, fieldId: string, patch: Partial<IFieldSnapshot>): void;
|
|
36
|
+
changeFieldType(base: BaseDataModel, tableId: string, fieldId: string, input: Pick<IFieldSnapshot, 'type' | 'config'>): void;
|
|
37
|
+
deleteField(base: BaseDataModel, tableId: string, fieldId: string): void;
|
|
38
|
+
moveField(base: BaseDataModel, tableId: string, fieldId: string, target: {
|
|
39
|
+
beforeFieldId?: string;
|
|
40
|
+
afterFieldId?: string;
|
|
41
|
+
}): void;
|
|
42
|
+
createView(base: BaseDataModel, tableId: string, view: IViewSnapshot, index?: number): void;
|
|
43
|
+
renameView(base: BaseDataModel, tableId: string, viewId: string, name: string): void;
|
|
44
|
+
deleteView(base: BaseDataModel, tableId: string, viewId: string): void;
|
|
45
|
+
moveView(base: BaseDataModel, tableId: string, viewId: string, target: {
|
|
46
|
+
beforeViewId?: string;
|
|
47
|
+
afterViewId?: string;
|
|
48
|
+
}): void;
|
|
49
|
+
updateViewConfig(base: BaseDataModel, tableId: string, viewId: string, patch: Record<string, unknown>): void;
|
|
50
|
+
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: FilterConfig | null): void;
|
|
51
|
+
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: SortConfig[]): void;
|
|
52
|
+
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: GroupConfig[]): void;
|
|
53
|
+
setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
|
|
54
|
+
setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
|
|
55
|
+
setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
|
|
56
|
+
beforeFieldId?: string;
|
|
57
|
+
afterFieldId?: string;
|
|
58
|
+
}): void;
|
|
59
|
+
}
|
|
60
|
+
export declare const IBaseCommandService: import("@wendellhu/redi").IdentifierDecorator<IBaseCommandService>;
|
|
61
|
+
export declare class BaseCommandService implements IBaseCommandService {
|
|
62
|
+
private readonly _permissionService;
|
|
63
|
+
private readonly _fieldRegistry;
|
|
64
|
+
private readonly _runtimeContext;
|
|
65
|
+
private readonly _factory;
|
|
66
|
+
private readonly _applier;
|
|
67
|
+
constructor(_permissionService: IBasePermissionService, _fieldRegistry?: BaseFieldRegistryService, _runtimeContext?: IBaseCommandRuntimeContext);
|
|
68
|
+
createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
|
|
69
|
+
renameTable(base: BaseDataModel, tableId: string, name: string): void;
|
|
70
|
+
deleteTable(base: BaseDataModel, tableId: string): void;
|
|
71
|
+
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): void;
|
|
72
|
+
setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
|
|
73
|
+
recordId: string;
|
|
74
|
+
values: Record<string, CellValue>;
|
|
75
|
+
}>): void;
|
|
76
|
+
createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
|
|
77
|
+
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): JSONXActions;
|
|
78
|
+
createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
|
|
79
|
+
recordId: string;
|
|
80
|
+
values: Record<string, CellValue>;
|
|
81
|
+
}>): JSONXActions;
|
|
82
|
+
createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
|
|
83
|
+
createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
|
|
84
|
+
createCreateFieldOp(base: BaseDataModel, tableId: string, field: IFieldSnapshot, index?: number): JSONXActions;
|
|
85
|
+
deleteRecord(base: BaseDataModel, tableId: string, recordId: string): void;
|
|
86
|
+
duplicateRecord(base: BaseDataModel, tableId: string, sourceRecordId: string, record: IRecordSnapshot): void;
|
|
87
|
+
updateRecordOrder(base: BaseDataModel, tableId: string, recordId: string, orderKey: string): void;
|
|
88
|
+
createField(base: BaseDataModel, tableId: string, field: IFieldSnapshot, index?: number): void;
|
|
89
|
+
updateField(base: BaseDataModel, tableId: string, fieldId: string, patch: Partial<IFieldSnapshot>): void;
|
|
90
|
+
changeFieldType(base: BaseDataModel, tableId: string, fieldId: string, input: Pick<IFieldSnapshot, 'type' | 'config'>): void;
|
|
91
|
+
deleteField(base: BaseDataModel, tableId: string, fieldId: string): void;
|
|
92
|
+
moveField(base: BaseDataModel, tableId: string, fieldId: string, target: {
|
|
93
|
+
beforeFieldId?: string;
|
|
94
|
+
afterFieldId?: string;
|
|
95
|
+
}): void;
|
|
96
|
+
createView(base: BaseDataModel, tableId: string, view: IViewSnapshot, index?: number): void;
|
|
97
|
+
renameView(base: BaseDataModel, tableId: string, viewId: string, name: string): void;
|
|
98
|
+
deleteView(base: BaseDataModel, tableId: string, viewId: string): void;
|
|
99
|
+
moveView(base: BaseDataModel, tableId: string, viewId: string, target: {
|
|
100
|
+
beforeViewId?: string;
|
|
101
|
+
afterViewId?: string;
|
|
102
|
+
}): void;
|
|
103
|
+
updateViewConfig(base: BaseDataModel, tableId: string, viewId: string, patch: Record<string, unknown>): void;
|
|
104
|
+
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: FilterConfig | null): void;
|
|
105
|
+
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: SortConfig[]): void;
|
|
106
|
+
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: GroupConfig[]): void;
|
|
107
|
+
setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
|
|
108
|
+
setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
|
|
109
|
+
setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
|
|
110
|
+
beforeFieldId?: string;
|
|
111
|
+
afterFieldId?: string;
|
|
112
|
+
}): void;
|
|
113
|
+
private _apply;
|
|
114
|
+
private _createRecordWithDefaults;
|
|
115
|
+
private _withModifiedSystemValues;
|
|
116
|
+
private _createSystemFieldValuePatches;
|
|
117
|
+
private _getSystemFieldValue;
|
|
118
|
+
private _nextNumberingValue;
|
|
119
|
+
private _getCurrentUserId;
|
|
120
|
+
private _normalizeCellValue;
|
|
121
|
+
}
|
|
122
|
+
export type BaseCommandRuntimeContext = IBaseCommandRuntimeContext;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BaseCellValue as CellValue, IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
|
|
2
|
+
export interface IBaseRangeValuesPayload {
|
|
3
|
+
unitId: string;
|
|
4
|
+
tableId: string;
|
|
5
|
+
patches: Array<{
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
value: CellValue | IBaseCellData | null;
|
|
9
|
+
}>;
|
|
10
|
+
trigger?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ICompressedBaseRangeValuesPayload {
|
|
13
|
+
compress: true;
|
|
14
|
+
kind: 'base-range-values-v1';
|
|
15
|
+
u: string;
|
|
16
|
+
t: string;
|
|
17
|
+
p: Array<[number, number, CompressedBaseRangeValue]>;
|
|
18
|
+
}
|
|
19
|
+
export interface ICompressedBaseCellData {
|
|
20
|
+
c: 1;
|
|
21
|
+
v?: IBaseCellData['v'];
|
|
22
|
+
t?: IBaseCellData['t'];
|
|
23
|
+
f?: IBaseCellData['f'];
|
|
24
|
+
si?: IBaseCellData['si'];
|
|
25
|
+
p?: IBaseCellData['p'];
|
|
26
|
+
}
|
|
27
|
+
export type CompressedBaseRangeValue = CellValue | ICompressedBaseCellData | null;
|
|
28
|
+
export interface ICompressedBaseTableSnapshot extends Omit<ITableSnapshot, 'cellData'> {
|
|
29
|
+
cd?: Array<[number, number, ICompressedBaseCellData]>;
|
|
30
|
+
}
|
|
31
|
+
export interface ICompressedBaseSnapshot extends Omit<IBaseSnapshot, 'tables'> {
|
|
32
|
+
compress: true;
|
|
33
|
+
kind: 'base-snapshot-v1';
|
|
34
|
+
tables: Record<string, ICompressedBaseTableSnapshot>;
|
|
35
|
+
}
|
|
36
|
+
export declare function compressBaseRangeValuesPayload(payload: IBaseRangeValuesPayload): ICompressedBaseRangeValuesPayload;
|
|
37
|
+
export declare function decompressBaseRangeValuesPayload(payload: ICompressedBaseRangeValuesPayload | IBaseRangeValuesPayload): IBaseRangeValuesPayload;
|
|
38
|
+
export declare function isCompressedBaseRangeValuesPayload(payload: unknown): payload is ICompressedBaseRangeValuesPayload;
|
|
39
|
+
export declare function compressBaseSnapshot(snapshot: IBaseSnapshot): ICompressedBaseSnapshot;
|
|
40
|
+
export declare function decompressBaseSnapshot(snapshot: IBaseSnapshot | ICompressedBaseSnapshot): IBaseSnapshot;
|
|
41
|
+
export declare function isCompressedBaseSnapshot(snapshot: unknown): snapshot is ICompressedBaseSnapshot;
|
|
42
|
+
export type BaseRangeValuesPayload = IBaseRangeValuesPayload;
|
|
43
|
+
export type CompressedBaseRangeValuesPayload = ICompressedBaseRangeValuesPayload;
|
|
44
|
+
export type CompressedBaseCellData = ICompressedBaseCellData;
|
|
45
|
+
export type CompressedBaseTableSnapshot = ICompressedBaseTableSnapshot;
|
|
46
|
+
export type CompressedBaseSnapshot = ICompressedBaseSnapshot;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FieldType } from '@univerjs/core';
|
|
2
|
+
import type { IFieldCorePlugin, IFieldTypePlugin } from '../fields/field-core-plugin';
|
|
3
|
+
import { Disposable, toDisposable } from '@univerjs/core';
|
|
4
|
+
export interface IBaseFieldRegistryService {
|
|
5
|
+
register(plugin: IFieldCorePlugin): ReturnType<typeof toDisposable>;
|
|
6
|
+
get(type: FieldType): IFieldCorePlugin;
|
|
7
|
+
getTypePlugin(type: FieldType): IFieldTypePlugin | undefined;
|
|
8
|
+
getAll(): IFieldCorePlugin[];
|
|
9
|
+
}
|
|
10
|
+
export declare const IBaseFieldRegistryService: import("@wendellhu/redi").IdentifierDecorator<IBaseFieldRegistryService>;
|
|
11
|
+
export declare class BaseFieldRegistryService extends Disposable implements IBaseFieldRegistryService {
|
|
12
|
+
private readonly _plugins;
|
|
13
|
+
register(plugin: IFieldCorePlugin): import("@wendellhu/redi").IDisposable;
|
|
14
|
+
get(type: FieldType): IFieldCorePlugin;
|
|
15
|
+
getTypePlugin(type: FieldType): IFieldTypePlugin | undefined;
|
|
16
|
+
getAll(): IFieldCorePlugin[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
|
|
2
|
+
import { ObjectMatrix } from '@univerjs/core';
|
|
3
|
+
export interface IBaseFormulaValidationResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
reason?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IBaseFormulaDependency {
|
|
8
|
+
tableId: string;
|
|
9
|
+
fieldId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IBaseFormulaContext {
|
|
12
|
+
snapshot?: IBaseSnapshot;
|
|
13
|
+
}
|
|
14
|
+
export interface IBaseFormulaSuperTableReference {
|
|
15
|
+
sheetId: string;
|
|
16
|
+
titleMap: Map<string, number>;
|
|
17
|
+
range: {
|
|
18
|
+
startRow: number;
|
|
19
|
+
endRow: number;
|
|
20
|
+
startColumn: number;
|
|
21
|
+
endColumn: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface IBaseFormulaSuperTableServiceLike {
|
|
25
|
+
registerTable(unitId: string, tableName: string, reference: IBaseFormulaSuperTableReference): void;
|
|
26
|
+
remove?(unitId: string, tableName: string): void;
|
|
27
|
+
}
|
|
28
|
+
export interface IBaseFormulaCalculationDataset {
|
|
29
|
+
formulaData: Record<string, Record<string, Record<number, Record<number, {
|
|
30
|
+
f: string;
|
|
31
|
+
si?: string;
|
|
32
|
+
}>>>>;
|
|
33
|
+
allUnitData: Record<string, Record<string, {
|
|
34
|
+
cellData: ObjectMatrix<IBaseCellData | null>;
|
|
35
|
+
rowCount: number;
|
|
36
|
+
columnCount: number;
|
|
37
|
+
rowData: Record<number, unknown>;
|
|
38
|
+
columnData: Record<number, unknown>;
|
|
39
|
+
}>>;
|
|
40
|
+
unitStylesData: Record<string, Record<string, unknown>>;
|
|
41
|
+
unitSheetNameMap: Record<string, Record<string, string>>;
|
|
42
|
+
}
|
|
43
|
+
export interface IBaseFormulaCalculationResult {
|
|
44
|
+
unitData?: Record<string, Record<string, Record<number, Record<number, IBaseCellData | null>> | null> | null>;
|
|
45
|
+
unitOtherData?: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface IBaseFormulaResultPatchGroup {
|
|
48
|
+
unitId: string;
|
|
49
|
+
tableId: string;
|
|
50
|
+
patches: Array<{
|
|
51
|
+
row: number;
|
|
52
|
+
col: number;
|
|
53
|
+
value: IBaseCellData | null;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export declare class BaseFormulaService {
|
|
57
|
+
createSuperTableReference(table: ITableSnapshot, sheetId?: string): IBaseFormulaSuperTableReference;
|
|
58
|
+
registerSuperTable(superTableService: IBaseFormulaSuperTableServiceLike, unitId: string, table: ITableSnapshot, options?: {
|
|
59
|
+
tableName?: string;
|
|
60
|
+
sheetId?: string;
|
|
61
|
+
}): IBaseFormulaSuperTableReference;
|
|
62
|
+
registerSuperTables(superTableService: IBaseFormulaSuperTableServiceLike, snapshot: IBaseSnapshot): IBaseFormulaSuperTableReference[];
|
|
63
|
+
validateFormula(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaValidationResult;
|
|
64
|
+
getDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): string[];
|
|
65
|
+
getStructuredDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaDependency[];
|
|
66
|
+
}
|
|
67
|
+
export declare function createBaseFormulaCalculationDataset(snapshot: IBaseSnapshot): IBaseFormulaCalculationDataset;
|
|
68
|
+
export declare function createBaseFormulaResultPatches(snapshot: IBaseSnapshot, result: IBaseFormulaCalculationResult): IBaseFormulaResultPatchGroup[];
|
|
69
|
+
export type BaseFormulaValidationResult = IBaseFormulaValidationResult;
|
|
70
|
+
export type BaseFormulaSuperTableReference = IBaseFormulaSuperTableReference;
|
|
71
|
+
export type BaseFormulaSuperTableServiceLike = IBaseFormulaSuperTableServiceLike;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type BasePerformanceDetails = Record<string, unknown>;
|
|
2
|
+
export declare function isBasePerformanceTracingEnabled(): boolean;
|
|
3
|
+
export declare function traceBasePerformance<T>(label: string, fn: () => T, details?: BasePerformanceDetails): T;
|
|
4
|
+
export declare function traceBasePerformanceAsync<T>(label: string, fn: () => Promise<T>, details?: BasePerformanceDetails): Promise<T>;
|
|
5
|
+
export declare function logBasePerformance(label: string, duration: number, details?: BasePerformanceDetails): void;
|