@univerjs/core 0.1.4 → 0.1.5

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 (85) hide show
  1. package/lib/cjs/index.js +8 -8
  2. package/lib/es/index.js +1075 -1058
  3. package/lib/types/basics/plugin-holder.d.ts +5 -19
  4. package/lib/types/basics/univer-doc.d.ts +5 -19
  5. package/lib/types/basics/univer-sheet.d.ts +5 -20
  6. package/lib/types/basics/univer-slide.d.ts +5 -19
  7. package/lib/types/basics/univer.d.ts +9 -23
  8. package/lib/types/common/interceptor.d.ts +2 -16
  9. package/lib/types/docs/data-model/action-types.d.ts +3 -17
  10. package/lib/types/docs/data-model/apply-utils/common.d.ts +2 -16
  11. package/lib/types/docs/data-model/apply-utils/delete-apply.d.ts +2 -16
  12. package/lib/types/docs/data-model/apply-utils/insert-apply.d.ts +2 -16
  13. package/lib/types/docs/data-model/apply-utils/update-apply.d.ts +2 -16
  14. package/lib/types/docs/data-model/document-data-model.d.ts +8 -22
  15. package/lib/types/docs/data-model/empty-snapshot.d.ts +2 -16
  16. package/lib/types/docs/data-model/preset-list-type.d.ts +1 -15
  17. package/lib/types/docs/data-model/replacement.d.ts +2 -16
  18. package/lib/types/docs/data-model/text-x/action-iterator.d.ts +2 -17
  19. package/lib/types/docs/data-model/text-x/text-x.d.ts +4 -18
  20. package/lib/types/docs/data-model/text-x/utils.d.ts +3 -17
  21. package/lib/types/index.d.ts +1 -0
  22. package/lib/types/observer/observable-hooks.d.ts +3 -18
  23. package/lib/types/observer/observable.d.ts +2 -16
  24. package/lib/types/plugin/plugin.d.ts +2 -16
  25. package/lib/types/services/command/command.service.d.ts +6 -21
  26. package/lib/types/services/config/config.service.d.ts +3 -17
  27. package/lib/types/services/context/context.service.d.ts +3 -17
  28. package/lib/types/services/error/error.service.d.ts +2 -16
  29. package/lib/types/services/floating-object/floating-object-manager.service.d.ts +6 -20
  30. package/lib/types/services/instance/instance.service.d.ts +9 -23
  31. package/lib/types/services/lifecycle/lifecycle.d.ts +2 -16
  32. package/lib/types/services/lifecycle/lifecycle.service.d.ts +5 -19
  33. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  34. package/lib/types/services/locale/locale.service.d.ts +5 -18
  35. package/lib/types/services/log/log.service.d.ts +2 -16
  36. package/lib/types/services/permission/permission-point.d.ts +1 -15
  37. package/lib/types/services/permission/permission.service.d.ts +6 -21
  38. package/lib/types/services/permission/univer.permission.service.d.ts +3 -17
  39. package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -18
  40. package/lib/types/services/resource-manager/type.d.ts +7 -21
  41. package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +5 -19
  42. package/lib/types/services/snapshot/snapshot-server.service.d.ts +4 -18
  43. package/lib/types/services/snapshot/snapshot-transform.d.ts +6 -20
  44. package/lib/types/services/snapshot/snapshot-utils.d.ts +7 -21
  45. package/lib/types/services/theme/theme.service.d.ts +2 -16
  46. package/lib/types/services/undoredo/undoredo.service.d.ts +8 -24
  47. package/lib/types/shared/__test__/common.spec.d.ts +16 -0
  48. package/lib/types/shared/color/color.d.ts +2 -16
  49. package/lib/types/shared/common.d.ts +15 -22
  50. package/lib/types/shared/compare.d.ts +2 -16
  51. package/lib/types/shared/doc-tool.d.ts +2 -16
  52. package/lib/types/shared/lifecycle.d.ts +5 -20
  53. package/lib/types/shared/lru/lru-map.d.ts +2 -16
  54. package/lib/types/shared/object-matrix.d.ts +3 -17
  55. package/lib/types/shared/props-from.d.ts +2 -16
  56. package/lib/types/shared/rectangle.d.ts +4 -18
  57. package/lib/types/shared/ref-alias.d.ts +8 -1
  58. package/lib/types/shared/rxjs.d.ts +2 -16
  59. package/lib/types/shared/tools.d.ts +2 -16
  60. package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +9 -23
  61. package/lib/types/sheets/column-manager.d.ts +4 -18
  62. package/lib/types/sheets/range.d.ts +6 -22
  63. package/lib/types/sheets/row-manager.d.ts +4 -18
  64. package/lib/types/sheets/sheet-snapshot-utils.d.ts +2 -16
  65. package/lib/types/sheets/styles.d.ts +3 -17
  66. package/lib/types/sheets/view-model.d.ts +4 -18
  67. package/lib/types/sheets/workbook.d.ts +9 -23
  68. package/lib/types/sheets/worksheet.d.ts +8 -23
  69. package/lib/types/slides/domain/slide-model.d.ts +5 -19
  70. package/lib/types/types/const/const.d.ts +2 -16
  71. package/lib/types/types/enum/interpolation-point-type.d.ts +3 -3
  72. package/lib/types/types/interfaces/i-cell-data.d.ts +4 -18
  73. package/lib/types/types/interfaces/i-column-data.d.ts +2 -16
  74. package/lib/types/types/interfaces/i-document-data.d.ts +5 -19
  75. package/lib/types/types/interfaces/i-placeholder.d.ts +2 -16
  76. package/lib/types/types/interfaces/i-row-data.d.ts +2 -16
  77. package/lib/types/types/interfaces/i-selection-data.d.ts +3 -17
  78. package/lib/types/types/interfaces/i-shape-properties.d.ts +3 -17
  79. package/lib/types/types/interfaces/i-slide-data.d.ts +12 -26
  80. package/lib/types/types/interfaces/i-style-data.d.ts +5 -19
  81. package/lib/types/types/interfaces/i-univer-data.d.ts +5 -19
  82. package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -20
  83. package/lib/types/types/interfaces/i-worksheet-data.d.ts +8 -22
  84. package/lib/umd/index.js +8 -8
  85. package/package.json +6 -7
