@univerjs-pro/bases 1.0.0-alpha.1 → 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +8 -5
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/commands/commands/set-base-view-filter.command.d.ts +2 -2
  66. package/lib/types/commands/commands/set-base-view-group.command.d.ts +2 -2
  67. package/lib/types/commands/commands/set-base-view-sort.command.d.ts +2 -2
  68. package/lib/types/commands/utils/base-validation.d.ts +6 -0
  69. package/lib/types/config/config.d.ts +11 -0
  70. package/lib/types/controllers/base-active-dirty.controller.d.ts +5 -6
  71. package/lib/types/controllers/base-formula-calculation.controller.d.ts +8 -14
  72. package/lib/types/embed-host-anchor.d.ts +46 -0
  73. package/lib/types/facade/f-base.d.ts +126 -577
  74. package/lib/types/facade/f-enum.d.ts +117 -89
  75. package/lib/types/facade/f-event.d.ts +255 -132
  76. package/lib/types/facade/f-field.d.ts +137 -313
  77. package/lib/types/facade/f-range.d.ts +86 -326
  78. package/lib/types/facade/f-record.d.ts +93 -216
  79. package/lib/types/facade/f-table.d.ts +473 -1317
  80. package/lib/types/facade/f-types.d.ts +1 -0
  81. package/lib/types/facade/f-univer.d.ts +27 -154
  82. package/lib/types/facade/f-view.d.ts +207 -484
  83. package/lib/types/facade/field-key.d.ts +6 -6
  84. package/lib/types/facade/index.d.ts +11 -14
  85. package/lib/types/fields/field-core-plugin.d.ts +9 -8
  86. package/lib/types/index.d.ts +17 -47
  87. package/lib/types/models/base-cell-data.d.ts +6 -6
  88. package/lib/types/models/default-table.d.ts +13 -0
  89. package/lib/types/ot/json1-adapter.d.ts +3 -3
  90. package/lib/types/ot/json1-invalidation.d.ts +2 -2
  91. package/lib/types/ot/json1-op-applier.d.ts +2 -2
  92. package/lib/types/ot/json1-op-factory.d.ts +9 -8
  93. package/lib/types/plugin.d.ts +6 -4
  94. package/lib/types/search/base-search.d.ts +4 -3
  95. package/lib/types/services/base-active-dirty.service.d.ts +2 -2
  96. package/lib/types/services/base-command.service.d.ts +16 -16
  97. package/lib/types/services/base-compression.service.d.ts +3 -3
  98. package/lib/types/services/base-field-registry.service.d.ts +5 -5
  99. package/lib/types/services/base-formula.service.d.ts +11 -20
  100. package/lib/types/services/base-view-registry.service.d.ts +3 -3
  101. package/lib/types/views/view-core-plugin.d.ts +4 -3
  102. package/lib/umd/facade.js +1 -1
  103. package/lib/umd/index.js +1 -1
  104. package/lib/umd/locale/ar-SA.js +1 -1
  105. package/lib/umd/locale/ca-ES.js +1 -1
  106. package/lib/umd/locale/de-DE.js +1 -1
  107. package/lib/umd/locale/en-US.js +1 -1
  108. package/lib/umd/locale/es-ES.js +1 -1
  109. package/lib/umd/locale/fa-IR.js +1 -1
  110. package/lib/umd/locale/fr-FR.js +1 -1
  111. package/lib/umd/locale/id-ID.js +1 -1
  112. package/lib/umd/locale/it-IT.js +1 -1
  113. package/lib/umd/locale/ja-JP.js +1 -1
  114. package/lib/umd/locale/ko-KR.js +1 -1
  115. package/lib/umd/locale/pl-PL.js +1 -1
  116. package/lib/umd/locale/pt-BR.js +1 -1
  117. package/lib/umd/locale/ru-RU.js +1 -1
  118. package/lib/umd/locale/sk-SK.js +1 -1
  119. package/lib/umd/locale/vi-VN.js +1 -1
  120. package/lib/umd/locale/zh-CN.js +1 -1
  121. package/lib/umd/locale/zh-HK.js +1 -1
  122. package/lib/umd/locale/zh-TW.js +1 -1
  123. package/package.json +7 -8
  124. package/lib/types/controllers/base-remote-formula.controller.d.ts +0 -13
  125. package/lib/types/facade/f-error.d.ts +0 -30
  126. package/lib/types/facade/f-permission.d.ts +0 -749
  127. package/lib/types/facade/transaction.d.ts +0 -19
@@ -1,8 +1,8 @@
1
1
  import type { BaseCellValue, ITableSnapshot } from '@univerjs/core';
