@univerjs/core 0.1.3 → 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 (87) hide show
  1. package/lib/cjs/index.js +8 -7
  2. package/lib/es/index.js +1396 -1319
  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 +6 -20
  7. package/lib/types/basics/univer.d.ts +11 -25
  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 +4 -0
  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 +2 -1
  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.d.ts +2 -1
  28. package/lib/types/services/context/context.service.d.ts +3 -17
  29. package/lib/types/services/error/error.service.d.ts +2 -16
  30. package/lib/types/services/floating-object/floating-object-manager.service.d.ts +6 -20
  31. package/lib/types/services/instance/instance.service.d.ts +28 -42
  32. package/lib/types/services/lifecycle/lifecycle.d.ts +2 -16
  33. package/lib/types/services/lifecycle/lifecycle.service.d.ts +5 -19
  34. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  35. package/lib/types/services/locale/locale.service.d.ts +5 -18
  36. package/lib/types/services/log/log.service.d.ts +2 -16
  37. package/lib/types/services/permission/permission-point.d.ts +1 -15
  38. package/lib/types/services/permission/permission.service.d.ts +6 -21
  39. package/lib/types/services/permission/univer.permission.service.d.ts +3 -17
  40. package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -18
  41. package/lib/types/services/resource-manager/type.d.ts +7 -21
  42. package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +5 -19
  43. package/lib/types/services/snapshot/snapshot-server.service.d.ts +4 -18
  44. package/lib/types/services/snapshot/snapshot-transform.d.ts +6 -20
  45. package/lib/types/services/snapshot/snapshot-utils.d.ts +7 -21
  46. package/lib/types/services/theme/theme.service.d.ts +2 -16
  47. package/lib/types/services/undoredo/undoredo.service.d.ts +8 -24
  48. package/lib/types/shared/__test__/common.spec.d.ts +16 -0
  49. package/lib/types/shared/__test__/rectangle.spec.d.ts +16 -0
  50. package/lib/types/shared/color/color.d.ts +2 -16
  51. package/lib/types/shared/common.d.ts +15 -22
  52. package/lib/types/shared/compare.d.ts +2 -16
  53. package/lib/types/shared/doc-tool.d.ts +2 -16
  54. package/lib/types/shared/lifecycle.d.ts +5 -20
  55. package/lib/types/shared/lru/lru-map.d.ts +2 -16
  56. package/lib/types/shared/object-matrix.d.ts +3 -17
  57. package/lib/types/shared/props-from.d.ts +2 -16
  58. package/lib/types/shared/rectangle.d.ts +4 -18
  59. package/lib/types/shared/ref-alias.d.ts +8 -1
  60. package/lib/types/shared/rxjs.d.ts +2 -16
  61. package/lib/types/shared/tools.d.ts +2 -16
  62. package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +9 -23
  63. package/lib/types/sheets/column-manager.d.ts +4 -18
  64. package/lib/types/sheets/range.d.ts +6 -22
  65. package/lib/types/sheets/row-manager.d.ts +4 -18
  66. package/lib/types/sheets/sheet-snapshot-utils.d.ts +2 -16
  67. package/lib/types/sheets/styles.d.ts +3 -17
  68. package/lib/types/sheets/view-model.d.ts +4 -18
  69. package/lib/types/sheets/workbook.d.ts +9 -23
  70. package/lib/types/sheets/worksheet.d.ts +9 -24
  71. package/lib/types/slides/domain/slide-model.d.ts +8 -20
  72. package/lib/types/types/const/const.d.ts +2 -16
  73. package/lib/types/types/enum/interpolation-point-type.d.ts +3 -3
  74. package/lib/types/types/interfaces/i-cell-data.d.ts +4 -18
  75. package/lib/types/types/interfaces/i-column-data.d.ts +2 -16
  76. package/lib/types/types/interfaces/i-document-data.d.ts +6 -19
  77. package/lib/types/types/interfaces/i-placeholder.d.ts +2 -16
  78. package/lib/types/types/interfaces/i-row-data.d.ts +2 -16
  79. package/lib/types/types/interfaces/i-selection-data.d.ts +3 -17
  80. package/lib/types/types/interfaces/i-shape-properties.d.ts +3 -17
  81. package/lib/types/types/interfaces/i-slide-data.d.ts +13 -26
  82. package/lib/types/types/interfaces/i-style-data.d.ts +5 -19
  83. package/lib/types/types/interfaces/i-univer-data.d.ts +5 -19
  84. package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -20
  85. package/lib/types/types/interfaces/i-worksheet-data.d.ts +8 -22
  86. package/lib/umd/index.js +8 -7
  87. package/package.json +10 -9
