@univerjs/docs 0.2.2 → 0.2.4-alpha.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.
- package/README.md +11 -2
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1944 -1700
- package/lib/types/basics/__tests__/plain-text.spec.d.ts +16 -0
- package/lib/types/basics/custom-decoration-factory.d.ts +1 -2
- package/lib/types/basics/custom-range-factory.d.ts +2 -2
- package/lib/types/basics/plain-text.d.ts +6 -0
- package/lib/types/basics/replace.d.ts +12 -0
- package/lib/types/basics/selection.d.ts +3 -5
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +7 -8
- package/lib/types/commands/commands/__tests__/mock-text-selection-render-manager.d.ts +1 -1
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +2 -1
- package/lib/types/commands/commands/core-editing.command.d.ts +1 -4
- package/lib/types/commands/commands/delete.command.d.ts +8 -1
- package/lib/types/commands/commands/list.command.d.ts +2 -1
- package/lib/types/commands/commands/replace-content.command.d.ts +11 -1
- package/lib/types/commands/mutations/core-editing.mutation.d.ts +3 -0
- package/lib/types/commands/operations/set-doc-zoom-ratio.operation.d.ts +1 -2
- package/lib/types/commands/util.d.ts +1 -2
- package/lib/types/controllers/custom-range.controller.d.ts +11 -0
- package/lib/types/doc-plugin.d.ts +1 -2
- package/lib/types/index.d.ts +6 -2
- package/lib/types/services/doc-custom-range.service.d.ts +10 -8
- package/lib/types/services/doc-interceptor/doc-interceptor.service.d.ts +1 -1
- package/lib/types/services/ime-input-manager.service.d.ts +1 -2
- package/lib/types/services/text-selection-manager.service.d.ts +4 -2
- package/lib/types/types/enums/delete-direction.d.ts +19 -0
- package/lib/umd/index.js +1 -1
- package/package.json +8 -10
|
@@ -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 {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CustomDecorationType, IMutationInfo, ITextRange } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { CustomDecorationType, IAccessor, IMutationInfo, ITextRange } from '@univerjs/core';
|
|
3
2
|
import { IRichTextEditingMutationParams } from '../commands/mutations/core-editing.mutation';
|
|
4
3
|
|
|
5
4
|
interface IAddCustomDecorationParam {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CustomRangeType, IDocumentBody, IMutationInfo, ITextRange } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { CustomRangeType, IAccessor, IDocumentBody, IMutationInfo, ITextRange } from '@univerjs/core';
|
|
3
2
|
import { IRichTextEditingMutationParams } from '../commands/mutations/core-editing.mutation';
|
|
4
3
|
|
|
5
4
|
interface IAddCustomRangeParam {
|
|
@@ -14,6 +13,7 @@ interface IAddCustomRangeFactoryParam {
|
|
|
14
13
|
segmentId?: string;
|
|
15
14
|
rangeId: string;
|
|
16
15
|
rangeType: CustomRangeType;
|
|
16
|
+
wholeEntity?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare function addCustomRangeBySelectionFactory(accessor: IAccessor, param: IAddCustomRangeFactoryParam): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
19
19
|
export interface IDeleteCustomRangeParam {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IAccessor, IDeleteAction, IDocumentBody, IMutationInfo, IRetainAction, ITextRange } from '@univerjs/core';
|
|
2
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
import { IRichTextEditingMutationParams } from '../commands/mutations/core-editing.mutation';
|
|
4
|
+
|
|
5
|
+
export declare function getRetainAndDeleteAndExcludeLineBreak(selection: ITextRange, body: IDocumentBody, segmentId?: string, memoryCursor?: number): Array<IRetainAction | IDeleteAction>;
|
|
6
|
+
export interface IReplaceSelectionFactoryParams {
|
|
7
|
+
unitId: string;
|
|
8
|
+
selection?: ITextRange;
|
|
9
|
+
body: IDocumentBody;
|
|
10
|
+
textRanges?: ITextRangeWithStyle[];
|
|
11
|
+
}
|
|
12
|
+
export declare function replaceSelectionFactory(accessor: IAccessor, params: IReplaceSelectionFactoryParams): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IDocumentBody, ITextRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DeleteDirection } from '../types/enums/delete-direction';
|
|
2
3
|
|
|
3
4
|
export declare function normalizeSelection(selection: ITextRange): {
|
|
4
5
|
startOffset: number;
|
|
@@ -13,11 +14,7 @@ export declare function getSelectionWithNoSymbolSide(selection: ITextRange, body
|
|
|
13
14
|
startOffset: number;
|
|
14
15
|
endOffset: number;
|
|
15
16
|
};
|
|
16
|
-
export declare function getDeleteSelection(selection:
|
|
17
|
-
collapsed: boolean;
|
|
18
|
-
startOffset: number;
|
|
19
|
-
endOffset: number;
|
|
20
|
-
};
|
|
17
|
+
export declare function getDeleteSelection<T extends ITextRange>(selection: T, body: IDocumentBody, direction?: DeleteDirection): T;
|
|
21
18
|
export declare function getInsertSelection(selection: ITextRange, body: IDocumentBody): ITextRange;
|
|
22
19
|
/**
|
|
23
20
|
* Ensure custom-range has a correct order,
|
|
@@ -26,3 +23,4 @@ export declare function getInsertSelection(selection: ITextRange, body: IDocumen
|
|
|
26
23
|
*/
|
|
27
24
|
export declare function getSelectionForAddCustomRange(selection: ITextRange, body: IDocumentBody): Nullable<ITextRange>;
|
|
28
25
|
export declare function getSelectionText(dataStream: string, start: number, end: number): string;
|
|
26
|
+
export declare function isSegmentIntersects(start: number, end: number, start2: number, end2: number): boolean;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { DocumentDataModel, IDocumentData, Nullable, IUniverInstanceService, RxDisposable, Univer } from '@univerjs/core';
|
|
2
|
-
import { Dependency, DependencyIdentifier, Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Dependency, DependencyIdentifier, DocumentDataModel, IDocumentData, Nullable, Injector, IUniverInstanceService, RxDisposable, Univer } from '@univerjs/core';
|
|
3
2
|
import { DocumentSkeleton, IRender, IRenderContext, IRenderModule, DocumentViewModel, IRenderManagerService } from '@univerjs/engine-render';
|
|
4
3
|
|
|
5
4
|
export declare function createCommandTestBed(workbookData?: IDocumentData, dependencies?: Dependency[]): {
|
|
6
5
|
univer: Univer;
|
|
7
6
|
get: {
|
|
8
|
-
<T>(id: DependencyIdentifier<T>, lookUp?: import('@
|
|
9
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@
|
|
10
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@
|
|
11
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@
|
|
12
|
-
<T>(id: DependencyIdentifier<T>, quantity?: import('@
|
|
13
|
-
<T>(id: DependencyIdentifier<T>, quantityOrLookup?: import('@
|
|
7
|
+
<T>(id: DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
8
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
|
|
9
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
|
|
10
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
|
|
11
|
+
<T>(id: DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
12
|
+
<T>(id: DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
14
13
|
};
|
|
15
14
|
doc: DocumentDataModel;
|
|
16
15
|
};
|
|
@@ -7,4 +7,4 @@ export declare class TextSelectionRenderManager {
|
|
|
7
7
|
removeAllTextRanges(): void;
|
|
8
8
|
addTextRanges(): void;
|
|
9
9
|
}
|
|
10
|
-
export declare const ITextSelectionRenderManager: import('@
|
|
10
|
+
export declare const ITextSelectionRenderManager: import('@univerjs/core').IdentifierDecorator<TextSelectionRenderManager>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICommand, IDocumentBody } from '@univerjs/core';
|
|
1
|
+
import { ICommand, IDocumentBody, ITextRange } from '@univerjs/core';
|
|
2
2
|
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
3
|
|
|
4
4
|
export interface IInnerPasteCommandParams {
|
|
@@ -10,5 +10,6 @@ export declare const InnerPasteCommand: ICommand<IInnerPasteCommandParams>;
|
|
|
10
10
|
export interface IInnerCutCommandParams {
|
|
11
11
|
segmentId: string;
|
|
12
12
|
textRanges: ITextRangeWithStyle[];
|
|
13
|
+
selections?: ITextRange[];
|
|
13
14
|
}
|
|
14
15
|
export declare const CutContentCommand: ICommand<IInnerCutCommandParams>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ICommand, IDocumentBody, IDocumentData, ITextRange, UpdateDocsAttributeType } from '@univerjs/core';
|
|
2
2
|
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
import { DeleteDirection } from '../../types/enums/delete-direction';
|
|
3
4
|
|
|
4
5
|
export interface IInsertCommandParams {
|
|
5
6
|
unitId: string;
|
|
@@ -14,10 +15,6 @@ export declare const EditorInsertTextCommandId = "doc.command.insert-text";
|
|
|
14
15
|
* The command to insert text. The changed range could be non-collapsed, mainly use in line break and normal input.
|
|
15
16
|
*/
|
|
16
17
|
export declare const InsertCommand: ICommand<IInsertCommandParams>;
|
|
17
|
-
export declare enum DeleteDirection {
|
|
18
|
-
LEFT = 0,
|
|
19
|
-
RIGHT = 1
|
|
20
|
-
}
|
|
21
18
|
export interface IDeleteCommandParams {
|
|
22
19
|
unitId: string;
|
|
23
20
|
range: ITextRange;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ICommand } from '@univerjs/core';
|
|
2
2
|
import { IActiveTextRange } from '@univerjs/engine-render';
|
|
3
|
-
import { DeleteDirection } from '
|
|
3
|
+
import { DeleteDirection } from '../../types/enums/delete-direction';
|
|
4
4
|
|
|
5
|
+
export interface IDeleteCustomBlockParams {
|
|
6
|
+
direction: DeleteDirection;
|
|
7
|
+
range: IActiveTextRange;
|
|
8
|
+
unitId: string;
|
|
9
|
+
drawingId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DeleteCustomBlockCommand: ICommand<IDeleteCustomBlockParams>;
|
|
5
12
|
interface IMergeTwoParagraphParams {
|
|
6
13
|
direction: DeleteDirection;
|
|
7
14
|
range: IActiveTextRange;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICommand, IParagraph, PresetListType } from '@univerjs/core';
|
|
1
|
+
import { ICommand, IParagraph, ISectionBreak, PresetListType } from '@univerjs/core';
|
|
2
2
|
import { IActiveTextRange } from '@univerjs/engine-render';
|
|
3
3
|
|
|
4
4
|
interface IListOperationCommandParams {
|
|
@@ -12,4 +12,5 @@ interface IOrderListCommandParams {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const OrderListCommand: ICommand<IOrderListCommandParams>;
|
|
14
14
|
export declare function getParagraphsInRange(activeRange: IActiveTextRange, paragraphs: IParagraph[]): IParagraph[];
|
|
15
|
+
export declare function findNearestSectionBreak(currentIndex: number, sectionBreaks: ISectionBreak[]): ISectionBreak | undefined;
|
|
15
16
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICommand, IDocumentBody } from '@univerjs/core';
|
|
1
|
+
import { ICommand, IDocumentBody, ITextRange } from '@univerjs/core';
|
|
2
2
|
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
3
|
|
|
4
4
|
interface IReplaceContentCommandParams {
|
|
@@ -6,6 +6,9 @@ interface IReplaceContentCommandParams {
|
|
|
6
6
|
body: IDocumentBody;
|
|
7
7
|
textRanges: ITextRangeWithStyle[];
|
|
8
8
|
segmentId?: string;
|
|
9
|
+
options: {
|
|
10
|
+
[key: string]: boolean;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
export declare const ReplaceContentCommand: ICommand<IReplaceContentCommandParams>;
|
|
11
14
|
interface ICoverContentCommandParams {
|
|
@@ -14,4 +17,11 @@ interface ICoverContentCommandParams {
|
|
|
14
17
|
segmentId?: string;
|
|
15
18
|
}
|
|
16
19
|
export declare const CoverContentCommand: ICommand<ICoverContentCommandParams>;
|
|
20
|
+
export interface IReplaceSelectionCommandParams {
|
|
21
|
+
unitId: string;
|
|
22
|
+
selection?: ITextRange;
|
|
23
|
+
body: IDocumentBody;
|
|
24
|
+
textRanges?: ITextRangeWithStyle[];
|
|
25
|
+
}
|
|
26
|
+
export declare const ReplaceSelectionCommand: ICommand<IReplaceSelectionCommandParams>;
|
|
17
27
|
export {};
|
|
@@ -11,6 +11,9 @@ export interface IRichTextEditingMutationParams extends IMutationCommonParams {
|
|
|
11
11
|
isCompositionEnd?: boolean;
|
|
12
12
|
noHistory?: boolean;
|
|
13
13
|
debounce?: boolean;
|
|
14
|
+
options?: {
|
|
15
|
+
[key: string]: boolean;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* The core mutator to change rich text actions. The execution result would be undo mutation params. Could be directly
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { TextSelectionManagerService } from '../services/text-selection-manager.service';
|
|
3
|
+
|
|
4
|
+
export declare class DocCustomRangeController extends Disposable {
|
|
5
|
+
private readonly _commandService;
|
|
6
|
+
private readonly _textSelectionManagerService;
|
|
7
|
+
private readonly _univerInstanceService;
|
|
8
|
+
constructor(_commandService: ICommandService, _textSelectionManagerService: TextSelectionManagerService, _univerInstanceService: IUniverInstanceService);
|
|
9
|
+
private _transformCustomRange;
|
|
10
|
+
private _initSelectionChange;
|
|
11
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
16
|
+
export { replaceSelectionFactory } from './basics/replace';
|
|
17
|
+
export { getSelectionText, getDeleteSelection, getInsertSelection, isSegmentIntersects } from './basics/selection';
|
|
17
18
|
export type { IDocObjectParam } from './basics/component-tools';
|
|
18
19
|
export { getDocObject, neoGetDocObject, getDocObjectById } from './basics/component-tools';
|
|
19
20
|
export * from './basics/docs-view-key';
|
|
@@ -26,7 +27,7 @@ export { DocCustomRangeService, type ICustomRangeHook } from './services/doc-cus
|
|
|
26
27
|
export { BreakLineCommand } from './commands/commands/break-line.command';
|
|
27
28
|
export { CutContentCommand, InnerPasteCommand } from './commands/commands/clipboard.inner.command';
|
|
28
29
|
export { InsertCommand, DeleteCommand, UpdateCommand, EditorInsertTextCommandId, type ICoverCommandParams, type IDeleteCommandParams, type IInsertCommandParams, type IUpdateCommandParams, } from './commands/commands/core-editing.command';
|
|
29
|
-
export { DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand } from './commands/commands/delete.command';
|
|
30
|
+
export { DeleteLeftCommand, DeleteRightCommand, DeleteCustomBlockCommand, MergeTwoParagraphCommand, type IDeleteCustomBlockParams } from './commands/commands/delete.command';
|
|
30
31
|
export { IMEInputCommand, type IIMEInputCommandParams } from './commands/commands/ime-input.command';
|
|
31
32
|
export { SetInlineFormatBoldCommand, SetInlineFormatItalicCommand, SetInlineFormatUnderlineCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatFontSizeCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatTextColorCommand, SetInlineFormatTextBackgroundColorCommand, ResetInlineFormatTextBackgroundColorCommand, SetInlineFormatCommand, } from './commands/commands/inline-format.command';
|
|
32
33
|
export { ListOperationCommand, BulletListCommand, OrderListCommand } from './commands/commands/list.command';
|
|
@@ -42,3 +43,6 @@ export { MoveCursorOperation, MoveSelectionOperation } from './commands/operatio
|
|
|
42
43
|
export { SelectAllOperation } from './commands/operations/select-all.operation';
|
|
43
44
|
export { SetDocZoomRatioOperation, type ISetDocZoomRatioOperationParams } from './commands/operations/set-doc-zoom-ratio.operation';
|
|
44
45
|
export { SetTextSelectionsOperation, type ISetTextSelectionsOperationParams, } from './commands/operations/text-selection.operation';
|
|
46
|
+
export { getRetainAndDeleteFromReplace } from './basics/retain-delete-params';
|
|
47
|
+
export { getRichTextEditPath } from './commands/util';
|
|
48
|
+
export { getPlainTextFormDocument } from './basics/plain-text';
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
1
|
+
import { ICustomRange, IDisposable } from '@univerjs/core';
|
|
3
2
|
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
rangeType: CustomRangeType;
|
|
3
|
+
export interface ICustomRangeData extends ICustomRange {
|
|
4
|
+
data?: string;
|
|
7
5
|
}
|
|
8
6
|
export interface ICustomRangeHook {
|
|
9
|
-
onCopyCustomRange?: (range:
|
|
7
|
+
onCopyCustomRange?: (unitId: string, range: ICustomRangeData) => ICustomRange;
|
|
10
8
|
}
|
|
11
9
|
export declare class DocCustomRangeService {
|
|
12
10
|
private _customRangeHooks;
|
|
13
11
|
addClipboardHook(hook: ICustomRangeHook): IDisposable;
|
|
14
|
-
copyCustomRange(range:
|
|
12
|
+
copyCustomRange(unitId: string, range: ICustomRangeData): {
|
|
13
|
+
data?: string;
|
|
14
|
+
startIndex: number;
|
|
15
|
+
endIndex: number;
|
|
15
16
|
rangeId: string;
|
|
16
|
-
rangeType: CustomRangeType;
|
|
17
|
+
rangeType: import('@univerjs/core').CustomRangeType;
|
|
18
|
+
wholeEntity?: boolean;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
@@ -7,7 +7,7 @@ export declare class DocInterceptorService extends Disposable implements IRender
|
|
|
7
7
|
private readonly _docSkeletonManagerService;
|
|
8
8
|
private _interceptorsByName;
|
|
9
9
|
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService);
|
|
10
|
-
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): import('@
|
|
10
|
+
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): import('@univerjs/core').IDisposable;
|
|
11
11
|
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: import('@univerjs/core/common/type-util.js').Nullable<T>, initContext: C) => import('@univerjs/core/common/type-util.js').Nullable<T>;
|
|
12
12
|
interceptDocumentViewModel(viewModel: DocumentViewModel): DisposableCollection;
|
|
13
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
1
|
+
import { IDisposable, Nullable } from '@univerjs/core';
|
|
2
2
|
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
4
3
|
import { IRichTextEditingMutationParams } from '../commands/mutations/core-editing.mutation';
|
|
5
4
|
|
|
6
5
|
interface ICacheParams {
|
|
@@ -36,11 +36,13 @@ export declare class TextSelectionManagerService extends RxDisposable {
|
|
|
36
36
|
refreshSelection(): void;
|
|
37
37
|
setCurrentSelection(param: ITextSelectionManagerSearchParam): void;
|
|
38
38
|
setCurrentSelectionNotRefresh(param: ITextSelectionManagerSearchParam): void;
|
|
39
|
-
|
|
39
|
+
getCurrentSelections(): Readonly<Nullable<TextRange[]>>;
|
|
40
40
|
getActiveTextRange(): Nullable<TextRange>;
|
|
41
41
|
getActiveRange(): Nullable<ITextActiveRange>;
|
|
42
42
|
add(textRanges: ISuccinctTextRangeParam[], isEditing?: boolean): void;
|
|
43
|
-
replaceTextRanges(textRanges: ISuccinctTextRangeParam[], isEditing?: boolean
|
|
43
|
+
replaceTextRanges(textRanges: ISuccinctTextRangeParam[], isEditing?: boolean, options?: {
|
|
44
|
+
[key: string]: boolean;
|
|
45
|
+
}): void;
|
|
44
46
|
private _syncSelectionFromRenderService;
|
|
45
47
|
private _replaceTextRangesWithNoRefresh;
|
|
46
48
|
private _getTextRanges;
|
|
@@ -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
|
+
}
|