2
- import { BaseFieldKeyEnum } from './f-enum';
3
- export type BaseFieldKey = typeof BaseFieldKeyEnum[keyof typeof BaseFieldKeyEnum];
4
- export interface IBaseFieldKeyOptions {
5
- fieldKey?: BaseFieldKey;
2
+ export declare enum BaseFieldKeyEnum {
3
+ Id = "id",
4
+ Name = "name",
5
+ Auto = "auto"
6
6
  }
7
- export declare function resolveBaseFieldValues(table: ITableSnapshot, values: Record<string, BaseCellValue> | undefined, fieldKey?: BaseFieldKey): Record<string, BaseCellValue>;
8
- export declare function resolveBaseFieldKey(table: ITableSnapshot, key: string, fieldKey: BaseFieldKey): string;
7
+ export declare function resolveBaseFieldValues(table: ITableSnapshot, values: Record<string, BaseCellValue> | undefined, fieldKey?: BaseFieldKeyEnum): Record<string, BaseCellValue>;
8
+ export declare function resolveBaseFieldKey(table: ITableSnapshot, key: string, fieldKey: BaseFieldKeyEnum): string;
@@ -1,15 +1,12 @@
1
+ import './f-univer';
1
2
  import './f-enum';
2
- export { FBase, type IBaseSchemaSnapshot, type ICopyTableInput, type ICreateTableInput, type ISearchTableInput } from './f-base';
3
- export { BaseBatchEventModeEnum, BaseBatchUndoModeEnum, BaseErrorCodeEnum, BaseFieldKeyEnum, BaseFieldTypeEnum, BaseFilterOperatorEnum, BaseSortDirectionEnum, BaseViewTypeEnum, type IFBaseEnumMixin, } from './f-enum';
4
- export { assertBaseCommandSucceeded, BaseError, BaseErrorCode, type BaseErrorCodeType, type IBaseErrorDetails, isBaseError } from './f-error';
5
- export { BaseEventName } from './f-event';
6
- export type { IBaseCellValueChangedEvent, IBaseEventMap, IBaseFieldChangedEvent, IBaseRecordChangedEvent, IBaseTableChangedEvent, IBaseViewChangedEvent, } from './f-event';
7
- export { FField } from './f-field';
8
- export { FBasePermission, FTablePermission } from './f-permission';
9
- export { type BaseRangeValues, FBaseRange } from './f-range';
10
- export { FRecord } from './f-record';
11
- export { FTable, type IAddFieldInput, type IAddRecordInput, type IBaseRecordFilter, type IBaseTableSchemaSnapshot, type ICreateViewInput, type IListRecordOptions, type IQueryRecordsResult, type IUpdateRecordOptions, } from './f-table';
12
- export { FUniverBaseMixin, type IFUniverBaseMixin } from './f-univer';
13
- export { FView } from './f-view';
14
- export { type BaseFieldKey, type IBaseFieldKeyOptions, resolveBaseFieldKey, resolveBaseFieldValues } from './field-key';
15
- export { BaseTransactionContext } from './transaction';
3
+ export { FBase } from './f-base';
4
+ export type { IBaseSchemaSnapshot } from './f-base';
5
+ export * from './f-event';
6
+ export { FBaseTableField } from './f-field';
7
+ export { FBaseTableRange } from './f-range';
8
+ export { FBaseTableRecord } from './f-record';
9
+ export { FBaseTable } from './f-table';
10
+ export type { IBaseRecordFilter, IBaseRecordFilterCondition, IBaseTableSchemaSnapshot, IListRecordOptions, IQueryRecordsResult, } from './f-table';
11
+ export { FBaseTableView } from './f-view';
12
+ export { BaseFieldKeyEnum, resolveBaseFieldKey, resolveBaseFieldValues } from './field-key';
@@ -1,29 +1,30 @@
1
- import type { BaseCellValue as CellValue, FieldCapabilities, FieldConfig, FieldType, FilterOperator, IFieldSnapshot, ValidationResult } from '@univerjs/core';
1
+ import type { BaseCellValue, BaseFilterOperator, FieldConfig, IFieldCapabilities, IFieldSnapshot, IValidationResult } from '@univerjs/core';
2
+ import { BaseFieldType } from '@univerjs/core';
2
3
  export interface IFieldTypePlugin {
3
- type: FieldType;
4
+ type: BaseFieldType;
4
5
  enabled: boolean;
5
6
  visibleInCreateMenu: boolean;
6
7
  }
7
- export interface IFieldCorePlugin<TValue extends CellValue = CellValue, TConfig = FieldConfig> extends IFieldTypePlugin {
8
+ export interface IFieldCorePlugin<TValue extends BaseCellValue = BaseCellValue, TConfig = FieldConfig> extends IFieldTypePlugin {
8
9
  i18nKey: string;
9
10
  createDefaultConfig(): TConfig;
10
11
  createDefaultValue(field: IFieldSnapshot): TValue | null;
11
12
  normalize(input: unknown, field: IFieldSnapshot): TValue | null;
12
- validate(value: unknown, field: IFieldSnapshot): ValidationResult;
13
+ validate(value: unknown, field: IFieldSnapshot): IValidationResult;
13
14
  compare(a: TValue | null, b: TValue | null, field: IFieldSnapshot): number;
14
- filter(value: TValue | null, operator: FilterOperator | string, operand: unknown, field: IFieldSnapshot): boolean;
15
+ filter(value: TValue | null, operator: BaseFilterOperator | string, operand: unknown, field: IFieldSnapshot): boolean;
15
16
  toPlainText(value: TValue | null, field: IFieldSnapshot): string;
16
17
  fromPlainText(text: string, field: IFieldSnapshot): TValue | null;
17
- getCapabilities(field: IFieldSnapshot): FieldCapabilities;
18
+ getCapabilities(field: IFieldSnapshot): IFieldCapabilities;
18
19
  }
19
20
  export type BaseConditionDateMode = 'exact' | 'today' | 'tomorrow' | 'yesterday' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'past7' | 'next7' | 'past30' | 'next30';
20
21
  export interface IBaseConditionMatchOptions {
21
22
  dateMode?: BaseConditionDateMode;
22
23
  now?: number;
23
24
  }
24
- export declare function matchesBaseCondition(value: unknown, operator: string, operand: unknown, field: Pick<IFieldSnapshot, 'type'> & {
25
+ export declare function matchesBaseCondition(value: unknown, operator: BaseFilterOperator | string, operand: unknown, field: Pick<IFieldSnapshot, 'type'> & {
25
26
  config?: FieldConfig;
26
27
  }, options?: IBaseConditionMatchOptions): boolean;
27
28
  export declare function createCoreFieldPlugins(): IFieldCorePlugin[];
28
29
  export type FieldTypePlugin = IFieldTypePlugin;
29
- export type FieldCorePlugin<TValue extends CellValue = CellValue, TConfig = FieldConfig> = IFieldCorePlugin<TValue, TConfig>;
30
+ export type FieldCorePlugin<TValue extends BaseCellValue = BaseCellValue, TConfig = FieldConfig> = IFieldCorePlugin<TValue, TConfig>;
@@ -24,8 +24,8 @@ export { DuplicateBaseFieldCommand } from './commands/commands/duplicate-base-fi
24
24
  export type { IDuplicateBaseFieldCommandParams } from './commands/commands/duplicate-base-field.command';
25
25
  export { DuplicateBaseRecordCommand } from './commands/commands/duplicate-base-record.command';
26
26
  export type { IDuplicateBaseRecordCommandParams } from './commands/commands/duplicate-base-record.command';
27
- export { EnsureBaseTemporalViewDateFieldsCommand, } from './commands/commands/ensure-base-temporal-view-date-fields.command';
28
- export type { IEnsureBaseTemporalViewDateFieldsCommandParams, } from './commands/commands/ensure-base-temporal-view-date-fields.command';
27
+ export { EnsureBaseTemporalViewDateFieldsCommand } from './commands/commands/ensure-base-temporal-view-date-fields.command';
28
+ export type { IEnsureBaseTemporalViewDateFieldsCommandParams } from './commands/commands/ensure-base-temporal-view-date-fields.command';
29
29
  export { MoveBaseFieldCommand } from './commands/commands/move-base-field.command';
30
30
  export type { IMoveBaseFieldCommandParams } from './commands/commands/move-base-field.command';
31
31
  export { MoveBaseViewCommand } from './commands/commands/move-base-view.command';
@@ -55,7 +55,7 @@ export type { ISetBaseViewSortCommandParams } from './commands/commands/set-base
55
55
  export { UpdateBaseCellCommand } from './commands/commands/update-base-cell.command';
56
56
  export type { IUpdateBaseCellCommandParams } from './commands/commands/update-base-cell.command';
57
57
  export { UpdateBaseFieldDescriptionCommand } from './commands/commands/update-base-field-description.command';
58
- export type { IUpdateBaseFieldDescriptionCommandParams, } from './commands/commands/update-base-field-description.command';
58
+ export type { IUpdateBaseFieldDescriptionCommandParams } from './commands/commands/update-base-field-description.command';
59
59
  export { UpdateBaseFieldCommand } from './commands/commands/update-base-field.command';
60
60
  export type { IUpdateBaseFieldCommandParams } from './commands/commands/update-base-field.command';
61
61
  export { UpdateBaseKanbanConfigCommand } from './commands/commands/update-base-kanban-config.command';
@@ -66,53 +66,23 @@ export { UpdateBaseViewConfigCommand } from './commands/commands/update-base-vie
66
66
  export type { IUpdateBaseViewConfigCommandParams } from './commands/commands/update-base-view-config.command';
67
67
  export { ApplyBaseJson1Mutation } from './commands/mutations/apply-base-json1.mutation';
68
68
  export type { IApplyBaseJson1MutationParams } from './commands/mutations/apply-base-json1.mutation';
69
- export { BaseActiveDirtyController } from './controllers/base-active-dirty.controller';
70
- export { BaseFormulaCalculationController } from './controllers/base-formula-calculation.controller';
71
- export { baseDateSerialToDateMs, dateToExcelSerial, excelSerialToDateMs, formatBaseDateValue, normalizeBaseDateSerial, } from './fields/date-format';
72
- export { createCoreFieldPlugins, matchesBaseCondition } from './fields/field-core-plugin';
73
- export type { BaseConditionDateMode, IBaseConditionMatchOptions, IFieldCorePlugin, IFieldTypePlugin, } from './fields/field-core-plugin';
74
- export type { FieldCorePlugin, FieldTypePlugin } from './fields/field-core-plugin';
75
- export { buildBaseNumberFormatPattern, formatBaseNumberValue, inferBaseSeparatorStyle } from './fields/number-format';
76
- export type { IBaseNumberFormatConfig } from './fields/number-format';
77
- export type { BaseNumberFormatConfig } from './fields/number-format';
69
+ export { createEmbedBasesTable, createEmbedBasesTableAddMutation, createEmbedBasesTableRemoveMutation, EMBED_BASES_TABLE_RESOURCE_KEY, } from './embed-host-anchor';
70
+ export { baseDateSerialToDateMs, dateToExcelSerial, formatBaseDateValue, normalizeBaseDateSerial, } from './fields/date-format';
71
+ export { matchesBaseCondition } from './fields/field-core-plugin';
72
+ export { formatBaseNumberValue, inferBaseSeparatorStyle, } from './fields/number-format';
78
73
  export { uniqueFieldName } from './fields/util';
79
- export { ensureBaseTableCellLayout, fromBaseCellData, getBaseAttachmentResourceKey, getBaseCell, getBaseCellFormulaValue, getBaseCellValue, normalizeAttachmentValue, readAttachmentResources, setBaseCell, toBaseCellData, toBaseRecordValue, writeAttachmentResources, } from './models/base-cell-data';
74
+ export { ensureBaseTableCellLayout, getBaseCellFormulaValue, getBaseCellValue, } from './models/base-cell-data';
80
75
  export { copyBaseTableSnapshot } from './models/base-table-copy';
81
- export type { ICopyBaseTableSnapshotOptions } from './models/base-table-copy';
82
- export { BaseJson1Adapter } from './ot/json1-adapter';
83
- export type { BaseJson1Command, IBaseCollaborativeOp, IBaseJson1Adapter } from './ot/json1-adapter';
84
- export type { BaseCollaborativeOp } from './ot/json1-adapter';
85
- export { getBaseInvalidationsFromJson1 } from './ot/json1-invalidation';
76
+ export { createDefaultBaseTableSnapshot } from './models/default-table';
86
77
  export { BaseJson1OpApplier } from './ot/json1-op-applier';
87
78
  export { BaseJson1OpFactory } from './ot/json1-op-factory';
88
- export type { ICreateFieldOpInput, ISetRangeValuesPatch, ISetRecordValuesPatch } from './ot/json1-op-factory';
89
- export type { CreateFieldOpInput, SetRangeValuesPatch, SetRecordValuesPatch } from './ot/json1-op-factory';
90
- export { baseJson1Path } from './ot/json1-path';
91
- export { composeJson1Ops } from './ot/json1-util';
92
- export { BASE_SYNC_MUTATIONS, BASES_PLUGIN_NAME, UniverBasesPlugin, UniverRemoteBasesPlugin } from './plugin';
79
+ export { UniverBasesPlugin, UniverRemoteBasesPlugin, } from './plugin';
93
80
  export { searchBaseTable } from './search/base-search';
94
- export type { IBaseTableSearchMatch, IBaseTableSearchRequest, IBaseTableSearchResult } from './search/base-search';
95
- export type { BaseTableSearchMatch, BaseTableSearchRequest, BaseTableSearchResult } from './search/base-search';
96
- export { createBaseStructureDirtySuperTableMap, setBaseRangeValuesToDirtyRanges, } from './services/base-active-dirty.service';
97
- export type { BaseFormulaDirtySuperTableMap, IBaseFormulaDirtyRange, IBaseRangeValueDirtyParams, } from './services/base-active-dirty.service';
98
- export type { BaseFormulaDirtyRange, } from './services/base-active-dirty.service';
99
- export { BaseCommandService, IBaseCommandService } from './services/base-command.service';
100
- export type { IBaseCommandRuntimeContext } from './services/base-command.service';
101
- export type { BaseCommandRuntimeContext } from './services/base-command.service';
102
- export { compressBaseRangeValuesPayload, compressBaseSnapshot, decompressBaseRangeValuesPayload, decompressBaseSnapshot, isCompressedBaseRangeValuesPayload, isCompressedBaseSnapshot, } from './services/base-compression.service';
103
- export type { CompressedBaseRangeValue, IBaseRangeValuesPayload, ICompressedBaseCellData, ICompressedBaseRangeValuesPayload, ICompressedBaseSnapshot, ICompressedBaseTableSnapshot, } from './services/base-compression.service';
104
- export type { BaseRangeValuesPayload, CompressedBaseCellData, CompressedBaseRangeValuesPayload, CompressedBaseSnapshot, CompressedBaseTableSnapshot, } from './services/base-compression.service';
105
- export { BaseFieldRegistryService, IBaseFieldRegistryService } from './services/base-field-registry.service';
106
- export { BaseFormulaService, createBaseFormulaCalculationDataset, createBaseFormulaResultPatches, } from './services/base-formula.service';
107
- export type { IBaseFormulaCalculationDataset, IBaseFormulaCalculationResult, IBaseFormulaDependency, IBaseFormulaResultPatchGroup, IBaseFormulaSuperTableReference, IBaseFormulaSuperTableServiceLike, IBaseFormulaValidationResult, } from './services/base-formula.service';
108
- export type { BaseFormulaSuperTableReference, BaseFormulaSuperTableServiceLike, BaseFormulaValidationResult, } from './services/base-formula.service';
109
- export { isBasePerformanceTracingEnabled, logBasePerformance, traceBasePerformance, traceBasePerformanceAsync, } from './services/base-performance.service';
110
- export type { BasePerformanceDetails } from './services/base-performance.service';
111
- export { BasePermissionService, IBasePermissionService } from './services/base-permission.service';
81
+ export type { IBaseTableSearchRequest } from './search/base-search';
82
+ export type { BaseTableSearchMatch, IBaseTableSearchResult, } from './search/base-search';
83
+ export { IBaseCommandService } from './services/base-command.service';
84
+ export { traceBasePerformance } from './services/base-performance.service';
85
+ export { IBasePermissionService } from './services/base-permission.service';
112
86
  export type { BaseFieldPermission, BasePermissionSnapshot, BaseRecordPermission, BaseTablePermission, } from './services/base-permission.service';
113
- export { BaseProjectionService, IBaseProjectionService } from './services/base-projection.service';
114
- export { BaseResourceService, IBaseResourceService } from './services/base-resource.service';
115
- export { BaseViewRegistryService, IBaseViewRegistryService } from './services/base-view-registry.service';
116
- export { createCoreViewPlugins } from './views/view-core-plugin';
117
- export type { IProjectionContext, IViewCorePlugin, IViewRepairResult } from './views/view-core-plugin';
118
- export type { ProjectionContext, ViewCorePlugin, ViewRepairResult } from './views/view-core-plugin';
87
+ export { IBaseProjectionService } from './services/base-projection.service';
88
+ export { IBaseViewRegistryService } from './services/base-view-registry.service';
@@ -1,4 +1,4 @@
1
- import type { BaseCellValue as CellValue, IBaseCellData, IFieldSnapshot, ITableSnapshot, RecordId } from '@univerjs/core';
1
+ import type { BaseCellValue, IBaseCellData, IFieldSnapshot, ITableSnapshot, RecordId } from '@univerjs/core';
2
2
  export declare function ensureBaseTableCellLayout(table: ITableSnapshot): ITableSnapshot;
3
3
  export declare function syncBaseRecordValuesFromCellData(table: ITableSnapshot): ITableSnapshot;
4
4
  export declare function syncBaseRecordValuesFromCellDataRange(table: ITableSnapshot, cells: Array<{
@@ -10,12 +10,12 @@ export declare function getBaseCellLayoutPosition(table: ITableSnapshot, recordI
10
10
  col: number;
11
11
  } | null;
12
12
  export declare function getBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData | undefined;
13
- export declare function getBaseCellValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): CellValue;
13
+ export declare function getBaseCellValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): BaseCellValue;
14
14
  export declare function getBaseCellFormulaValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData['v'];
15
- export declare function setBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: CellValue | IBaseCellData): void;
16
- export declare function toBaseCellData(value: CellValue | IBaseCellData, field?: IFieldSnapshot): IBaseCellData;
17
- export declare function fromBaseCellData(cell: IBaseCellData | undefined, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): CellValue;
18
- export declare function toBaseRecordValue(value: CellValue | IBaseCellData, cell: IBaseCellData, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): CellValue;
15
+ export declare function setBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: BaseCellValue | IBaseCellData): void;
16
+ export declare function toBaseCellData(value: BaseCellValue | IBaseCellData, field?: IFieldSnapshot): IBaseCellData;
17
+ export declare function fromBaseCellData(cell: IBaseCellData | undefined, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): BaseCellValue;
18
+ export declare function toBaseRecordValue(value: BaseCellValue | IBaseCellData, cell: IBaseCellData, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): BaseCellValue;
19
19
  export declare function getBaseAttachmentResourceKey(fieldId: string, recordId: RecordId): string;
20
20
  export declare function writeAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: unknown): void;
21
21
  export declare function readAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string): Record<string, unknown>[] | null;
