@univerjs/core 0.17.0 → 0.18.0

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 (128) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +9 -8
  3. package/lib/es/facade.js +1 -1479
  4. package/lib/es/index.js +9 -20335
  5. package/lib/facade.js +1 -1479
  6. package/lib/index.js +9 -20335
  7. package/lib/types/common/async.d.ts +16 -1
  8. package/lib/types/common/di.d.ts +18 -2
  9. package/lib/types/common/interceptor.d.ts +16 -1
  10. package/lib/types/common/invert-color/invert-hsl.d.ts +16 -1
  11. package/lib/types/common/invert-color/invert-rgb.d.ts +16 -1
  12. package/lib/types/common/unit.d.ts +17 -2
  13. package/lib/types/docs/data-model/document-data-model.d.ts +24 -9
  14. package/lib/types/docs/data-model/empty-snapshot.d.ts +16 -1
  15. package/lib/types/docs/data-model/json-x/json-x.d.ts +19 -4
  16. package/lib/types/docs/data-model/preset-list-type.d.ts +16 -1
  17. package/lib/types/docs/data-model/replacement.d.ts +16 -1
  18. package/lib/types/docs/data-model/rich-text-builder.d.ts +21 -5
  19. package/lib/types/docs/data-model/text-x/action-iterator.d.ts +17 -1
  20. package/lib/types/docs/data-model/text-x/action-types.d.ts +17 -2
  21. package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +16 -1
  22. package/lib/types/docs/data-model/text-x/apply-utils/delete-apply.d.ts +16 -1
  23. package/lib/types/docs/data-model/text-x/apply-utils/insert-apply.d.ts +16 -1
  24. package/lib/types/docs/data-model/text-x/apply-utils/update-apply.d.ts +16 -1
  25. package/lib/types/docs/data-model/text-x/apply.d.ts +17 -2
  26. package/lib/types/docs/data-model/text-x/build-utils/custom-decoration.d.ts +17 -2
  27. package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +17 -2
  28. package/lib/types/docs/data-model/text-x/build-utils/drawings.d.ts +19 -4
  29. package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +24 -9
  30. package/lib/types/docs/data-model/text-x/build-utils/paragraph.d.ts +18 -3
  31. package/lib/types/docs/data-model/text-x/build-utils/parse.d.ts +16 -1
  32. package/lib/types/docs/data-model/text-x/build-utils/selection.d.ts +17 -2
  33. package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +23 -7
  34. package/lib/types/docs/data-model/text-x/text-x.d.ts +18 -3
  35. package/lib/types/docs/data-model/text-x/transform-utils.d.ts +17 -2
  36. package/lib/types/docs/data-model/text-x/utils.d.ts +34 -19
  37. package/lib/types/docs/data-model/utils.d.ts +16 -1
  38. package/lib/types/facade/f-base.d.ts +17 -1
  39. package/lib/types/facade/f-blob.d.ts +17 -1
  40. package/lib/types/facade/f-doc.d.ts +17 -1
  41. package/lib/types/facade/f-enum.d.ts +15 -0
  42. package/lib/types/facade/f-event-registry.d.ts +19 -3
  43. package/lib/types/facade/f-event.d.ts +17 -2
  44. package/lib/types/facade/f-hooks.d.ts +17 -1
  45. package/lib/types/facade/f-univer.d.ts +20 -3
  46. package/lib/types/facade/f-usermanager.d.ts +17 -1
  47. package/lib/types/facade/f-util.d.ts +15 -0
  48. package/lib/types/observer/observable.d.ts +17 -1
  49. package/lib/types/services/authz-io/authz-io-local.service.d.ts +17 -2
  50. package/lib/types/services/authz-io/type.d.ts +18 -3
  51. package/lib/types/services/command/command.service.d.ts +20 -4
  52. package/lib/types/services/config/config.service.d.ts +18 -3
  53. package/lib/types/services/confirm/confirm.service.d.ts +17 -2
  54. package/lib/types/services/context/context.service.d.ts +16 -1
  55. package/lib/types/services/error/error.service.d.ts +16 -1
  56. package/lib/types/services/image-io/image-io.service.d.ts +18 -3
  57. package/lib/types/services/image-io/url-image.service.d.ts +17 -2
  58. package/lib/types/services/instance/instance.service.d.ts +22 -5
  59. package/lib/types/services/lifecycle/lifecycle.service.d.ts +16 -1
  60. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  61. package/lib/types/services/locale/locale.service.d.ts +17 -2
  62. package/lib/types/services/log/log.service.d.ts +16 -1
  63. package/lib/types/services/mention-io/mention-io-local.service.d.ts +16 -1
  64. package/lib/types/services/mention-io/type.d.ts +18 -3
  65. package/lib/types/services/permission/permission.service.d.ts +18 -2
  66. package/lib/types/services/permission/type.d.ts +20 -5
  67. package/lib/types/services/plugin/plugin-override.d.ts +16 -1
  68. package/lib/types/services/plugin/plugin.service.d.ts +18 -2
  69. package/lib/types/services/resource-loader/resource-loader.service.d.ts +17 -2
  70. package/lib/types/services/resource-loader/type.d.ts +17 -2
  71. package/lib/types/services/resource-manager/resource-manager.service.d.ts +19 -4
  72. package/lib/types/services/resource-manager/type.d.ts +19 -4
  73. package/lib/types/services/theme/theme.service.d.ts +16 -1
  74. package/lib/types/services/undoredo/undoredo.service.d.ts +22 -5
  75. package/lib/types/services/user-manager/const.d.ts +17 -1
  76. package/lib/types/services/user-manager/user-manager.service.d.ts +17 -2
  77. package/lib/types/shared/after-init-apply.d.ts +16 -1
  78. package/lib/types/shared/cache/image-cache.d.ts +16 -1
  79. package/lib/types/shared/check-if-move.d.ts +17 -2
  80. package/lib/types/shared/common.d.ts +22 -7
  81. package/lib/types/shared/compare.d.ts +16 -1
  82. package/lib/types/shared/dayjs.d.ts +16 -1
  83. package/lib/types/shared/doc-tool.d.ts +16 -1
  84. package/lib/types/shared/generate.d.ts +17 -2
  85. package/lib/types/shared/lifecycle.d.ts +18 -2
  86. package/lib/types/shared/lru/lru-map.d.ts +16 -1
  87. package/lib/types/shared/object-matrix-query.d.ts +16 -1
  88. package/lib/types/shared/object-matrix.d.ts +17 -2
  89. package/lib/types/shared/r-tree.d.ts +18 -2
  90. package/lib/types/shared/range.d.ts +17 -2
  91. package/lib/types/shared/rectangle.d.ts +17 -2
  92. package/lib/types/shared/rxjs.d.ts +18 -2
  93. package/lib/types/shared/tools.d.ts +17 -23
  94. package/lib/types/sheets/clone.d.ts +17 -2
  95. package/lib/types/sheets/column-manager.d.ts +19 -4
  96. package/lib/types/sheets/empty-snapshot.d.ts +16 -1
  97. package/lib/types/sheets/range.d.ts +23 -6
  98. package/lib/types/sheets/row-manager.d.ts +20 -5
  99. package/lib/types/sheets/sheet-skeleton.d.ts +21 -5
  100. package/lib/types/sheets/sheet-snapshot-utils.d.ts +16 -1
  101. package/lib/types/sheets/span-model.d.ts +16 -1
  102. package/lib/types/sheets/styles.d.ts +18 -3
  103. package/lib/types/sheets/typedef.d.ts +23 -7
  104. package/lib/types/sheets/util.d.ts +20 -4
  105. package/lib/types/sheets/workbook.d.ts +19 -4
  106. package/lib/types/sheets/worksheet.d.ts +25 -7
  107. package/lib/types/skeleton.d.ts +16 -1
  108. package/lib/types/slides/slide-model.d.ts +22 -6
  109. package/lib/types/types/const/const.d.ts +18 -2
  110. package/lib/types/types/const/page-size.d.ts +16 -1
  111. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +20 -5
  112. package/lib/types/types/interfaces/i-cell-validation-data.d.ts +17 -2
  113. package/lib/types/types/interfaces/i-data-validation.d.ts +21 -6
  114. package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +16 -1
  115. package/lib/types/types/interfaces/i-document-data.d.ts +20 -5
  116. package/lib/types/types/interfaces/i-drawing.d.ts +56 -3
  117. package/lib/types/types/interfaces/i-mention.d.ts +16 -1
  118. package/lib/types/types/interfaces/i-need-check-disposable.d.ts +16 -1
  119. package/lib/types/types/interfaces/i-placeholder.d.ts +16 -1
  120. package/lib/types/types/interfaces/i-shape-properties.d.ts +17 -2
  121. package/lib/types/types/interfaces/i-slide-data.d.ts +26 -11
  122. package/lib/types/types/interfaces/i-style-data.d.ts +19 -4
  123. package/lib/types/univer.d.ts +26 -10
  124. package/lib/umd/facade.js +1 -1
  125. package/lib/umd/index.js +9 -8
  126. package/package.json +9 -9
  127. package/lib/types/docs/data-model/text-x/build-utils/__test__/custom-range.spec.d.ts +0 -16
  128. package/lib/types/docs/data-model/text-x/build-utils/__test__/selection.spec.d.ts +0 -16