@@ -1,20 +1,6 @@
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
- import { Observable } from 'rxjs';
17
1
  import { Disposable } from '../../shared/lifecycle';
2
+ import { Observable } from 'rxjs';
3
+
18
4
  export interface IContextService {
19
5
  readonly contextChanged$: Observable<{
20
6
  [key: string]: boolean;
@@ -23,7 +9,7 @@ export interface IContextService {
23
9
  setContextValue(key: string, value: boolean): void;
24
10
  subscribeContextValue$(key: string): Observable<boolean>;
25
11
  }
26
- export declare const IContextService: import("@wendellhu/redi").IdentifierDecorator<IContextService>;
12
+ export declare const IContextService: import('@wendellhu/redi').IdentifierDecorator<IContextService>;
27
13
  export declare class ContextService extends Disposable implements IContextService {
28
14
  private _contextChanged$;
29
15
  readonly contextChanged$: Observable<{
@@ -1,25 +1,11 @@
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
1
  import { Disposable } from '../../shared/lifecycle';
2
+
17
3
  export interface IError {
18
4
  errorKey: string;
19
5
  }
20
6
  export declare class ErrorService extends Disposable {
21
7
  private readonly _error$;
22
- error$: import("rxjs").Observable<IError>;
8
+ error$: import('rxjs').Observable<IError>;
23
9
  dispose(): void;
24
10
  emit(key: string): void;
25
11
  }
@@ -1,22 +1,8 @@
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
- import type { IDisposable } from '@wendellhu/redi';
17
- import type { Observable } from 'rxjs';
18
- import type { Nullable } from '../../common/type-utils';
19
- import type { ITransformState } from './floating-object-interfaces';
1
+ import { ITransformState } from './floating-object-interfaces';
2
+ import { Nullable } from '../../common/type-utils';
3
+ import { Observable } from 'rxjs';
4
+ import { IDisposable } from '@wendellhu/redi';
5
+
20
6
  export declare const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__";
21
7
  export interface IFloatingObjectManagerSearchParam {
22
8
  unitId: string;
@@ -93,4 +79,4 @@ export declare class FloatingObjectManagerService implements IDisposable, IFloat
93
79
  private _clearByParam;
94
80
  private _removeByParam;
95
81
  }
96
- export declare const IFloatingObjectManagerService: import("@wendellhu/redi").IdentifierDecorator<IFloatingObjectManagerService>;
82
+ export declare const IFloatingObjectManagerService: import('@wendellhu/redi').IdentifierDecorator<IFloatingObjectManagerService>;
@@ -1,26 +1,12 @@
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
- import type { Observable } from 'rxjs';
17
- import { DocumentDataModel } from '../../docs/data-model/document-data-model';
18
- import type { Nullable } from '../../shared';
19
- import { Disposable } from '../../shared/lifecycle';
20
- import { Workbook } from '../../sheets/workbook';
21
- import { SlideDataModel } from '../../slides/domain/slide-model';
22
- import type { IDocumentData, ISlideData, IWorkbookData } from '../../types/interfaces';
23
1
  import { IContextService } from '../context/context.service';
2
+ import { IDocumentData, ISlideData, IWorkbookData } from '../../types/interfaces';
3
+ import { SlideDataModel } from '../../slides/domain/slide-model';
4
+ import { Workbook } from '../../sheets/workbook';
5
+ import { Disposable } from '../../shared/lifecycle';
6
+ import { Nullable } from '../../shared';
7
+ import { DocumentDataModel } from '../../docs/data-model/document-data-model';
8
+ import { Observable } from 'rxjs';
9
+
24
10
  export declare enum UniverInstanceType {
25
11
  UNKNOWN = 0,
26
12
  DOC = 1,
@@ -71,7 +57,7 @@ export interface IUniverInstanceService {
71
57
  getDocumentType(unitId: string): UniverInstanceType;
72
58
  disposeDocument(unitId: string): boolean;
73
59
  }
74
- export declare const IUniverInstanceService: import("@wendellhu/redi").IdentifierDecorator<IUniverInstanceService>;
60
+ export declare const IUniverInstanceService: import('@wendellhu/redi').IdentifierDecorator<IUniverInstanceService>;
75
61
  export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
76
62
  private readonly _handler;
77
63
  private readonly _contextService;
@@ -1,19 +1,5 @@
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
- import type { Ctor, DependencyIdentifier } from '@wendellhu/redi';
1
+ import { Ctor, DependencyIdentifier } from '@wendellhu/redi';
2
+
17
3
  /**
18
4
  * This enum defines multiple lifecycle stages in Univer SDK.
19
5
  */
@@ -1,23 +1,9 @@
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
- import { Injector } from '@wendellhu/redi';
17
- import { Observable } from 'rxjs';
18
- import { Disposable } from '../../shared/lifecycle';
19
- import { ILogService } from '../log/log.service';
20
1
  import { LifecycleStages } from './lifecycle';
2
+ import { ILogService } from '../log/log.service';
3
+ import { Disposable } from '../../shared/lifecycle';
4
+ import { Observable } from 'rxjs';
5
+ import { Injector } from '@wendellhu/redi';
6
+
21
7
  /**
22
8
  * This service controls the lifecycle of a Univer instance. Other modules can
23
9
  * inject this service to read the current lifecycle stage or subscribe to
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const ILocalStorageService: import("@wendellhu/redi").IdentifierDecorator<ILocalStorageService>;
16
+ export declare const ILocalStorageService: import('@wendellhu/redi').IdentifierDecorator<ILocalStorageService>;
17
17
  export type LocalStorageValueTypes = string;
18
18
  export interface ILocalStorageService {
19
19
  getItem<T>(key: string): Promise<T | null>;
@@ -1,22 +1,8 @@
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
- import { Subject } from 'rxjs';
17
- import { Disposable } from '../../shared/lifecycle';
18
- import type { ILanguagePack, ILocales } from '../../shared/locale';
19
1
  import { LocaleType } from '../../types/enum/locale-type';
2
+ import { ILanguagePack, ILocales, LanguageValue } from '../../shared/locale';
3
+ import { Disposable } from '../../shared/lifecycle';
4
+ import { Subject } from 'rxjs';
5
+
20
6
  /**
21
7
  * This service provides i18n and timezone / location features to other modules.
22
8
  */
@@ -60,4 +46,5 @@ export declare class LocaleService extends Disposable {
60
46
  setLocale(locale: LocaleType): void;
61
47
  getLocales(): ILanguagePack | undefined;
62
48
  getCurrentLocale(): LocaleType;
49
+ resolveKeyPath(obj: ILanguagePack, keys: string[]): LanguageValue | null;
63
50
  }
@@ -1,19 +1,5 @@
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
1
  import { Disposable } from '../../shared/lifecycle';
2
+
17
3
  export declare enum LogLevel {
18
4
  SILENT = 0,
19
5
  ERROR = 1,
@@ -29,7 +15,7 @@ export interface ILogService {
29
15
  error(...args: ArgsType): void;
30
16
  setLogLevel(enabled: LogLevel): void;
31
17
  }
32
- export declare const ILogService: import("@wendellhu/redi").IdentifierDecorator<ILogService>;
18
+ export declare const ILogService: import('@wendellhu/redi').IdentifierDecorator<ILogService>;
33
19
  export declare class DesktopLogService extends Disposable implements ILogService {
34
20
  private _logLevel;
35
21
  debug(...args: ArgsType): void;
@@ -1,19 +1,5 @@
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
1
  import { PermissionPoint } from '../../shared';
2
+
17
3
  export declare const UniverEditablePermissionPoint = "univer.editable";
18
4
  export declare class UniverEditablePermission extends PermissionPoint<boolean> {
19
5
  id: string;
@@ -1,24 +1,9 @@
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
- import type { Observable } from 'rxjs';
17
- import type { PermissionPoint } from '../../shared';
18
- import { Disposable } from '../../shared';
19
- import type { Nullable } from '../../shared/types';
20
- import { IUniverInstanceService } from '../instance/instance.service';
21
1
  import { IResourceManagerService } from '../resource-manager/type';
2
+ import { IUniverInstanceService } from '../instance/instance.service';
3
+ import { Nullable } from '../../shared/types';
4
+ import { PermissionPoint, Disposable } from '../../shared';
5
+ import { Observable } from 'rxjs';
6
+
22
7
  export interface IPermissionService {
23
8
  deletePermissionPoint(unitID: string, id: string): void;
24
9
  addPermissionPoint(unitID: string, item: PermissionPoint): boolean;
@@ -27,7 +12,7 @@ export interface IPermissionService {
27
12
  composePermission$(unitID: string, permissionIdList: string[]): Observable<PermissionPoint[]>;
28
13
  composePermission(unitID: string, permissionIdList: string[]): PermissionPoint[];
29
14
  }
30
- export declare const IPermissionService: import("@wendellhu/redi").IdentifierDecorator<IPermissionService>;
15
+ export declare const IPermissionService: import('@wendellhu/redi').IdentifierDecorator<IPermissionService>;
31
16
  export declare class PermissionService extends Disposable implements IPermissionService {
32
17
  private _resourceManagerService;
33
18
  private _univerInstanceService;
@@ -1,21 +1,7 @@
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
- import { Disposable } from '../../shared';
17
- import { IUniverInstanceService } from '../instance/instance.service';
18
1
  import { IPermissionService } from './permission.service';
2
+ import { IUniverInstanceService } from '../instance/instance.service';
3
+ import { Disposable } from '../../shared';
4
+
19
5
  export declare class UniverPermissionService extends Disposable {
20
6
  private _permissionService;
21
7
  private _univerInstanceService;
@@ -1,24 +1,10 @@
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
- */
1
+ import { IResourceHook, IResourceManagerService } from './type';
16
2
  import { Disposable } from '../../shared/lifecycle';
17
- import type { IResourceHook, IResourceManagerService } from './type';
3
+
18
4
  export declare class ResourceManagerService extends Disposable implements IResourceManagerService {
19
5
  private _resourceMap;
20
6
  private _register$;
21
- register$: import("rxjs").Observable<{
7
+ register$: import('rxjs').Observable<{
22
8
  resourceName: string;
23
9
  hook: IResourceHook;
24
10
  unitID: string;
@@ -33,7 +19,7 @@ export declare class ResourceManagerService extends Disposable implements IResou
33
19
  * @param {string} pluginName
34
20
  * @param {ResourceHook<T>} hook
35
21
  */
36
- registerPluginResource<T = any>(unitID: string, resourceName: string, hook: IResourceHook<T>): import("@wendellhu/redi").IDisposable;
22
+ registerPluginResource<T = any>(unitID: string, resourceName: string, hook: IResourceHook<T>): import('@wendellhu/redi').IDisposable;
37
23
  disposePluginResource(unitID: string, pluginName: string): void;
38
24
  dispose(): void;
39
25
  }
@@ -1,22 +1,8 @@
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
- import type { IDisposable } from '@wendellhu/redi';
17
- import type { Observable } from 'rxjs';
18
- import type { Workbook } from '../../sheets/workbook';
19
- import type { IWorkbookData } from '../../types/interfaces/i-workbook-data';
1
+ import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
2
+ import { Workbook } from '../../sheets/workbook';
3
+ import { Observable } from 'rxjs';
4
+ import { IDisposable } from '@wendellhu/redi';
5
+
20
6
  export interface IResourceHook<T = any> {
21
7
  onChange: (unitID: string, resource: T) => void;
22
8
  toJson: (unitID: string) => string;
@@ -36,8 +22,8 @@ export interface IResourceManagerService {
36
22
  unitID: string;
37
23
  }>;
38
24
  }
39
- export declare const IResourceManagerService: import("@wendellhu/redi").IdentifierDecorator<IResourceManagerService>;
25
+ export declare const IResourceManagerService: import('@wendellhu/redi').IdentifierDecorator<IResourceManagerService>;
40
26
  export interface ISnapshotPersistenceService {
41
27
  saveWorkbook: (workbook: Workbook) => IWorkbookData;
42
28
  }
43
- export declare const ISnapshotPersistenceService: import("@wendellhu/redi").IdentifierDecorator<ISnapshotPersistenceService>;
29
+ export declare const ISnapshotPersistenceService: import('@wendellhu/redi').IdentifierDecorator<ISnapshotPersistenceService>;
@@ -1,22 +1,8 @@
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
- import type { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISheetBlock, ISnapshot } from '@univerjs/protocol';
17
- import type { IWorkbookData } from '../../../types/interfaces/i-workbook-data';
18
- import type { ILogContext } from '../../log/context';
19
- import type { ISnapshotServerService } from '../snapshot-server.service';
1
+ import { ISnapshotServerService } from '../snapshot-server.service';
2
+ import { ILogContext } from '../../log/context';
3
+ import { IWorkbookData } from '../../../types/interfaces/i-workbook-data';
4
+ import { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISheetBlock, ISnapshot } from '@univerjs/protocol';
5
+
20
6
  export declare const testSnapshot: () => ISnapshot;
21
7
  export declare const testSheetBlocks: () => ISheetBlock[];
22
8
  export declare const testWorkbookData: () => IWorkbookData;
@@ -1,26 +1,12 @@
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
- import type { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse } from '@univerjs/protocol';
17
- import type { ILogContext } from '../log/context';
1
+ import { ILogContext } from '../log/context';
2
+ import { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse } from '@univerjs/protocol';
3
+
18
4
  /**
19
5
  * It provides implementations for server side controllers to load or save
20
6
  * or load snapshots. This service should be implemented by the host environment.
21
7
  * And it shouldn't contain any business logic.
22
8
  */
23
- export declare const ISnapshotServerService: import("@wendellhu/redi").IdentifierDecorator<ISnapshotServerService>;
9
+ export declare const ISnapshotServerService: import('@wendellhu/redi').IdentifierDecorator<ISnapshotServerService>;
24
10
  export interface ISnapshotServerService {
25
11
  /** Load snapshot from a database. */
26
12
  getUnitOnRev: (context: ILogContext, params: IGetUnitOnRevRequest) => Promise<IGetUnitOnRevResponse>;
@@ -1,23 +1,9 @@
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
- import type { ISheetBlock, ISnapshot } from '@univerjs/protocol';
17
- import type { ILogContext } from '../log/context';
18
- import type { IWorkbookData } from '../../types/interfaces/i-workbook-data';
19
- import type { IDocumentData } from '../../types/interfaces/i-document-data';
20
- import type { ISnapshotServerService } from './snapshot-server.service';
1
+ import { ISnapshotServerService } from './snapshot-server.service';
2
+ import { IDocumentData } from '../../types/interfaces/i-document-data';
3
+ import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
4
+ import { ILogContext } from '../log/context';
5
+ import { ISheetBlock, ISnapshot } from '@univerjs/protocol';
6
+
21
7
  export declare function generateTemporarySnap(context: ILogContext, workbook: IWorkbookData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
22
8
  snapshotRes: ISnapshot;
23
9
  }>;
@@ -1,24 +1,10 @@
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
- import type { ISheetBlock } from '@univerjs/protocol';
17
- import type { IWorksheetData } from '../../types/interfaces/i-worksheet-data';
18
- import type { IWorkbookData } from '../../types/interfaces/i-workbook-data';
19
- import type { IDocumentData } from '../../types/interfaces/i-document-data';
20
- import type { ICellData } from '../../types/interfaces/i-cell-data';
21
- import type { IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
1
+ import { IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
2
+ import { ICellData } from '../../types/interfaces/i-cell-data';
3
+ import { IDocumentData } from '../../types/interfaces/i-document-data';
4
+ import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
5
+ import { IWorksheetData } from '../../types/interfaces/i-worksheet-data';
6
+ import { ISheetBlock } from '@univerjs/protocol';
7
+
22
8
  export declare const textEncoder: TextEncoder;
23
9
  export declare const textDecoder: TextDecoder;
24
10
  /**
@@ -1,20 +1,6 @@
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
- import type { Observable } from 'rxjs';
17
1
  import { Disposable } from '../../shared/lifecycle';
2
+ import { Observable } from 'rxjs';
3
+
18
4
  export interface IStyleSheet {
19
5
  [key: string]: string;
20
6
  }
@@ -1,27 +1,11 @@
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
- import type { IAccessor, IDisposable } from '@wendellhu/redi';
17
- import type { Observable } from 'rxjs';
18
- import { BehaviorSubject } from 'rxjs';
19
- import { Disposable } from '../../shared/lifecycle';
20
- import type { IMutationInfo } from '../command/command.service';
21
- import { CommandType, ICommandService } from '../command/command.service';
22
- import { IContextService } from '../context/context.service';
1
+ import { Nullable } from '../../common/type-utils';
23
2
  import { IUniverInstanceService } from '../instance/instance.service';
24
- import type { Nullable } from '../../common/type-utils';
3
+ import { IContextService } from '../context/context.service';
4
+ import { IMutationInfo, CommandType, ICommandService } from '../command/command.service';
5
+ import { Disposable } from '../../shared/lifecycle';
6
+ import { Observable, BehaviorSubject } from 'rxjs';
7
+ import { IAccessor, IDisposable } from '@wendellhu/redi';
8
+
25
9
  export interface IUndoRedoItem {
26
10
  /** unitID maps to unitId for UniverSheet / UniverDoc / UniverSlide */
27
11
  unitID: string;
@@ -50,7 +34,7 @@ export interface IUndoRedoCommandInfos {
50
34
  undos: IMutationInfo[];
51
35
  redos: IMutationInfo[];
52
36
  }
53
- export declare const IUndoRedoService: import("@wendellhu/redi").IdentifierDecorator<IUndoRedoService>;
37
+ export declare const IUndoRedoService: import('@wendellhu/redi').IdentifierDecorator<IUndoRedoService>;
54
38
  export interface IUndoRedoStatus {
55
39
  undos: number;
56
40
  redos: number;
@@ -0,0 +1,16 @@
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 {};