@@ -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 { Nullable } from '../../shared/types';
1
+ import { Nullable } from '../../shared/types';
2
+
17
3
  /**
18
4
  * IConfig provides universal configuration for the whole application.
19
5
  */
20
- export declare const IConfigService: import("@wendellhu/redi").IdentifierDecorator<IConfigService>;
6
+ export declare const IConfigService: import('@wendellhu/redi').IdentifierDecorator<IConfigService>;
21
7
  export interface IConfigService {
22
8
  getConfig<T>(id: string, defaultValue: T): T;
23
9
  getConfig<T>(id: string): Nullable<T>;
@@ -22,4 +22,5 @@ export declare const EDITOR_ACTIVATED = "EDITOR_ACTIVATED";
22
22
  export declare const FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA";
23
23
  export declare const FOCUSING_FORMULA_EDITOR = "FOCUSING_FORMULA_EDITOR";
24
24
  export declare const FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR";
25
- export declare const FOCUSING_UNIVER_EDITOR_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_SINGLE_MODE";
25
+ export declare const FOCUSING_EDITOR_STANDALONE = "FOCUSING_EDITOR_INPUT_FORMULA";
26
+ export declare const FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE";
@@ -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 { Slide } 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,
@@ -30,7 +16,7 @@ export declare enum UniverInstanceType {
30
16
  export interface IUniverHandler {
31
17
  createUniverDoc(data: Partial<IDocumentData>): DocumentDataModel;
32
18
  createUniverSheet(data: Partial<IWorkbookData>): Workbook;
33
- createUniverSlide(data: Partial<ISlideData>): Slide;
19
+ createUniverSlide(data: Partial<ISlideData>): SlideDataModel;
34
20
  }
35
21
  /**
36
22
  * IUniverInstanceService holds all the current univer instances. And it also manages
@@ -40,38 +26,38 @@ export interface IUniverInstanceService {
40
26
  focused$: Observable<Nullable<string>>;
41
27
  currentSheet$: Observable<Nullable<Workbook>>;
42
28
  currentDoc$: Observable<Nullable<DocumentDataModel>>;
43
- currentSlide$: Observable<Nullable<Slide>>;
29
+ currentSlide$: Observable<Nullable<SlideDataModel>>;
44
30
  sheetAdded$: Observable<Workbook>;
45
31
  docAdded$: Observable<DocumentDataModel>;
46
- slideAdded$: Observable<Slide>;
32
+ slideAdded$: Observable<SlideDataModel>;
47
33
  sheetDisposed$: Observable<Workbook>;
48
34
  docDisposed$: Observable<DocumentDataModel>;
49
- slideDisposed$: Observable<Slide>;
35
+ slideDisposed$: Observable<SlideDataModel>;
50
36
  focusUniverInstance(id: string | null): void;
51
- getFocusedUniverInstance(): Workbook | DocumentDataModel | Slide | null;
37
+ getFocusedUniverInstance(): Nullable<Workbook | DocumentDataModel | SlideDataModel>;
52
38
  createDoc(data: Partial<IDocumentData>): DocumentDataModel;
53
39
  createSheet(data: Partial<IWorkbookData>): Workbook;
54
- createSlide(data: Partial<ISlideData>): Slide;
40
+ createSlide(data: Partial<ISlideData>): SlideDataModel;
55
41
  changeDoc(unitId: string, doc: DocumentDataModel): void;
56
42
  addDoc(doc: DocumentDataModel): void;
57
43
  addSheet(sheet: Workbook): void;
58
- addSlide(slide: Slide): void;
44
+ addSlide(slide: SlideDataModel): void;
59
45
  getUniverSheetInstance(id: string): Nullable<Workbook>;
60
46
  getUniverDocInstance(id: string): Nullable<DocumentDataModel>;
61
- getUniverSlideInstance(id: string): Nullable<Slide>;
47
+ getUniverSlideInstance(id: string): Nullable<SlideDataModel>;
62
48
  getCurrentUniverSheetInstance(): Workbook;
63
49
  getCurrentUniverDocInstance(): DocumentDataModel;
64
- getCurrentUniverSlideInstance(): Slide;
50
+ getCurrentUniverSlideInstance(): SlideDataModel;
65
51
  setCurrentUniverSheetInstance(id: string): void;
66
52
  setCurrentUniverDocInstance(id: string): void;
67
53
  setCurrentUniverSlideInstance(id: string): void;
68
54
  getAllUniverSheetsInstance(): Workbook[];
69
55
  getAllUniverDocsInstance(): DocumentDataModel[];
70
- getAllUniverSlidesInstance(): Slide[];
56
+ getAllUniverSlidesInstance(): SlideDataModel[];
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;
@@ -83,19 +69,19 @@ export declare class UniverInstanceService extends Disposable implements IUniver
83
69
  private readonly _currentDoc$;
84
70
  readonly currentDoc$: Observable<Nullable<DocumentDataModel>>;
85
71
  private readonly _currentSlide$;
86
- readonly currentSlide$: Observable<Nullable<Slide>>;
72
+ readonly currentSlide$: Observable<Nullable<SlideDataModel>>;
87
73
  private readonly _sheetAdded$;
88
74
  readonly sheetAdded$: Observable<Workbook>;
89
75
  private readonly _docAdded$;
90
76
  readonly docAdded$: Observable<DocumentDataModel>;
91
77
  private readonly _slideAdded$;
92
- readonly slideAdded$: Observable<Slide>;
78
+ readonly slideAdded$: Observable<SlideDataModel>;
93
79
  private readonly _sheetDisposed$;
94
80
  readonly sheetDisposed$: Observable<Workbook>;
95
81
  private readonly _docDisposed$;
96
82
  readonly docDisposed$: Observable<DocumentDataModel>;
97
83
  private readonly _slideDisposed$;
98
- readonly slideDisposed$: Observable<Slide>;
84
+ readonly slideDisposed$: Observable<SlideDataModel>;
99
85
  private readonly _sheets;
100
86
  private readonly _docs;
101
87
  private readonly _slides;
@@ -103,25 +89,25 @@ export declare class UniverInstanceService extends Disposable implements IUniver
103
89
  dispose(): void;
104
90
  createDoc(data: Partial<IDocumentData>): DocumentDataModel;
105
91
  createSheet(data: Partial<IWorkbookData>): Workbook;
106
- createSlide(data: Partial<ISlideData>): Slide;
92
+ createSlide(data: Partial<ISlideData>): SlideDataModel;
107
93
  addSheet(sheet: Workbook): void;
108
94
  changeDoc(unitId: string, doc: DocumentDataModel): void;
109
95
  addDoc(doc: DocumentDataModel): void;
110
- addSlide(slide: Slide): void;
96
+ addSlide(slide: SlideDataModel): void;
111
97
  getUniverSheetInstance(id: string): Nullable<Workbook>;
112
98
  getUniverDocInstance(id: string): Nullable<DocumentDataModel>;
113
- getUniverSlideInstance(id: string): Nullable<Slide>;
99
+ getUniverSlideInstance(id: string): Nullable<SlideDataModel>;
114
100
  getAllUniverSheetsInstance(): Workbook[];
115
101
  getAllUniverDocsInstance(): DocumentDataModel[];
116
- getAllUniverSlidesInstance(): Slide[];
102
+ getAllUniverSlidesInstance(): SlideDataModel[];
117
103
  setCurrentUniverSheetInstance(id: string): void;
118
104
  setCurrentUniverSlideInstance(id: string): void;
119
105
  setCurrentUniverDocInstance(id: string): void;
120
106
  getCurrentUniverSheetInstance(): Workbook;
121
107
  getCurrentUniverDocInstance(): DocumentDataModel;
122
- getCurrentUniverSlideInstance(): Slide;
108
+ getCurrentUniverSlideInstance(): SlideDataModel;
123
109
  focusUniverInstance(id: string | null): void;
124
- getFocusedUniverInstance(): Workbook | DocumentDataModel | Slide | null;
110
+ getFocusedUniverInstance(): Nullable<Workbook | DocumentDataModel | SlideDataModel>;
125
111
  getDocumentType(unitId: string): UniverInstanceType;
126
112
  disposeDocument(unitId: string): boolean;
127
113
  }
@@ -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>;