@@ -0,0 +1,13 @@
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
+ recordNamePrefix?: string;
10
+ now?: number;
11
+ }
12
+ export declare function createDefaultBaseTableSnapshot(options: ICreateDefaultBaseTableSnapshotOptions): ITableSnapshot;
13
+ export type CreateDefaultBaseTableSnapshotOptions = ICreateDefaultBaseTableSnapshotOptions;
@@ -1,4 +1,4 @@
1
- import type { BaseInvalidation, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
1
+ import type { IBaseInvalidation, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
2
2
  export type BaseJson1Command = {
3
3
  type: 'createTable';
4
4
  table: ITableSnapshot;
@@ -89,7 +89,7 @@ export interface IBaseJson1Adapter {
89
89
  createOp(command: BaseJson1Command, snapshot: IBaseSnapshot): JSONXActions;
90
90
  applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
91
91
  invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
92
- getAffectedRanges(op: JSONXActions): BaseInvalidation[];
92
+ getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
93
93
  }
94
94
  export declare class BaseJson1Adapter implements IBaseJson1Adapter {
95
95
  private readonly _factory;
@@ -98,6 +98,6 @@ export declare class BaseJson1Adapter implements IBaseJson1Adapter {
98
98
  createCollaborativeOp(input: Omit<IBaseCollaborativeOp, 'unitType'>): IBaseCollaborativeOp;
99
99
  applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
100
100
  invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
101
- getAffectedRanges(op: JSONXActions): BaseInvalidation[];
101
+ getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
102
102
  }
103
103
  export type BaseCollaborativeOp = IBaseCollaborativeOp;
@@ -1,2 +1,2 @@
1
- import type { BaseInvalidation, JSONXActions } from '@univerjs/core';
2
- export declare function getBaseInvalidationsFromJson1(op: JSONXActions): BaseInvalidation[];
1
+ import type { IBaseInvalidation, JSONXActions } from '@univerjs/core';
2
+ export declare function getBaseInvalidationsFromJson1(op: JSONXActions): IBaseInvalidation[];
@@ -1,7 +1,7 @@
1
- import type { BaseInvalidation, IBaseSnapshot, JSONXActions } from '@univerjs/core';
1
+ import type { IBaseInvalidation, IBaseSnapshot, JSONXActions } from '@univerjs/core';
2
2
  export declare class BaseJson1OpApplier {
3
3
  applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
4
4
  invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
5
- getAffectedRanges(op: JSONXActions): BaseInvalidation[];
5
+ getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
6
6
  private _getTablesToNormalize;
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { BaseCellValue as CellValue, FilterConfig, GroupConfig, IBaseCellData, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions, SortConfig, TableId } from '@univerjs/core';
1
+ import type { BaseCellValue, IBaseCellData, IBaseSnapshot, IFieldSnapshot, IFilterConfig, IGroupConfig, IRecordSnapshot, ISortConfig, ITableSnapshot, IViewSnapshot, JSONXActions, TableId } from '@univerjs/core';
2
2
  export interface ICreateFieldOpInput {
3
3
  field: IFieldSnapshot;
4
4
  index?: number;
@@ -6,13 +6,13 @@ export interface ICreateFieldOpInput {
6
6
  }
7
7
  export interface ISetRecordValuesPatch {
8
8
  recordId: string;
9
- values: Record<string, CellValue>;
9
+ values: Record<string, BaseCellValue>;
10
10
  recordPatch?: Partial<Pick<IRecordSnapshot, 'updatedAt' | 'updatedBy'>>;
11
11
  }
12
12
  export interface ISetRangeValuesPatch {
13
13
  row: number;
14
14
  col: number;
15
- value: CellValue | IBaseCellData | null;
15
+ value: BaseCellValue | IBaseCellData | null;
16
16
  }
17
17
  export declare class BaseJson1OpFactory {
18
18
  createTable(snapshot: IBaseSnapshot, table: ITableSnapshot, index?: number): JSONXActions;
@@ -24,7 +24,7 @@ export declare class BaseJson1OpFactory {
24
24
  deleteRecords(snapshot: IBaseSnapshot, tableId: TableId, recordIds: string[]): JSONXActions;
25
25
  duplicateRecord(snapshot: IBaseSnapshot, tableId: TableId, sourceRecordId: string, record: IRecordSnapshot): JSONXActions;
26
26
  updateRecordOrder(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, orderKey: string): JSONXActions;
27
- updateCell(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, fieldId: string, value: CellValue): JSONXActions;
27
+ updateCell(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
28
28
  setRecordValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRecordValuesPatch[]): JSONXActions;
29
29
  setRangeValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRangeValuesPatch[]): JSONXActions;
30
30
  createField(snapshot: IBaseSnapshot, tableId: TableId, input: ICreateFieldOpInput): JSONXActions;
@@ -44,9 +44,9 @@ export declare class BaseJson1OpFactory {
44
44
  afterViewId?: string;
45
45
  }): JSONXActions;
46
46
  updateViewConfig(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, patch: Record<string, unknown>): JSONXActions;
47
- setViewFilter(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, filter: FilterConfig | null): JSONXActions;
48
- setViewSort(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, sort: SortConfig[]): JSONXActions;
49
- setViewGroup(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, group: GroupConfig[]): JSONXActions;
47
+ setViewFilter(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, filter: IFilterConfig | null): JSONXActions;
48
+ setViewSort(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, sort: ISortConfig[]): JSONXActions;
49
+ setViewGroup(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, group: IGroupConfig[]): JSONXActions;
50
50
  setViewFieldVisible(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, visible: boolean): JSONXActions;
51
51
  setViewFieldWidth(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, width: number): JSONXActions;
52
52
  setViewFieldOrder(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, target: {
@@ -54,12 +54,13 @@ export declare class BaseJson1OpFactory {
54
54
  afterFieldId?: string;
55
55
  }): JSONXActions;
56
56
  private _setViewFieldSetting;
57
- private _setDeleted;
58
57
  private _createRecordOrderOp;
59
58
  private _setFormulaFieldCells;
60
59
  private _setAttachmentResources;
60
+ private _deleteAttachmentResources;
61
61
  private _replaceOptional;
62
62
  }
63
+ export declare function renameBaseFormulaTableReferences(formula: string, oldName: string, newName: string): string;
63
64
  export type CreateFieldOpInput = ICreateFieldOpInput;
64
65
  export type SetRecordValuesPatch = ISetRecordValuesPatch;
65
66
  export type SetRangeValuesPatch = ISetRangeValuesPatch;
@@ -1,4 +1,5 @@
1
- import { ICommandService, Injector, IUniverInstanceService, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import type { IUniverBasesConfig, IUniverRemoteBasesConfig } from './config/config';
2
+ import { ICommandService, IConfigService, Injector, IUniverInstanceService, Plugin, UniverInstanceType } from '@univerjs/core';
2
3
  import { DataSyncPrimaryController } from '@univerjs/rpc';
3
4
  export declare const BASES_PLUGIN_NAME = "BASES_PLUGIN";
4
5
  export declare const BASE_SYNC_MUTATIONS: readonly [import("@univerjs/core").IMutation<import(".").IApplyBaseJson1MutationParams, boolean>];
@@ -7,13 +8,14 @@ export declare class UniverBasesPlugin extends Plugin {
7
8
  protected readonly _injector: Injector;
8
9
  private readonly _commandService;
9
10
  private readonly _univerInstanceService;
11
+ private readonly _configService;
10
12
  private readonly _dataSyncPrimaryController?;
11
13
  static pluginName: string;
12
14
  static packageName: string;
13
15
  static version: string;
14
16
  static type: UniverInstanceType;
15
17
  private readonly _baseSyncDisposables;
16
- constructor(_config: {} | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
18
+ constructor(_config: Partial<IUniverBasesConfig> | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
17
19
  onReady(): void;
18
20
  private _initDependencies;
19
21
  private _initCommands;
@@ -25,11 +27,11 @@ export declare class UniverRemoteBasesPlugin extends Plugin {
25
27
  private readonly _config;
26
28
  protected readonly _injector: Injector;
27
29
  private readonly _commandService;
30
+ private readonly _configService;
28
31
  private readonly _univerInstanceService;
29
32
  static pluginName: string;
30
33
  static packageName: string;
31
34
  static version: string;
32
35
  static type: UniverInstanceType;
33
- constructor(_config: {} | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
34
- onReady(): void;
36
+ constructor(_config: Partial<IUniverRemoteBasesConfig> | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
35
37
  }
@@ -1,7 +1,8 @@
1
- import type { FieldId, FieldType, ITableSnapshot, ProjectedRow, RecordId } from '@univerjs/core';
1
+ import type { FieldId, IProjectedRow, ITableSnapshot, RecordId } from '@univerjs/core';
2
+ import { BaseFieldType } from '@univerjs/core';
2
3
  export interface IBaseTableSearchRequest {
3
4
  table: ITableSnapshot;
4
- rows: ReadonlyArray<Pick<ProjectedRow, 'recordId' | 'values'>>;
5
+ rows: ReadonlyArray<Pick<IProjectedRow, 'recordId' | 'values'>>;
5
6
  query: string;
6
7
  fieldIds: ReadonlyArray<FieldId>;
7
8
  limit?: number;
@@ -9,7 +10,7 @@ export interface IBaseTableSearchRequest {
9
10
  export interface IBaseTableSearchMatch {
10
11
  recordId: RecordId;
11
12
  fieldId: FieldId;
12
- fieldType: FieldType;
13
+ fieldType: BaseFieldType;
13
14
  text: string;
14
15
  score: number;
15
16
  }
@@ -1,11 +1,11 @@
1
- import type { BaseCellValue as CellValue, IBaseCellData } from '@univerjs/core';
1
+ import type { BaseCellValue, IBaseCellData } from '@univerjs/core';
2
2
  export interface IBaseRangeValueDirtyParams {
3
3
  unitId: string;
4
4
  tableId: string;
5
5
  patches: Array<{
6
6
  row: number;
7
7
  col: number;
8
- value: CellValue | IBaseCellData | null;
8
+ value: BaseCellValue | IBaseCellData | null;
9
9
  }>;
10
10
  }
11
11
  export interface IBaseFormulaDirtyRange {
@@ -1,4 +1,4 @@
1
- import type { BaseDataModel, BaseCellValue as CellValue, FilterConfig, GroupConfig, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions, SortConfig } from '@univerjs/core';
1
+ import type { BaseCellValue, BaseDataModel, IFieldSnapshot, IFilterConfig, IGroupConfig, IRecordSnapshot, ISortConfig, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
2
2
  import { BaseFieldRegistryService } from './base-field-registry.service';
3
3
  import { IBasePermissionService } from './base-permission.service';
4
4
  export interface IBaseCommandRuntimeContext {
@@ -11,10 +11,10 @@ export interface IBaseCommandRuntimeContext {
11
11
  } | null | undefined;
12
12
  }
13
13
  export interface IBaseCommandService {
14
- createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): JSONXActions;
14
+ createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
15
15
  createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
16
16
  recordId: string;
17
- values: Record<string, CellValue>;
17
+ values: Record<string, BaseCellValue>;
18
18
  }>): JSONXActions;
19
19
  createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
20
20
  createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
@@ -22,10 +22,10 @@ export interface IBaseCommandService {
22
22
  createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
23
23
  renameTable(base: BaseDataModel, tableId: string, name: string): void;
24
24
  deleteTable(base: BaseDataModel, tableId: string): void;
25
- updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): void;
25
+ updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): void;
26
26
  setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
27
27
  recordId: string;
28
- values: Record<string, CellValue>;
28
+ values: Record<string, BaseCellValue>;
29
29
  }>): void;
30
30
  createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
31
31
  deleteRecord(base: BaseDataModel, tableId: string, recordId: string): void;
@@ -47,9 +47,9 @@ export interface IBaseCommandService {
47
47
  afterViewId?: string;
48
48
  }): void;
49
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;
50
+ setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: IFilterConfig | null): void;
51
+ setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: ISortConfig[]): void;
52
+ setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: IGroupConfig[]): void;
53
53
  setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
54
54
  setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
55
55
  setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
@@ -68,16 +68,16 @@ export declare class BaseCommandService implements IBaseCommandService {
68
68
  createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
69
69
  renameTable(base: BaseDataModel, tableId: string, name: string): void;
70
70
  deleteTable(base: BaseDataModel, tableId: string): void;
71
- updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): void;
71
+ updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): void;
72
72
  setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
73
73
  recordId: string;
74
- values: Record<string, CellValue>;
74
+ values: Record<string, BaseCellValue>;
75
75
  }>): void;
76
76
  createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
77
- createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: CellValue): JSONXActions;
77
+ createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
78
78
  createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
79
79
  recordId: string;
80
- values: Record<string, CellValue>;
80
+ values: Record<string, BaseCellValue>;
81
81
  }>): JSONXActions;
82
82
  createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
83
83
  createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
@@ -101,9 +101,9 @@ export declare class BaseCommandService implements IBaseCommandService {
101
101
  afterViewId?: string;
102
102
  }): void;
