@ckeditor/ckeditor5-typing 48.2.0-alpha.7 → 48.3.0-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/dist/augmentation.d.ts +25 -25
- package/dist/delete.d.ts +29 -29
- package/dist/deletecommand.d.ts +78 -78
- package/dist/deleteobserver.d.ts +48 -48
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +24 -24
- package/dist/index.js +1969 -2524
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +28 -28
- package/dist/inserttextcommand.d.ts +64 -66
- package/dist/inserttextobserver.d.ts +55 -55
- package/dist/texttransformation.d.ts +34 -34
- package/dist/textwatcher.d.ts +118 -119
- package/dist/twostepcaretmovement.d.ts +234 -234
- package/dist/typing.d.ts +22 -22
- package/dist/typingconfig.d.ts +193 -193
- package/dist/utils/changebuffer.d.ts +98 -98
- package/dist/utils/findattributerange.d.ts +27 -27
- package/dist/utils/getlasttextline.d.ts +42 -42
- package/dist/utils/inlinehighlight.d.ts +30 -30
- package/package.json +4 -4
- package/dist/index.css.map +0 -1
package/dist/input.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
6
|
+
* @module typing/input
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Handles text input coming from the keyboard or other input methods.
|
|
11
|
+
*/
|
|
12
12
|
export declare class Input extends Plugin {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The queue of `insertText` command executions that are waiting for the DOM to get updated after beforeinput event.
|
|
15
|
+
*/
|
|
16
|
+
private _typingQueue;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "Input";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static override get isOfficialPlugin(): true;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
init(): void;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
override destroy(): void;
|
|
33
33
|
}
|
|
@@ -1,76 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
9
|
-
import { TypingChangeBuffer } from
|
|
10
|
-
import type { ModelDocumentSelection, ModelRange, ModelSelection } from
|
|
6
|
+
* @module typing/inserttextcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { TypingChangeBuffer } from "./utils/changebuffer.js";
|
|
10
|
+
import type { ModelDocumentSelection, ModelRange, ModelSelection } from "@ckeditor/ckeditor5-engine";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* The insert text command. Used by the {@link module:typing/input~Input input feature} to handle typing.
|
|
13
|
+
*/
|
|
14
14
|
export declare class InsertTextCommand extends Command {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Typing's change buffer used to group subsequent changes into batches.
|
|
17
|
+
*/
|
|
18
|
+
private readonly _buffer;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of the command.
|
|
21
|
+
*
|
|
22
|
+
* @param undoStepSize The maximum number of atomic changes
|
|
23
|
+
* which can be contained in one batch in the command buffer.
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: Editor, undoStepSize: number);
|
|
26
|
+
/**
|
|
27
|
+
* The current change buffer.
|
|
28
|
+
*/
|
|
29
|
+
get buffer(): TypingChangeBuffer;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
override destroy(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Executes the input command. It replaces the content within the given range with the given text.
|
|
36
|
+
* Replacing is a two step process, first the content within the range is removed and then the new text is inserted
|
|
37
|
+
* at the beginning of the range (which after the removal is a collapsed range).
|
|
38
|
+
*
|
|
39
|
+
* @fires execute
|
|
40
|
+
* @param options The command options.
|
|
41
|
+
*/
|
|
42
|
+
override execute(options?: InsertTextCommandOptions): void;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
* Interface with parameters for executing InsertTextCommand.
|
|
46
|
+
*
|
|
47
|
+
* Both `range` and `selection` parameters are used for defining selection but should not be used together.
|
|
48
|
+
* If both are defined, only `selection` will be considered.
|
|
49
|
+
*/
|
|
50
50
|
export interface InsertTextCommandOptions {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The text to be inserted.
|
|
53
|
+
*/
|
|
54
|
+
text?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The selection in which the text is inserted.
|
|
57
|
+
* Inserting a text into a selection deletes the current content within selection ranges. If the selection is not specified,
|
|
58
|
+
* the current selection in the model will be used instead.
|
|
59
|
+
*/
|
|
60
|
+
selection?: ModelSelection | ModelDocumentSelection;
|
|
61
|
+
/**
|
|
62
|
+
* The range in which the text is inserted. Defaults to the first range in the current selection.
|
|
63
|
+
*/
|
|
64
|
+
range?: ModelRange;
|
|
65
|
+
/**
|
|
66
|
+
* The range where the selection should be placed after the insertion.
|
|
67
|
+
* If not specified, the selection will be placed right after the inserted text.
|
|
68
|
+
*/
|
|
69
|
+
resultRange?: ModelRange;
|
|
70
70
|
}
|
|
71
71
|
export interface InsertTextCommandExecuteEvent {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
data: [options: InsertTextCommandOptions]
|
|
75
|
-
];
|
|
72
|
+
name: "execute";
|
|
73
|
+
args: [data: [options: InsertTextCommandOptions]];
|
|
76
74
|
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ViewDocumentDomEventData, Observer, FocusObserver, type EditingView, type ViewDocumentSelection, type ViewSelection } from
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { ViewDocumentDomEventData, Observer, FocusObserver, type EditingView, type ViewDocumentSelection, type ViewSelection } from "@ckeditor/ckeditor5-engine";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
* Text insertion observer introduces the {@link module:engine/view/document~ViewDocument#event:insertText} event.
|
|
8
|
+
*/
|
|
9
9
|
export declare class InsertTextObserver extends Observer {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Instance of the focus observer. Insert text observer calls
|
|
12
|
+
* {@link module:engine/view/observer/focusobserver~FocusObserver#flush} to mark the latest focus change as complete.
|
|
13
|
+
*/
|
|
14
|
+
readonly focusObserver: FocusObserver;
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
constructor(view: EditingView);
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
observe(): void;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
stopObserving(): void;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
* Event fired when the user types text, for instance presses <kbd>A</kbd> or <kbd>?</kbd> in the
|
|
30
|
+
* editing view document.
|
|
31
|
+
*
|
|
32
|
+
* **Note**: This event will **not** fire for keystrokes such as <kbd>Delete</kbd> or <kbd>Enter</kbd>.
|
|
33
|
+
* They have dedicated events, see {@link module:engine/view/document~ViewDocument#event:delete} and
|
|
34
|
+
* {@link module:engine/view/document~ViewDocument#event:enter} to learn more.
|
|
35
|
+
*
|
|
36
|
+
* **Note**: This event is fired by the {@link module:typing/inserttextobserver~InsertTextObserver input feature}.
|
|
37
|
+
*
|
|
38
|
+
* @eventName module:engine/view/document~ViewDocument#insertText
|
|
39
|
+
* @param data The event data.
|
|
40
|
+
*/
|
|
41
41
|
export type ViewDocumentInsertTextEvent = {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
name: "insertText";
|
|
43
|
+
args: [data: InsertTextEventData];
|
|
44
44
|
};
|
|
45
45
|
export interface InsertTextEventData extends ViewDocumentDomEventData {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The text to be inserted.
|
|
48
|
+
*/
|
|
49
|
+
text: string;
|
|
50
|
+
/**
|
|
51
|
+
* The selection into which the text should be inserted.
|
|
52
|
+
* If not specified, the insertion should occur at the current view selection.
|
|
53
|
+
*/
|
|
54
|
+
selection?: ViewSelection | ViewDocumentSelection;
|
|
55
|
+
/**
|
|
56
|
+
* A flag indicating that event was fired during composition.
|
|
57
|
+
*
|
|
58
|
+
* Corresponds to the
|
|
59
|
+
* {@link module:engine/view/document~ViewDocument#event:compositionstart},
|
|
60
|
+
* {@link module:engine/view/document~ViewDocument#event:compositionupdate},
|
|
61
|
+
* and {@link module:engine/view/document~ViewDocument#event:compositionend } trio.
|
|
62
|
+
*/
|
|
63
|
+
isComposing?: boolean;
|
|
64
64
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin, type Editor } from
|
|
9
|
-
import { Delete } from
|
|
10
|
-
import { Input } from
|
|
6
|
+
* @module typing/texttransformation
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { Delete } from "./delete.js";
|
|
10
|
+
import { Input } from "./input.js";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* The text transformation plugin.
|
|
13
|
+
*/
|
|
14
14
|
export declare class TextTransformation extends Plugin {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get requires(): PluginDependenciesOf<[Delete, Input]>;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "TextTransformation";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static override get isOfficialPlugin(): true;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
constructor(editor: Editor);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Create new TextWatcher listening to the editor for typing and selection events.
|
|
37
|
+
*/
|
|
38
|
+
private _enableTransformationWatchers;
|
|
39
39
|
}
|
package/dist/textwatcher.d.ts
CHANGED
|
@@ -1,138 +1,137 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module typing/textwatcher
|
|
7
|
+
*/
|
|
8
|
+
import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import type { Batch, Model, ModelRange } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
declare const TextWatcherBase: ObservableMixinConstructor;
|
|
10
11
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare class TextWatcher extends
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
12
|
+
* The text watcher feature.
|
|
13
|
+
*
|
|
14
|
+
* Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},
|
|
15
|
+
* {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and
|
|
16
|
+
* {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TextWatcher extends TextWatcherBase {
|
|
19
|
+
/**
|
|
20
|
+
* The editor's model.
|
|
21
|
+
*/
|
|
22
|
+
readonly model: Model;
|
|
23
|
+
/**
|
|
24
|
+
* The function used to match the text.
|
|
25
|
+
*
|
|
26
|
+
* The test callback can return 3 values:
|
|
27
|
+
*
|
|
28
|
+
* * `false` if there is no match,
|
|
29
|
+
* * `true` if there is a match,
|
|
30
|
+
* * an object if there is a match and we want to pass some additional information to the {@link #event:matched:data} event.
|
|
31
|
+
*/
|
|
32
|
+
testCallback: (text: string) => unknown;
|
|
33
|
+
/**
|
|
34
|
+
* Whether there is a match currently.
|
|
35
|
+
*/
|
|
36
|
+
private _hasMatch;
|
|
37
|
+
/**
|
|
38
|
+
* Flag indicating whether the `TextWatcher` instance is enabled or disabled.
|
|
39
|
+
* A disabled TextWatcher will not evaluate text.
|
|
40
|
+
*
|
|
41
|
+
* To disable TextWatcher:
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* const watcher = new TextWatcher( editor.model, testCallback );
|
|
45
|
+
*
|
|
46
|
+
* // After this a testCallback will not be called.
|
|
47
|
+
* watcher.isEnabled = false;
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
isEnabled: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a text watcher instance.
|
|
53
|
+
*
|
|
54
|
+
* @param testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.
|
|
55
|
+
*/
|
|
56
|
+
constructor(model: Model, testCallback: (text: string) => unknown);
|
|
57
|
+
/**
|
|
58
|
+
* Flag indicating whether there is a match currently.
|
|
59
|
+
*/
|
|
60
|
+
get hasMatch(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Starts listening to the editor for typing and selection events.
|
|
63
|
+
*/
|
|
64
|
+
private _startListening;
|
|
65
|
+
/**
|
|
66
|
+
* Checks the editor content for matched text.
|
|
67
|
+
*
|
|
68
|
+
* @fires matched:data
|
|
69
|
+
* @fires matched:selection
|
|
70
|
+
* @fires unmatched
|
|
71
|
+
*
|
|
72
|
+
* @param suffix A suffix used for generating the event name.
|
|
73
|
+
* @param data Data object for event.
|
|
74
|
+
*/
|
|
75
|
+
private _evaluateTextBeforeSelection;
|
|
75
76
|
}
|
|
76
77
|
export type TextWatcherMatchedEvent<TCallbackResult extends Record<string, unknown> = Record<string, unknown>> = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} & TCallbackResult
|
|
84
|
-
];
|
|
78
|
+
name: "matched" | "matched:data" | "matched:selection";
|
|
79
|
+
args: [{
|
|
80
|
+
text: string;
|
|
81
|
+
range: ModelRange;
|
|
82
|
+
batch?: Batch;
|
|
83
|
+
} & TCallbackResult];
|
|
85
84
|
};
|
|
86
85
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
* Fired whenever the text watcher found a match for data changes.
|
|
87
|
+
*
|
|
88
|
+
* @eventName ~TextWatcher#matched:data
|
|
89
|
+
* @param data Event data.
|
|
90
|
+
* @param data.testResult The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
|
|
91
|
+
*/
|
|
93
92
|
export type TextWatcherMatchedDataEvent<TCallbackResult extends Record<string, unknown>> = {
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
name: "matched:data";
|
|
94
|
+
args: [data: TextWatcherMatchedTypingDataEventData & TCallbackResult];
|
|
96
95
|
};
|
|
97
96
|
export interface TextWatcherMatchedTypingDataEventData {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
/**
|
|
98
|
+
* The full text before selection to which the regexp was applied.
|
|
99
|
+
*/
|
|
100
|
+
text: string;
|
|
101
|
+
/**
|
|
102
|
+
* The range representing the position of the `data.text`.
|
|
103
|
+
*/
|
|
104
|
+
range: ModelRange;
|
|
105
|
+
batch: Batch;
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
* Fired whenever the text watcher found a match for selection changes.
|
|
109
|
+
*
|
|
110
|
+
* @eventName ~TextWatcher#matched:selection
|
|
111
|
+
* @param data Event data.
|
|
112
|
+
* @param data.testResult The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
|
|
113
|
+
*/
|
|
115
114
|
export type TextWatcherMatchedTypingSelectionEvent<TCallbackResult extends Record<string, unknown>> = {
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
name: "matched:selection";
|
|
116
|
+
args: [data: TextWatcherMatchedTypingSelectionEventData & TCallbackResult];
|
|
118
117
|
};
|
|
119
118
|
export interface TextWatcherMatchedTypingSelectionEventData {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
/**
|
|
120
|
+
* The full text before selection.
|
|
121
|
+
*/
|
|
122
|
+
text: string;
|
|
123
|
+
/**
|
|
124
|
+
* The range representing the position of the `data.text`.
|
|
125
|
+
*/
|
|
126
|
+
range: ModelRange;
|
|
128
127
|
}
|
|
129
128
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
* Fired whenever the text does not match anymore. Fired only when the text watcher found a match.
|
|
130
|
+
*
|
|
131
|
+
* @eventName ~TextWatcher#unmatched
|
|
132
|
+
*/
|
|
134
133
|
export type TextWatcherUnmatchedTypingEvent = {
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
name: "unmatched";
|
|
135
|
+
args: [];
|
|
137
136
|
};
|
|
138
137
|
export {};
|