@univerjs/core 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +3059 -2952
- package/lib/types/basics/plugin-holder.d.ts +5 -19
- package/lib/types/basics/univer-doc.d.ts +5 -19
- package/lib/types/basics/univer-sheet.d.ts +5 -20
- package/lib/types/basics/univer-slide.d.ts +5 -19
- package/lib/types/basics/univer.d.ts +9 -23
- package/lib/types/common/equal.d.ts +20 -0
- package/lib/types/common/interceptor.d.ts +2 -16
- package/lib/types/docs/data-model/action-types.d.ts +3 -17
- package/lib/types/docs/data-model/apply-utils/common.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/delete-apply.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/insert-apply.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/update-apply.d.ts +2 -16
- package/lib/types/docs/data-model/document-data-model.d.ts +8 -22
- package/lib/types/docs/data-model/empty-snapshot.d.ts +2 -16
- package/lib/types/docs/data-model/preset-list-type.d.ts +1 -15
- package/lib/types/docs/data-model/replacement.d.ts +2 -16
- package/lib/types/docs/data-model/text-x/action-iterator.d.ts +2 -17
- package/lib/types/docs/data-model/text-x/text-x.d.ts +4 -18
- package/lib/types/docs/data-model/text-x/utils.d.ts +3 -17
- package/lib/types/index.d.ts +11 -1
- package/lib/types/observer/observable-hooks.d.ts +3 -18
- package/lib/types/observer/observable.d.ts +2 -16
- package/lib/types/plugin/plugin.d.ts +2 -16
- package/lib/types/services/command/command.service.d.ts +6 -21
- package/lib/types/services/config/config.service.d.ts +3 -17
- package/lib/types/services/context/context.service.d.ts +3 -17
- package/lib/types/services/error/error.service.d.ts +2 -16
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts +6 -20
- package/lib/types/services/instance/instance.service.d.ts +9 -23
- package/lib/types/services/lifecycle/lifecycle.d.ts +33 -17
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +5 -19
- package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
- package/lib/types/services/locale/locale.service.d.ts +5 -18
- package/lib/types/services/log/log.service.d.ts +2 -16
- package/lib/types/services/permission/permission-point.d.ts +1 -15
- package/lib/types/services/permission/permission.service.d.ts +6 -21
- package/lib/types/services/permission/univer.permission.service.d.ts +3 -17
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -18
- package/lib/types/services/resource-manager/type.d.ts +7 -21
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +5 -19
- package/lib/types/services/snapshot/snapshot-server.service.d.ts +4 -18
- package/lib/types/services/snapshot/snapshot-transform.d.ts +6 -20
- package/lib/types/services/snapshot/snapshot-utils.d.ts +7 -21
- package/lib/types/services/theme/theme.service.d.ts +2 -16
- package/lib/types/services/undoredo/undoredo.service.d.ts +18 -24
- package/lib/types/shared/__test__/common.spec.d.ts +16 -0
- package/lib/types/shared/color/color.d.ts +2 -16
- package/lib/types/shared/common.d.ts +15 -22
- package/lib/types/shared/compare.d.ts +2 -16
- package/lib/types/shared/doc-tool.d.ts +2 -16
- package/lib/types/shared/index.d.ts +1 -0
- package/lib/types/shared/lifecycle.d.ts +5 -20
- package/lib/types/shared/lru/lru-map.d.ts +2 -16
- package/lib/types/shared/object-matrix-query.d.ts +4 -0
- package/lib/types/shared/object-matrix.d.ts +5 -18
- package/lib/types/shared/props-from.d.ts +2 -16
- package/lib/types/shared/rectangle.d.ts +4 -18
- package/lib/types/shared/ref-alias.d.ts +8 -1
- package/lib/types/shared/rxjs.d.ts +2 -16
- package/lib/types/shared/tools.d.ts +4 -16
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +9 -23
- package/lib/types/sheets/column-manager.d.ts +4 -18
- package/lib/types/sheets/empty-snapshot.d.ts +4 -0
- package/lib/types/sheets/range.d.ts +6 -22
- package/lib/types/sheets/row-manager.d.ts +4 -18
- package/lib/types/sheets/sheet-snapshot-utils.d.ts +2 -16
- package/lib/types/sheets/styles.d.ts +3 -17
- package/lib/types/sheets/view-model.d.ts +10 -24
- package/lib/types/sheets/workbook.d.ts +9 -23
- package/lib/types/sheets/worksheet.d.ts +8 -23
- package/lib/types/slides/domain/slide-model.d.ts +5 -19
- package/lib/types/types/const/const.d.ts +1 -20
- package/lib/types/types/enum/data-validation-error-style.d.ts +20 -0
- package/lib/types/types/enum/data-validation-ime-mode.d.ts +28 -0
- package/lib/types/types/enum/data-validation-operator.d.ts +25 -0
- package/lib/types/types/enum/data-validation-render-mode.d.ts +20 -0
- package/lib/types/types/enum/data-validation-status.d.ts +20 -0
- package/lib/types/types/enum/data-validation-type.d.ts +36 -0
- package/lib/types/types/enum/interpolation-point-type.d.ts +3 -3
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +28 -0
- package/lib/types/types/interfaces/i-cell-data.d.ts +20 -18
- package/lib/types/types/interfaces/i-cell-validation-data.d.ts +9 -0
- package/lib/types/types/interfaces/i-column-data.d.ts +2 -16
- package/lib/types/types/interfaces/i-data-validation.d.ts +44 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-placeholder.d.ts +2 -16
- package/lib/types/types/interfaces/i-row-data.d.ts +2 -16
- package/lib/types/types/interfaces/i-selection-data.d.ts +3 -17
- package/lib/types/types/interfaces/i-shape-properties.d.ts +3 -17
- package/lib/types/types/interfaces/i-slide-data.d.ts +12 -26
- package/lib/types/types/interfaces/i-style-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-univer-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -20
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +8 -22
- package/lib/umd/index.js +8 -8
- package/package.json +6 -7
|
@@ -1,22 +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 type { IAccessor, IDisposable } from '@wendellhu/redi';
|
|
17
|
-
import { Injector } from '@wendellhu/redi';
|
|
18
|
-
import { IContextService } from '../context/context.service';
|
|
19
1
|
import { ILogService } from '../log/log.service';
|
|
2
|
+
import { IContextService } from '../context/context.service';
|
|
3
|
+
import { IAccessor, IDisposable, Injector } from '@wendellhu/redi';
|
|
4
|
+
|
|
20
5
|
export declare enum CommandType {
|
|
21
6
|
/** Command could generate some operations or mutations. */
|
|
22
7
|
COMMAND = 0,
|
|
@@ -117,7 +102,7 @@ export interface ICommandService {
|
|
|
117
102
|
*/
|
|
118
103
|
beforeCommandExecuted(listener: CommandListener): IDisposable;
|
|
119
104
|
}
|
|
120
|
-
export declare const ICommandService: import(
|
|
105
|
+
export declare const ICommandService: import('@wendellhu/redi').IdentifierDecorator<ICommandService>;
|
|
121
106
|
/**
|
|
122
107
|
* The registry of commands.
|
|
123
108
|
*/
|
|
@@ -148,6 +133,6 @@ export declare class CommandService implements ICommandService {
|
|
|
148
133
|
private _execute;
|
|
149
134
|
private _syncExecute;
|
|
150
135
|
}
|
|
151
|
-
export declare function sequenceExecute(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): import(
|
|
152
|
-
export declare function sequenceExecuteAsync(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): Promise<import(
|
|
136
|
+
export declare function sequenceExecute(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): import('../../common/sequence').ISequenceExecuteResult;
|
|
137
|
+
export declare function sequenceExecuteAsync(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): Promise<import('../../common/sequence').ISequenceExecuteResult>;
|
|
153
138
|
export declare const NilCommand: ICommand;
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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(
|
|
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>;
|
|
@@ -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(
|
|
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(
|
|
8
|
+
error$: import('rxjs').Observable<IError>;
|
|
23
9
|
dispose(): void;
|
|
24
10
|
emit(key: string): void;
|
|
25
11
|
}
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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
|
*/
|
|
@@ -44,7 +30,37 @@ export declare const LifecycleNameMap: {
|
|
|
44
30
|
};
|
|
45
31
|
export declare const LifecycleToModules: Map<LifecycleStages, DependencyIdentifier<unknown>[]>;
|
|
46
32
|
/**
|
|
47
|
-
* Register
|
|
33
|
+
* Register the decorated class to be automatically instantiated when Univer progresses to the certain lifecycle stage.
|
|
34
|
+
*
|
|
35
|
+
* @param lifecycleStage The lifecycle stage to instantiate this class.
|
|
36
|
+
* @param identifier The dependency identifier of the class. Usually, it is the class itself unless you bind this class
|
|
37
|
+
* with another injection identifier.
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Ignore the `\` below. This is JSDoc's bug.
|
|
42
|
+
* \@OnLifecycle(LifecycleStages.Ready, MyService)
|
|
43
|
+
* class MyService {
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Ignore the `\` below. This is JSDoc's bug.
|
|
48
|
+
* \@OnLifecycle(LifecycleStages.Rendered, IMyService)
|
|
49
|
+
* class MyService implements IMyService {
|
|
50
|
+
* }
|
|
48
51
|
*/
|
|
49
52
|
export declare function OnLifecycle(lifecycleStage: LifecycleStages, identifier: DependencyIdentifier<unknown>): (_: Ctor<unknown>) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Register a dependency to be automatically instantiated when Univer progresses to the certain lifecycle stage.
|
|
55
|
+
*
|
|
56
|
+
* @param lifecycleStage The lifecycle stage to instantiate this dependency.
|
|
57
|
+
* @param identifier The dependencies' identifier. **Beware** that if the dependency (e.g. a class) is bound to an
|
|
58
|
+
* identifier, you should register the identifier instead of the dependency itself.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* runOnLifecycle(LifecycleStages.Ready, MyService);
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* runOnLifecycle(LifecycleStages.Rendered, IMyService);
|
|
65
|
+
*/
|
|
50
66
|
export declare function runOnLifecycle(lifecycleStage: LifecycleStages, identifier: DependencyIdentifier<unknown>): void;
|
|
@@ -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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
3
|
+
|
|
18
4
|
export declare class ResourceManagerService extends Disposable implements IResourceManagerService {
|
|
19
5
|
private _resourceMap;
|
|
20
6
|
private _register$;
|
|
21
|
-
register$: import(
|
|
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(
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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(
|
|
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(
|
|
29
|
+
export declare const ISnapshotPersistenceService: import('@wendellhu/redi').IdentifierDecorator<ISnapshotPersistenceService>;
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
}>;
|