@@ -1,3 +1,19 @@
1
- import { IUser, UnitRole } from '@univerjs/protocol';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IUser } from '@univerjs/protocol';
17
+ import { UnitRole } from '@univerjs/protocol';
2
18
  export declare const createDefaultUser: (type?: UnitRole) => IUser;
3
19
  export declare const isDevRole: (userId: string, type: UnitRole) => boolean;
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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
16
  import { Disposable } from '../../shared/lifecycle';
2
17
  export interface IUser {
3
18
  userID: string;
@@ -7,7 +22,7 @@ export interface IUser {
7
22
  export declare class UserManagerService extends Disposable {
8
23
  private _model;
9
24
  private _userChange$;
10
- userChange$: import('rxjs').Observable<{
25
+ userChange$: import("rxjs").Observable<{
11
26
  type: "add" | "delete";
12
27
  user: IUser;
13
28
  } | {
@@ -18,7 +33,7 @@ export declare class UserManagerService extends Disposable {
18
33
  * When the current user undergoes a switch or change
19
34
  * @memberof UserManagerService
20
35
  */
21
- currentUser$: import('rxjs').Observable<IUser>;
36
+ currentUser$: import("rxjs").Observable<IUser>;
22
37
  dispose(): void;
23
38
  getCurrentUser<T extends IUser>(): T;
24
39
  setCurrentUser<T extends IUser>(user: T): void;
@@ -1,2 +1,17 @@
1
- import { ICommandService } from '../services/command/command.service';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { ICommandService } from '../services/command/command.service';
2
17
  export declare const afterInitApply: (commandService: ICommandService) => Promise<void>;
@@ -1,4 +1,19 @@
1
- import { Injector } from '@wendellhu/redi';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { Injector } from '@wendellhu/redi';
2
17
  import { ImageSourceType } from '../../services/image-io/image-io.service';
3
18
  export declare class ImageCacheMap {
4
19
  private _injector;
@@ -1,5 +1,20 @@
1
- import { ITransformState } from '../types/interfaces/i-drawing';
2
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { ITransformState } from '../types/interfaces/i-drawing';
17
+ import type { Nullable } from './types';
3
18
  export declare const MOVE_BUFFER_VALUE = 2;
4
19
  export declare const ROTATE_BUFFER_VALUE = 1;
5
20
  export declare function checkIfMove(transform: Nullable<ITransformState>, previousTransform: Nullable<ITransformState>): boolean;
@@ -1,9 +1,24 @@
1
- import { CellValue, ICellData, ICellDataForSheetInterceptor, ICellWithCoord, IRange, IRangeWithCoord, ISelectionCell } from '../sheets/typedef';
2
- import { Worksheet } from '../sheets/worksheet';
3
- import { IDocumentData } from '../types/interfaces/i-document-data';
4
- import { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
5
- import { IObjectMatrixPrimitiveType } from './object-matrix';
6
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { CellValue, ICellData, ICellDataForSheetInterceptor, ICellWithCoord, IRange, IRangeWithCoord, ISelectionCell } from '../sheets/typedef';
17
+ import type { Worksheet } from '../sheets/worksheet';
18
+ import type { IDocumentData } from '../types/interfaces/i-document-data';
19
+ import type { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
20
+ import type { IObjectMatrixPrimitiveType } from './object-matrix';
21
+ import type { Nullable } from './types';
7
22
  /**
8
23
  * Data type convert, convert ICellWithCoord to IRangeWithCoord
9
24
  * @param cellInfo
@@ -38,7 +53,7 @@ export declare function isFormulaId(value: any): boolean;
38
53
  */
39
54
  export declare function handleStyleToString(style: IStyleData, isCell?: boolean): string;
40
55
  export declare function getBorderStyleType(type: string): number;
41
- export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import('..').IDocumentBody | undefined;
56
+ export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import("..").IDocumentBody | undefined;
42
57
  export declare function isValidRange(range: IRange, worksheet?: Worksheet): boolean;
43
58
  /**
44
59
  * Covert row/column to range object
@@ -1,4 +1,19 @@
1
- import { ITextRun } from '../types/interfaces/i-document-data';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { ITextRun } from '../types/interfaces/i-document-data';
2
17
  interface IAnyObject {
3
18
  [key: number | string]: IAnyObject | IAnyObject[] | Array<[number | string]> | any;
4
19
  }
@@ -1,2 +1,17 @@
1
- import { default as dayjs } from 'dayjs';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 dayjs from 'dayjs';
2
17
  export { dayjs };
@@ -1,4 +1,19 @@
1
- import { IParagraph, IParagraphStyle } from '../types/interfaces/i-document-data';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IParagraph, IParagraphStyle } from '../types/interfaces/i-document-data';
2
17
  export declare function horizontalLineSegmentsSubtraction(aStart: number, aEnd: number, bStart: number, bEnd: number): number[];
3
18
  export declare function checkParagraphHasBullet(paragraph: IParagraph): boolean;
4
19
  export declare function checkParagraphHasIndent(paragraph: IParagraph): boolean;
@@ -1,5 +1,20 @@
1
- import { CellValue } from '../sheets/typedef';
2
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { CellValue } from '../sheets/typedef';
17
+ import type { Nullable } from './types';
3
18
  /**
4
19
  * Determine whether it is a pure number, "12" and "12e+3" are both true
5
20
  * @param val The number or string to be judged
@@ -1,5 +1,21 @@
1
- import { SubscriptionLike, Subject } from 'rxjs';
2
- import { IDisposable } from '../common/di';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { SubscriptionLike } from 'rxjs';
17
+ import type { IDisposable } from '../common/di';
18
+ import { Subject } from 'rxjs';
3
19
  type DisposableLike = IDisposable | SubscriptionLike | (() => void);
4
20
  export declare function toDisposable(disposable: IDisposable): IDisposable;
5
21
  export declare function toDisposable(subscription: SubscriptionLike): IDisposable;
@@ -1,4 +1,19 @@
1
- import { IDisposable } from '../../common/di';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 '../../common/di';
2
17
  declare const NEWER: unique symbol;
3
18
  declare const OLDER: unique symbol;
4
19
  export declare class KeyIterator<K, V> implements IterableIterator<K> {
@@ -1,4 +1,19 @@
1
- import { IRange } from '../sheets/typedef';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IRange } from '../sheets/typedef';
2
17
  import { ObjectMatrix } from './object-matrix';
3
18
  /**
4
19
  * @deprecated this function could cause memory out of use in large range.
@@ -1,5 +1,20 @@
1
- import { IRange } from '../sheets/typedef';
2
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IRange } from '../sheets/typedef';
17
+ import type { Nullable } from './types';
3
18
  /**
4
19
  * Object Matrix Primitive Type
5
20
  */
@@ -1,5 +1,21 @@
1
- import { BBox, default as RBush } from 'rbush';
2
- import { IUnitRange } from '../sheets/typedef';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { BBox } from 'rbush';
17
+ import type { IUnitRange } from '../sheets/typedef';
18
+ import RBush from 'rbush';
3
19
  type StringOrNumber = string | number;
4
20
  export interface IRTreeItem extends IUnitRange {
5
21
  id: StringOrNumber;
@@ -1,5 +1,20 @@
1
- import { IRange } from '../sheets/typedef';
2
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IRange } from '../sheets/typedef';
17
+ import type { Nullable } from './types';
3
18
  export declare function moveRangeByOffset(range: IRange, refOffsetX: number, refOffsetY: number, ignoreAbsolute?: boolean): IRange;
4
19
  /**
5
20
  * Split ranges into aligned smaller ranges
@@ -1,5 +1,20 @@
1
- import { IRange, IRectLTRB } from '../sheets/typedef';
2
- import { Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IRange, IRectLTRB } from '../sheets/typedef';
17
+ import type { Nullable } from './types';
3
18
  /**
4
19
  * This class provides a set of methods to calculate and manipulate rectangular ranges (IRange).
5
20
  * A range represents a rectangular area in a grid, defined by start/end rows and columns.
@@ -1,5 +1,21 @@
1
- import { OperatorFunction, BehaviorSubject, Observable } from 'rxjs';
2
- import { IDisposable } from '../common/di';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { OperatorFunction } from 'rxjs';
17
+ import type { IDisposable } from '../common/di';
18
+ import { BehaviorSubject, Observable } from 'rxjs';
3
19
  type CallbackFn<T extends readonly unknown[]> = (cb: (...args: T) => void) => IDisposable;
4
20
  /**
5
21
  * Creates an observable from a callback function.
@@ -1,22 +1,31 @@
1
- import { IStyleData } from '../types/interfaces';
2
- import { IKeyValue, Nullable } from './types';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IStyleData } from '../types/interfaces';
17
+ import type { IKeyValue, Nullable } from './types';
3
18
  /**
4
19
  * Universal tool library
5
20
  */
6
21
  export declare class Tools {
7
22
  static deleteNull(obj: any): any;
8
- static stringAt(index: number): string;
9
- static indexAt(code: string): number;
10
- static deleteBlank(value?: string): string | undefined;
11
23
  static getSystemType(): string;
12
24
  static getBrowserType(): string;
13
- static getClassName(instance: object): string;
14
25
  /** @deprecated This method is deprecated, please use `import { merge } from '@univerjs/core` instead */
15
26
  static deepMerge(target: any, ...sources: any[]): any;
16
- static numberFixed(value: number, digit: number): number;
17
27
  static diffValue(one: any, two: any): boolean;
18
28
  static deepClone<T = unknown>(value: T): T;
19
- static getLanguage(): string;
20
29
  static getValueType(value: any): string;
21
30
  static isDefine<T>(value?: T | void): value is T;
22
31
  static isBlank(value: any): boolean;
@@ -40,21 +49,6 @@ export declare class Tools {
40
49
  * @returns
41
50
  */
42
51
  static removeNull(value: IKeyValue): object;
43
- /**
44
- * Generate a two-dimensional array with the specified number of rows and columns, and fill in the values
45
- * @param rows row length
46
- * @param columns column length
47
- * @param value value to be set
48
- * @returns
49
- */
50
- static fillTwoDimensionalArray(rows: number, columns: number, value: any): any[][];
51
- /**
52
- * Generate a two-dimensional array with the specified number of rows and columns, and fill in the values
53
- * @param rows row length
54
- * @param columns column length
55
- * @param value value to be set
56
- * @returns
57
- */
58
52
  static numToWord(x: number): string;
59
53
  /**
60
54
  * Column subscript letter to number
@@ -1,5 +1,20 @@
1
- import { IObjectMatrixPrimitiveType, Nullable } from '../shared';
2
- import { ICellData, ICellDataWithSpanAndDisplay, IWorksheetData } from './typedef';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IObjectMatrixPrimitiveType, Nullable } from '../shared';
17
+ import type { ICellData, ICellDataWithSpanAndDisplay, IWorksheetData } from './typedef';
3
18
  /**
4
19
  * Fast clone for primitive values and simple objects.
5
20
  * Avoids type checking overhead when we know the structure.
@@ -1,7 +1,22 @@
1
- import { IObjectArrayPrimitiveType } from '../shared/object-matrix';
2
- import { Nullable } from '../shared/types';
3
- import { IStyleData } from '../types/interfaces';
4
- import { CustomData, IColumnData, IRange, IWorksheetData } from './typedef';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IObjectArrayPrimitiveType } from '../shared/object-matrix';
17
+ import type { Nullable } from '../shared/types';
18
+ import type { IStyleData } from '../types/interfaces';
19
+ import type { CustomData, IColumnData, IRange, IWorksheetData } from './typedef';
5
20
  /**
6
21
  * Manage configuration information of all columns, get column width, column length, set column width, etc.
7
22
  */
@@ -1,3 +1,18 @@
1
- import { IWorkbookData } from './typedef';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IWorkbookData } from './typedef';
2
17
  import { LocaleType } from '../types/enum/locale-type';
3
18
  export declare function getEmptySnapshot(unitID?: string, locale?: LocaleType, name?: string): IWorkbookData;
@@ -1,9 +1,26 @@
1
- import { IObjectMatrixPrimitiveType, Nullable, ObjectMatrix } from '../shared';
2
- import { HorizontalAlign, VerticalAlign, BooleanNumber, FontItalic, FontWeight, WrapStrategy } from '../types/enum';
3
- import { IBorderData, IDocumentBody, IDocumentData, IStyleBase, IStyleData, ITextDecoration, ITextRotation } from '../types/interfaces';
4
- import { Styles } from './styles';
5
- import { ICellData, IRange } from './typedef';
6
- import { Worksheet } from './worksheet';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IObjectMatrixPrimitiveType, Nullable } from '../shared';
17
+ import type { HorizontalAlign, VerticalAlign } from '../types/enum';
18
+ import type { IBorderData, IDocumentBody, IDocumentData, IStyleBase, IStyleData, ITextDecoration, ITextRotation } from '../types/interfaces';
19
+ import type { Styles } from './styles';
20
+ import type { ICellData, IRange } from './typedef';
21
+ import type { Worksheet } from './worksheet';
22
+ import { ObjectMatrix } from '../shared';
23
+ import { BooleanNumber, FontItalic, FontWeight, WrapStrategy } from '../types/enum';
7
24
  /**
8
25
  * getObjectValues options type
9
26
  */
@@ -1,8 +1,23 @@
1
- import { IObjectArrayPrimitiveType } from '../shared/object-matrix';
2
- import { Nullable } from '../shared/types';
3
- import { IStyleData } from '../types/interfaces';
4
- import { CustomData, IRange, IRowData, IWorksheetData } from './typedef';
5
- import { SheetViewModel } from './view-model';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
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 { IObjectArrayPrimitiveType } from '../shared/object-matrix';
17
+ import type { Nullable } from '../shared/types';
18
+ import type { IStyleData } from '../types/interfaces';
19
+ import type { CustomData, IRange, IRowData, IWorksheetData } from './typedef';
20
+ import type { SheetViewModel } from './view-model';
6
21
  /**
7
22
  * Manage configuration information of all rows, get row height, row length, set row height, etc.
8
23
  */