103
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;
104
+ setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: IFilterConfig | null): void;
105
+ setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: ISortConfig[]): void;
106
+ setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: IGroupConfig[]): void;
107
107
  setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
108
108
  setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
109
109
  setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
@@ -118,7 +118,7 @@ export declare class BaseCommandService implements IBaseCommandService {
118
118
  private _createNumberingAllocators;
119
119
  private _createNumberingAllocator;
120
120
  private _createNumberingFieldValuePatches;
121
- private _getOrderedActiveRecords;
121
+ private _getOrderedRecords;
122
122
  private _isNonEmptyCellValue;
123
123
  private _getCurrentUserId;
124
124
  private _normalizeCellValue;
@@ -1,11 +1,11 @@
1
- import type { BaseCellValue as CellValue, IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
1
+ import type { BaseCellValue, IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
2
2
  export interface IBaseRangeValuesPayload {
3
3
  unitId: string;
4
4
  tableId: string;
5
5
  patches: Array<{
6
6
  row: number;
7
7
  col: number;
8
- value: CellValue | IBaseCellData | null;
8
+ value: BaseCellValue | IBaseCellData | null;
9
9
  }>;
10
10
  trigger?: string;
11
11
  }
@@ -24,7 +24,7 @@ export interface ICompressedBaseCellData {
24
24
  si?: IBaseCellData['si'];
25
25
  p?: IBaseCellData['p'];
26
26
  }
27
- export type CompressedBaseRangeValue = CellValue | ICompressedBaseCellData | null;
27
+ export type CompressedBaseRangeValue = BaseCellValue | ICompressedBaseCellData | null;
28
28
  export interface ICompressedBaseTableSnapshot extends Omit<ITableSnapshot, 'cellData'> {
29
29
  cd?: Array<[number, number, ICompressedBaseCellData]>;
30
30
  }
@@ -1,17 +1,17 @@
1
- import type { FieldType } from '@univerjs/core';
1
+ import type { BaseFieldType } from '@univerjs/core';
2
2
  import type { IFieldCorePlugin, IFieldTypePlugin } from '../fields/field-core-plugin';
3
3
  import { Disposable, toDisposable } from '@univerjs/core';
4
4
  export interface IBaseFieldRegistryService {
5
5
  register(plugin: IFieldCorePlugin): ReturnType<typeof toDisposable>;
6
- get(type: FieldType): IFieldCorePlugin;
7
- getTypePlugin(type: FieldType): IFieldTypePlugin | undefined;
6
+ get(type: BaseFieldType): IFieldCorePlugin;
7
+ getTypePlugin(type: BaseFieldType): IFieldTypePlugin | undefined;
8
8
  getAll(): IFieldCorePlugin[];
9
9
  }
10
10
  export declare const IBaseFieldRegistryService: import("@wendellhu/redi").IdentifierDecorator<IBaseFieldRegistryService>;
11
11
  export declare class BaseFieldRegistryService extends Disposable implements IBaseFieldRegistryService {
12
12
  private readonly _plugins;
13
13
  register(plugin: IFieldCorePlugin): import("@wendellhu/redi").IDisposable;
14
- get(type: FieldType): IFieldCorePlugin;
15
- getTypePlugin(type: FieldType): IFieldTypePlugin | undefined;
14
+ get(type: BaseFieldType): IFieldCorePlugin;
15
+ getTypePlugin(type: BaseFieldType): IFieldTypePlugin | undefined;
16
16
  getAll(): IFieldCorePlugin[];
17
17
  }
@@ -1,3 +1,4 @@
1
+ import type { ISuperTable, ISuperTableService } from '@univerjs-pro/engine-formula';
1
2
  import type { IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
2
3
  import { ObjectMatrix } from '@univerjs/core';
3
4
  export interface IBaseFormulaValidationResult {
@@ -11,20 +12,6 @@ export interface IBaseFormulaDependency {
11
12
  export interface IBaseFormulaContext {
12
13
  snapshot?: IBaseSnapshot;
13
14
  }
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
15
  export interface IBaseFormulaCalculationDataset {
29
16
  formulaData: Record<string, Record<string, Record<number, Record<number, {
30
17
  f: string;
@@ -44,6 +31,11 @@ export interface IBaseFormulaCalculationResult {
44
31
  unitData?: Record<string, Record<string, Record<number, Record<number, IBaseCellData | null>> | null> | null>;
45
32
  unitOtherData?: unknown;
46
33
  }
34
+ export interface IBaseSuperTableRegistration {
35
+ tableId: string;
36
+ tableName: string;
37
+ reference: ISuperTable;
38
+ }
47
39
  export interface IBaseFormulaResultPatchGroup {
48
40
  unitId: string;
49
41
  tableId: string;
@@ -54,12 +46,13 @@ export interface IBaseFormulaResultPatchGroup {
54
46
  }>;
55
47
  }
56
48
  export declare class BaseFormulaService {
57
- createSuperTableReference(table: ITableSnapshot, sheetId?: string): IBaseFormulaSuperTableReference;
58
- registerSuperTable(superTableService: IBaseFormulaSuperTableServiceLike, unitId: string, table: ITableSnapshot, options?: {
49
+ createSuperTableReference(table: ITableSnapshot, sheetId?: string): ISuperTable;
50
+ registerSuperTable(superTableService: ISuperTableService, unitId: string, table: ITableSnapshot, options?: {
59
51
  tableName?: string;
60
52
  sheetId?: string;
61
- }): IBaseFormulaSuperTableReference;
62
- registerSuperTables(superTableService: IBaseFormulaSuperTableServiceLike, snapshot: IBaseSnapshot): IBaseFormulaSuperTableReference[];
53
+ }): ISuperTable;
54
+ registerSuperTables(superTableService: ISuperTableService, snapshot: IBaseSnapshot): ISuperTable[];
55
+ getSuperTableRegistrations(snapshot: IBaseSnapshot, tableIds?: Iterable<string>): IBaseSuperTableRegistration[];
63
56
  validateFormula(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaValidationResult;
64
57
  getDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): string[];
65
58
  getStructuredDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaDependency[];
@@ -67,5 +60,3 @@ export declare class BaseFormulaService {
67
60
  export declare function createBaseFormulaCalculationDataset(snapshot: IBaseSnapshot): IBaseFormulaCalculationDataset;
68
61
  export declare function createBaseFormulaResultPatches(snapshot: IBaseSnapshot, result: IBaseFormulaCalculationResult): IBaseFormulaResultPatchGroup[];
69
62
  export type BaseFormulaValidationResult = IBaseFormulaValidationResult;
70
- export type BaseFormulaSuperTableReference = IBaseFormulaSuperTableReference;
71
- export type BaseFormulaSuperTableServiceLike = IBaseFormulaSuperTableServiceLike;
@@ -1,15 +1,15 @@
1
- import type { ViewType } from '@univerjs/core';
1
+ import type { BaseViewType } from '@univerjs/core';
2
2
  import type { IViewCorePlugin } from '../views/view-core-plugin';
3
3
  import { Disposable, toDisposable } from '@univerjs/core';
4
4
  export interface IBaseViewRegistryService {
5
5
  register(plugin: IViewCorePlugin): ReturnType<typeof toDisposable>;
6
- get(type: ViewType): IViewCorePlugin;
6
+ get(type: BaseViewType): IViewCorePlugin;
7
7
  getAll(): IViewCorePlugin[];
8
8
  }
9
9
  export declare const IBaseViewRegistryService: import("@wendellhu/redi").IdentifierDecorator<IBaseViewRegistryService>;
10
10
  export declare class BaseViewRegistryService extends Disposable implements IBaseViewRegistryService {
11
11
  private readonly _plugins;
12
12
  register(plugin: IViewCorePlugin): import("@wendellhu/redi").IDisposable;
13
- get(type: ViewType): IViewCorePlugin;
13
+ get(type: BaseViewType): IViewCorePlugin;
14
14
  getAll(): IViewCorePlugin[];
15
15
  }