@univerjs/core 0.2.12 → 0.2.14
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/lib/cjs/index.js +5 -5
- package/lib/es/index.js +438 -20
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -4
- package/lib/types/docs/data-model/index.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/build-utils/__test__/custom-range.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +14 -0
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +28 -0
- package/lib/types/docs/data-model/text-x/build-utils/selection.d.ts +29 -0
- package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +38 -0
- package/lib/types/docs/data-model/text-x/utils.d.ts +1 -1
- package/lib/types/services/__tests__/index.d.ts +6 -6
- package/lib/types/services/authz-io/type.d.ts +1 -1
- package/lib/types/services/command/command.service.d.ts +3 -3
- package/lib/types/services/config/config.service.d.ts +1 -1
- package/lib/types/services/context/context.service.d.ts +1 -1
- package/lib/types/services/instance/instance.service.d.ts +1 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
- package/lib/types/services/log/log.service.d.ts +1 -1
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/resource-loader/type.d.ts +1 -1
- package/lib/types/services/resource-manager/type.d.ts +1 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts +1 -1
- package/lib/types/shared/common.d.ts +3 -2
- package/lib/types/sheets/row-manager.d.ts +2 -2
- package/lib/types/sheets/typedef.d.ts +25 -5
- package/lib/types/sheets/view-model.d.ts +1 -1
- package/lib/types/sheets/worksheet.d.ts +13 -7
- package/lib/types/slides/slide-model.d.ts +3 -3
- package/lib/types/types/const/const.d.ts +0 -4
- package/lib/types/types/enum/delete-direction.d.ts +19 -0
- package/lib/types/types/enum/index.d.ts +1 -0
- package/lib/types/types/interfaces/i-need-check-disposable.d.ts +4 -0
- package/lib/types/types/interfaces/index.d.ts +1 -0
- package/lib/umd/index.js +5 -5
- package/package.json +5 -5
|
@@ -25,7 +25,7 @@ declare class DocumentDataModelSimple extends UnitModel<IDocumentData, UniverIns
|
|
|
25
25
|
setName(name: string): void;
|
|
26
26
|
get drawings(): IDrawings | undefined;
|
|
27
27
|
get documentStyle(): IDocumentStyle;
|
|
28
|
-
get lists(): import('
|
|
28
|
+
get lists(): import('../..').ILists | undefined;
|
|
29
29
|
get zoomRatio(): number;
|
|
30
30
|
resetDrawing(drawings: IDrawings, drawingsOrder: string[]): void;
|
|
31
31
|
getBody(): IDocumentBody | undefined;
|
|
@@ -47,11 +47,11 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
|
|
|
47
47
|
dispose(): void;
|
|
48
48
|
getDrawings(): IDrawings | undefined;
|
|
49
49
|
getDrawingsOrder(): string[] | undefined;
|
|
50
|
-
getCustomRanges(): import('
|
|
51
|
-
getCustomDecorations(): import('
|
|
50
|
+
getCustomRanges(): import('../..').ICustomRange<Record<string, any>>[] | undefined;
|
|
51
|
+
getCustomDecorations(): import('../..').ICustomDecoration[] | undefined;
|
|
52
52
|
getRev(): number;
|
|
53
53
|
incrementRev(): void;
|
|
54
|
-
getSettings(): import('
|
|
54
|
+
getSettings(): import('../..').IDocumentSettings | undefined;
|
|
55
55
|
reset(snapshot: Partial<IDocumentData>): void;
|
|
56
56
|
getSelfOrHeaderFooterModel(segmentId?: string): DocumentDataModel;
|
|
57
57
|
getUnitId(): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataStreamTreeTokenType, ICustomRange, ITextRange } from '@univerjs/core';
|
|
2
|
+
export declare function isCustomRangeSplitSymbol(text: string): text is DataStreamTreeTokenType.CUSTOM_RANGE_START | DataStreamTreeTokenType.CUSTOM_RANGE_END;
|
|
3
|
+
export declare function isIntersecting(line1Start: number, line1End: number, line2Start: number, line2End: number): boolean;
|
|
4
|
+
export declare function shouldDeleteCustomRange(deleteStart: number, deleteLen: number, customRange: ICustomRange, dataStream: string): boolean;
|
|
5
|
+
export declare function getCustomRangesInterestsWithRange(range: ITextRange, customRanges: ICustomRange[]): ICustomRange<Record<string, any>>[];
|
|
6
|
+
export declare function copyCustomRange(range: ICustomRange): {
|
|
7
|
+
rangeId: string;
|
|
8
|
+
startIndex: number;
|
|
9
|
+
endIndex: number;
|
|
10
|
+
rangeType: import('@univerjs/core').CustomRangeType | number;
|
|
11
|
+
wholeEntity?: boolean;
|
|
12
|
+
properties?: Record<string, any> | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function excludePointsFromRange(range: [number, number], points: number[]): [number, number][];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { copyCustomRange, getCustomRangesInterestsWithRange, isIntersecting, shouldDeleteCustomRange } from './custom-range';
|
|
2
|
+
import { getDeleteSelection, getInsertSelection, getRetainAndDeleteFromReplace, getSelectionWithNoSymbolSide, getSelectionWithSymbolMax, isSegmentIntersects, makeSelection, normalizeSelection } from './selection';
|
|
3
|
+
import { addCustomRangeTextX, deleteCustomRangeTextX, getRetainAndDeleteAndExcludeLineBreak } from './text-x-utils';
|
|
4
|
+
export declare class BuildTextUtils {
|
|
5
|
+
static customRange: {
|
|
6
|
+
add: typeof addCustomRangeTextX;
|
|
7
|
+
delete: typeof deleteCustomRangeTextX;
|
|
8
|
+
copyCustomRange: typeof copyCustomRange;
|
|
9
|
+
getCustomRangesInterestsWithRange: typeof getCustomRangesInterestsWithRange;
|
|
10
|
+
shouldDeleteCustomRange: typeof shouldDeleteCustomRange;
|
|
11
|
+
isIntersecting: typeof isIntersecting;
|
|
12
|
+
};
|
|
13
|
+
static selection: {
|
|
14
|
+
replace: (params: import('./text-x-utils').IReplaceSelectionTextXParams) => false | import('../text-x').TextX;
|
|
15
|
+
makeSelection: typeof makeSelection;
|
|
16
|
+
normalizeSelection: typeof normalizeSelection;
|
|
17
|
+
getSelectionWithSymbolMax: typeof getSelectionWithSymbolMax;
|
|
18
|
+
getSelectionWithNoSymbolSide: typeof getSelectionWithNoSymbolSide;
|
|
19
|
+
getDeleteSelection: typeof getDeleteSelection;
|
|
20
|
+
getInsertSelection: typeof getInsertSelection;
|
|
21
|
+
getDeleteActions: typeof getRetainAndDeleteFromReplace;
|
|
22
|
+
getDeleteExculdeLastLineBreakActions: typeof getRetainAndDeleteAndExcludeLineBreak;
|
|
23
|
+
};
|
|
24
|
+
static range: {
|
|
25
|
+
isIntersects: typeof isSegmentIntersects;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type { IAddCustomRangeTextXParam, IDeleteCustomRangeParam, IReplaceSelectionTextXParams } from './text-x-utils';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DeleteDirection } from '../../../../types/enum';
|
|
2
|
+
import { Nullable } from '../../../../shared';
|
|
3
|
+
import { ITextRange } from '../../../../sheets/typedef';
|
|
4
|
+
import { IDocumentBody } from '../../../../types/interfaces';
|
|
5
|
+
import { IDeleteAction, IRetainAction } from '../action-types';
|
|
6
|
+
export declare function makeSelection(startOffset: number, endOffset?: number): ITextRange;
|
|
7
|
+
export declare function normalizeSelection(selection: ITextRange): ITextRange;
|
|
8
|
+
export declare function getSelectionWithSymbolMax(selection: ITextRange, body: IDocumentBody): {
|
|
9
|
+
startOffset: number;
|
|
10
|
+
endOffset: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function getSelectionWithNoSymbolSide(selection: ITextRange, body: IDocumentBody): {
|
|
13
|
+
startOffset: number;
|
|
14
|
+
endOffset: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getDeleteSelection<T extends ITextRange>(selection: T, body: IDocumentBody, direction?: DeleteDirection): T;
|
|
17
|
+
export declare function getInsertSelection<T extends ITextRange>(selection: T, body: IDocumentBody): T;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure custom-range has a correct order,
|
|
20
|
+
* when range contains range, it won't be present as intersect. <br/>
|
|
21
|
+
* For Example `\s1\s2 text \s1\s2` is not allowed, expect `\s1\s2 text \s2\s1`
|
|
22
|
+
*/
|
|
23
|
+
export declare function getSelectionForAddCustomRange(selection: ITextRange, body: IDocumentBody): Nullable<ITextRange>;
|
|
24
|
+
export declare function isSegmentIntersects(start: number, end: number, start2: number, end2: number): boolean;
|
|
25
|
+
export declare function getRetainAndDeleteFromReplace(range: ITextRange, segmentId: string | undefined, memoryCursor: number, body: IDocumentBody): {
|
|
26
|
+
dos: (IRetainAction | IDeleteAction)[];
|
|
27
|
+
cursor: number;
|
|
28
|
+
retain: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IAccessor } from '@wendellhu/redi';
|
|
2
|
+
import { TextX } from '../text-x';
|
|
3
|
+
import { Nullable } from '../../../../shared';
|
|
4
|
+
import { ITextRange, ITextRangeParam } from '../../../../sheets/typedef';
|
|
5
|
+
import { CustomRangeType, IDocumentBody } from '../../../../types/interfaces';
|
|
6
|
+
import { DocumentDataModel } from '../../document-data-model';
|
|
7
|
+
import { IDeleteAction, IRetainAction } from '../action-types';
|
|
8
|
+
export interface IDeleteCustomRangeParam {
|
|
9
|
+
rangeId: string;
|
|
10
|
+
segmentId?: string;
|
|
11
|
+
documentDataModel: DocumentDataModel;
|
|
12
|
+
insert?: Nullable<IDocumentBody>;
|
|
13
|
+
}
|
|
14
|
+
export declare function deleteCustomRangeTextX(accessor: IAccessor, params: IDeleteCustomRangeParam): false | TextX;
|
|
15
|
+
export interface IAddCustomRangeTextXParam {
|
|
16
|
+
range: ITextRange;
|
|
17
|
+
segmentId?: string;
|
|
18
|
+
rangeId: string;
|
|
19
|
+
rangeType: CustomRangeType;
|
|
20
|
+
properties?: Record<string, any>;
|
|
21
|
+
wholeEntity?: boolean;
|
|
22
|
+
body: IDocumentBody;
|
|
23
|
+
}
|
|
24
|
+
export declare function addCustomRangeTextX(param: IAddCustomRangeTextXParam): false | TextX;
|
|
25
|
+
export declare function getRetainAndDeleteAndExcludeLineBreak(selection: ITextRange, body: IDocumentBody, segmentId?: string, memoryCursor?: number, preserveLineBreak?: boolean): Array<IRetainAction | IDeleteAction>;
|
|
26
|
+
export interface IReplaceSelectionTextXParams {
|
|
27
|
+
/**
|
|
28
|
+
* range to be replaced.
|
|
29
|
+
*/
|
|
30
|
+
selection: ITextRangeParam;
|
|
31
|
+
/** Body to be inserted at the given position. */
|
|
32
|
+
body: IDocumentBody;
|
|
33
|
+
/**
|
|
34
|
+
* origin document data model.
|
|
35
|
+
*/
|
|
36
|
+
doc: DocumentDataModel;
|
|
37
|
+
}
|
|
38
|
+
export declare const replaceSelectionTextX: (params: IReplaceSelectionTextXParams) => false | TextX;
|
|
@@ -12,7 +12,7 @@ export declare function getCustomRangeSlice(body: IDocumentBody, startOffset: nu
|
|
|
12
12
|
startIndex: number;
|
|
13
13
|
endIndex: number;
|
|
14
14
|
rangeId: string;
|
|
15
|
-
rangeType: import('
|
|
15
|
+
rangeType: import('../../..').CustomRangeType | number;
|
|
16
16
|
wholeEntity?: boolean;
|
|
17
17
|
properties?: Record<string, any> | undefined;
|
|
18
18
|
}[];
|
|
@@ -3,12 +3,12 @@ import { Dependency } from '../../common/di';
|
|
|
3
3
|
export declare const createTestBed: (dependencies?: Dependency[]) => {
|
|
4
4
|
univer: Univer;
|
|
5
5
|
get: {
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
12
|
};
|
|
13
13
|
workbook: import('@univerjs/core').Workbook;
|
|
14
14
|
unitId: string;
|
|
@@ -16,4 +16,4 @@ export interface IAuthzIoService {
|
|
|
16
16
|
createCollaborator(config: ICreateCollaboratorRequest, context?: ILogContext): Promise<void>;
|
|
17
17
|
putCollaborators(config: IPutCollaboratorsRequest, context?: ILogContext): Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
export declare const IAuthzIoService: import('
|
|
19
|
+
export declare const IAuthzIoService: import('@wendellhu/redi').IdentifierDecorator<IAuthzIoService>;
|
|
@@ -148,7 +148,7 @@ export type CommandListener = (commandInfo: Readonly<ICommandInfo>, options?: IE
|
|
|
148
148
|
/**
|
|
149
149
|
* The identifier of the command service.
|
|
150
150
|
*/
|
|
151
|
-
export declare const ICommandService: import('
|
|
151
|
+
export declare const ICommandService: import('@wendellhu/redi').IdentifierDecorator<ICommandService>;
|
|
152
152
|
/**
|
|
153
153
|
* The service to register and execute commands.
|
|
154
154
|
*/
|
|
@@ -229,6 +229,6 @@ export declare class CommandService extends Disposable implements ICommandServic
|
|
|
229
229
|
private _execute;
|
|
230
230
|
private _syncExecute;
|
|
231
231
|
}
|
|
232
|
-
export declare function sequenceExecute(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): import('
|
|
233
|
-
export declare function sequenceExecuteAsync(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): Promise<import('
|
|
232
|
+
export declare function sequenceExecute(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): import('../..').ISequenceExecuteResult;
|
|
233
|
+
export declare function sequenceExecuteAsync(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): Promise<import('../..').ISequenceExecuteResult>;
|
|
234
234
|
export {};
|
|
@@ -2,7 +2,7 @@ import { Nullable } from '../../shared/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* IConfig provides universal configuration for the whole application.
|
|
4
4
|
*/
|
|
5
|
-
export declare const IConfigService: import('
|
|
5
|
+
export declare const IConfigService: import('@wendellhu/redi').IdentifierDecorator<IConfigService>;
|
|
6
6
|
interface IConfigOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Whether the configuration is read-only.
|
|
@@ -8,7 +8,7 @@ export interface IContextService {
|
|
|
8
8
|
setContextValue(key: string, value: boolean): void;
|
|
9
9
|
subscribeContextValue$(key: string): Observable<boolean>;
|
|
10
10
|
}
|
|
11
|
-
export declare const IContextService: import('
|
|
11
|
+
export declare const IContextService: import('@wendellhu/redi').IdentifierDecorator<IContextService>;
|
|
12
12
|
export declare class ContextService extends Disposable implements IContextService {
|
|
13
13
|
private _contextChanged$;
|
|
14
14
|
readonly contextChanged$: Observable<{
|
|
@@ -57,7 +57,7 @@ export interface IUniverInstanceService {
|
|
|
57
57
|
/** @deprecated */
|
|
58
58
|
getCurrentUniverDocInstance(): Nullable<DocumentDataModel>;
|
|
59
59
|
}
|
|
60
|
-
export declare const IUniverInstanceService: import('
|
|
60
|
+
export declare const IUniverInstanceService: import('@wendellhu/redi').IdentifierDecorator<IUniverInstanceService>;
|
|
61
61
|
export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
|
|
62
62
|
private readonly _injector;
|
|
63
63
|
private readonly _contextService;
|
|
@@ -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>;
|
|
@@ -14,7 +14,7 @@ export interface ILogService {
|
|
|
14
14
|
error(...args: ArgsType): void;
|
|
15
15
|
setLogLevel(enabled: LogLevel): void;
|
|
16
16
|
}
|
|
17
|
-
export declare const ILogService: import('
|
|
17
|
+
export declare const ILogService: import('@wendellhu/redi').IdentifierDecorator<ILogService>;
|
|
18
18
|
export declare class DesktopLogService extends Disposable implements ILogService {
|
|
19
19
|
private _logLevel;
|
|
20
20
|
debug(...args: ArgsType): void;
|
|
@@ -39,4 +39,4 @@ export interface IPermissionService {
|
|
|
39
39
|
composePermission(permissionId: string[]): IPermissionPoint<unknown>[];
|
|
40
40
|
getAllPermissionPoint(): Map<string, Observable<IPermissionPoint<unknown>>>;
|
|
41
41
|
}
|
|
42
|
-
export declare const IPermissionService: import('
|
|
42
|
+
export declare const IPermissionService: import('@wendellhu/redi').IdentifierDecorator<IPermissionService>;
|
|
@@ -4,4 +4,4 @@ export interface IResourceLoaderService {
|
|
|
4
4
|
resources: IResources;
|
|
5
5
|
} | null;
|
|
6
6
|
}
|
|
7
|
-
export declare const IResourceLoaderService: import('
|
|
7
|
+
export declare const IResourceLoaderService: import('@wendellhu/redi').IdentifierDecorator<IResourceLoaderService>;
|
|
@@ -30,5 +30,5 @@ export interface IResourceManagerService {
|
|
|
30
30
|
loadResources: (unitId: string, resources?: IResources) => void;
|
|
31
31
|
unloadResources(unitId: string): void;
|
|
32
32
|
}
|
|
33
|
-
export declare const IResourceManagerService: import('@
|
|
33
|
+
export declare const IResourceManagerService: import('@wendellhu/redi').IdentifierDecorator<IResourceManagerService>;
|
|
34
34
|
export {};
|
|
@@ -43,7 +43,7 @@ export interface IUndoRedoCommandInfos {
|
|
|
43
43
|
undos: IMutationInfo[];
|
|
44
44
|
redos: IMutationInfo[];
|
|
45
45
|
}
|
|
46
|
-
export declare const IUndoRedoService: import('
|
|
46
|
+
export declare const IUndoRedoService: import('@wendellhu/redi').IdentifierDecorator<IUndoRedoService>;
|
|
47
47
|
export interface IUndoRedoStatus {
|
|
48
48
|
undos: number;
|
|
49
49
|
redos: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ICellData, ICellDataForSheetInterceptor, IRange, IRangeWithCoord, ISelectionCell, ISelectionCellWithMergeInfo } from '../sheets/typedef';
|
|
2
|
+
import { Worksheet } from '../sheets/worksheet';
|
|
2
3
|
import { IDocumentData } from '../types/interfaces/i-document-data';
|
|
3
4
|
import { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
|
|
4
5
|
import { Nullable } from './types';
|
|
@@ -26,8 +27,8 @@ export declare function isFormulaId(value: any): boolean;
|
|
|
26
27
|
*/
|
|
27
28
|
export declare function handleStyleToString(style: IStyleData, isCell?: boolean): string;
|
|
28
29
|
export declare function getBorderStyleType(type: string): number;
|
|
29
|
-
export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import('
|
|
30
|
-
export declare function isValidRange(range: IRange): boolean;
|
|
30
|
+
export declare function getDocsUpdateBody(model: IDocumentData, segmentId?: string): import('..').IDocumentBody | undefined;
|
|
31
|
+
export declare function isValidRange(range: IRange, worksheet?: Worksheet): boolean;
|
|
31
32
|
/**
|
|
32
33
|
* Covert row/column to range object
|
|
33
34
|
* @param row
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IObjectArrayPrimitiveType } from '../shared/object-matrix';
|
|
2
|
-
import { Nullable } from '../shared/types';
|
|
3
2
|
import { IRange, IRowData, IWorksheetData } from './typedef';
|
|
3
|
+
import { Nullable } from '../shared/types';
|
|
4
4
|
import { SheetViewModel } from './view-model';
|
|
5
5
|
/**
|
|
6
6
|
* Manage configuration information of all rows, get row height, row length, set row height, etc.
|
|
@@ -21,7 +21,7 @@ export declare class RowManager {
|
|
|
21
21
|
/**
|
|
22
22
|
* Get row data of given row
|
|
23
23
|
* @param rowPos row index
|
|
24
|
-
* @returns
|
|
24
|
+
* @returns {Nullable<Partial<IRowData>>} rowData
|
|
25
25
|
*/
|
|
26
26
|
getRow(rowPos: number): Nullable<Partial<IRowData>>;
|
|
27
27
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IStyleData } from '../types/interfaces/i-style-data';
|
|
1
|
+
import { BooleanNumber, CellValueType } from '../types/enum';
|
|
3
2
|
import { IResources } from '../services/resource-manager/type';
|
|
4
3
|
import { IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, Nullable } from '../shared';
|
|
5
|
-
import {
|
|
4
|
+
import { LocaleType } from '../types/enum/locale-type';
|
|
6
5
|
import { IDocumentData } from '../types/interfaces';
|
|
7
6
|
import { ICellCustomRender } from '../types/interfaces/i-cell-custom-render';
|
|
8
7
|
import { ICellValidationData } from '../types/interfaces/i-cell-validation-data';
|
|
8
|
+
import { IStyleData } from '../types/interfaces/i-style-data';
|
|
9
9
|
/**
|
|
10
10
|
* Snapshot of a workbook.
|
|
11
11
|
*/
|
|
@@ -189,6 +189,15 @@ export interface ICellDataForSheetInterceptor extends ICellData {
|
|
|
189
189
|
* can cell be covered when sibling is overflow
|
|
190
190
|
*/
|
|
191
191
|
coverable?: boolean;
|
|
192
|
+
linkUrl?: string;
|
|
193
|
+
linkId?: string;
|
|
194
|
+
fontRenderExtension?: {
|
|
195
|
+
leftOffset?: number;
|
|
196
|
+
rightOffset?: number;
|
|
197
|
+
topOffset?: number;
|
|
198
|
+
downOffset?: number;
|
|
199
|
+
isSkip?: boolean;
|
|
200
|
+
};
|
|
192
201
|
}
|
|
193
202
|
export declare function isICellData(value: any): value is ICellData;
|
|
194
203
|
export declare function getCellValueType(cell: ICellData): CellValueType | null | undefined;
|
|
@@ -425,8 +434,8 @@ export interface ISelection {
|
|
|
425
434
|
primary: Nullable<ISelectionCell>;
|
|
426
435
|
}
|
|
427
436
|
/**
|
|
428
|
-
* Selection range Info, contains
|
|
429
|
-
*
|
|
437
|
+
* Selection range Info, contains selection range & primary range
|
|
438
|
+
* primary range is the range of the highlighted cell.
|
|
430
439
|
*/
|
|
431
440
|
export interface ISelectionWithCoord {
|
|
432
441
|
rangeWithCoord: IRangeWithCoord;
|
|
@@ -435,14 +444,25 @@ export interface ISelectionWithCoord {
|
|
|
435
444
|
export interface ITextRangeStart {
|
|
436
445
|
startOffset: number;
|
|
437
446
|
}
|
|
447
|
+
export declare enum RANGE_DIRECTION {
|
|
448
|
+
NONE = "none",
|
|
449
|
+
BACKWARD = "backward",
|
|
450
|
+
FORWARD = "forward"
|
|
451
|
+
}
|
|
438
452
|
export interface ITextRange extends ITextRangeStart {
|
|
439
453
|
endOffset: number;
|
|
440
454
|
collapsed: boolean;
|
|
455
|
+
direction?: RANGE_DIRECTION;
|
|
456
|
+
}
|
|
457
|
+
export declare enum DOC_RANGE_TYPE {
|
|
458
|
+
RECT = "RECT",
|
|
459
|
+
TEXT = "TEXT"
|
|
441
460
|
}
|
|
442
461
|
export interface ITextRangeParam extends ITextRange {
|
|
443
462
|
segmentId?: string;
|
|
444
463
|
segmentPage?: number;
|
|
445
464
|
isActive?: boolean;
|
|
465
|
+
rangeType?: DOC_RANGE_TYPE;
|
|
446
466
|
}
|
|
447
467
|
/**
|
|
448
468
|
* Determines whether the cell(row, column) is within the range of the merged cells.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ObjectMatrix, Nullable } from '../shared';
|
|
2
2
|
import { BooleanNumber } from '../types/enum';
|
|
3
3
|
import { ColumnManager } from './column-manager';
|
|
4
4
|
import { Range } from './range';
|
|
5
5
|
import { RowManager } from './row-manager';
|
|
6
|
+
import { SheetViewModel } from './view-model';
|
|
6
7
|
import { Styles } from './styles';
|
|
7
8
|
import { ICellData, ICellDataForSheetInterceptor, IFreeze, IRange, IWorksheetData } from './typedef';
|
|
8
|
-
import { SheetViewModel } from './view-model';
|
|
9
9
|
/**
|
|
10
10
|
* The model of a Worksheet.
|
|
11
11
|
*/
|
|
@@ -159,13 +159,19 @@ export declare class Worksheet {
|
|
|
159
159
|
*/
|
|
160
160
|
getRowHeight(row: number): number;
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
162
|
+
* Row is filtered out, that means this row is invisible.
|
|
163
|
+
* @param row
|
|
164
|
+
* @returns {boolean} is row hidden by filter
|
|
165
|
+
*/
|
|
166
|
+
isRowFiltered(row: number): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Get if the row is visible. It may be affected by features like filter and view.
|
|
163
169
|
* @param row the row index
|
|
164
|
-
* @returns if the row in visible to the user
|
|
170
|
+
* @returns {boolean} if the row in visible to the user
|
|
165
171
|
*/
|
|
166
172
|
getRowVisible(row: number): boolean;
|
|
167
173
|
/**
|
|
168
|
-
* Get if the row does not have `hidden` property.
|
|
174
|
+
* Get if the row does not have `hidden` property. This value won't affected by features like filter and view.
|
|
169
175
|
* @param row the row index
|
|
170
176
|
* @returns if the row does not have `hidden` property
|
|
171
177
|
*/
|
|
@@ -174,12 +180,12 @@ export declare class Worksheet {
|
|
|
174
180
|
getColVisible(col: number): boolean;
|
|
175
181
|
getHiddenCols(start?: number, end?: number): IRange[];
|
|
176
182
|
/**
|
|
177
|
-
* Get all visible rows in the sheet.
|
|
183
|
+
* Get all visible rows in the sheet.(not include filter & view, like getRawVisibleRows)
|
|
178
184
|
* @returns Visible rows range list
|
|
179
185
|
*/
|
|
180
186
|
getVisibleRows(): IRange[];
|
|
181
187
|
/**
|
|
182
|
-
* Get all visible columns in the sheet.
|
|
188
|
+
* Get all visible columns in the sheet.(not include filter & view)
|
|
183
189
|
* @returns Visible columns range list
|
|
184
190
|
*/
|
|
185
191
|
getVisibleCols(): IRange[];
|
|
@@ -21,10 +21,10 @@ export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstance
|
|
|
21
21
|
getPageOrder(): string[] | undefined;
|
|
22
22
|
getPage(pageId: string): ISlidePage | undefined;
|
|
23
23
|
getElementsByPage(pageId: string): {
|
|
24
|
-
[elementId: string]: import('
|
|
24
|
+
[elementId: string]: import('..').IPageElement;
|
|
25
25
|
} | undefined;
|
|
26
|
-
getElement(pageId: string, elementId: string): import('
|
|
27
|
-
getPageSize(): import('
|
|
26
|
+
getElement(pageId: string, elementId: string): import('..').IPageElement | undefined;
|
|
27
|
+
getPageSize(): import('..').ISize;
|
|
28
28
|
getBlankPage(): {
|
|
29
29
|
id: string;
|
|
30
30
|
pageType: PageType;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum DeleteDirection {
|
|
17
|
+
LEFT = 0,
|
|
18
|
+
RIGHT = 1
|
|
19
|
+
}
|