@ckeditor/ckeditor5-utils 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.
Files changed (82) hide show
  1. package/dist/abortabledebounce.d.ts +19 -13
  2. package/dist/areconnectedthroughproperties.d.ts +7 -7
  3. package/dist/ckeditorerror.d.ts +113 -113
  4. package/dist/collection.d.ts +419 -415
  5. package/dist/collectstylesheets.d.ts +9 -9
  6. package/dist/comparearrays.d.ts +25 -25
  7. package/dist/config.d.ts +159 -156
  8. package/dist/count.d.ts +14 -14
  9. package/dist/crc32.d.ts +19 -19
  10. package/dist/decodelicensekey.d.ts +7 -7
  11. package/dist/delay.d.ts +13 -13
  12. package/dist/diff.d.ts +32 -27
  13. package/dist/difftochanges.d.ts +47 -47
  14. package/dist/dom/createelement.d.ts +43 -43
  15. package/dist/dom/emittermixin.d.ts +144 -135
  16. package/dist/dom/findclosestscrollableancestor.d.ts +8 -8
  17. package/dist/dom/getancestors.d.ts +13 -13
  18. package/dist/dom/getborderwidths.d.ts +16 -16
  19. package/dist/dom/getcommonancestor.d.ts +9 -9
  20. package/dist/dom/getdatafromelement.d.ts +10 -10
  21. package/dist/dom/getpositionedancestor.d.ts +7 -7
  22. package/dist/dom/getrangefrommouseevent.d.ts +12 -12
  23. package/dist/dom/getvisualviewportoffset.d.ts +7 -7
  24. package/dist/dom/global.d.ts +24 -24
  25. package/dist/dom/indexof.d.ts +10 -10
  26. package/dist/dom/insertat.d.ts +11 -11
  27. package/dist/dom/iscomment.d.ts +7 -7
  28. package/dist/dom/isnode.d.ts +7 -7
  29. package/dist/dom/isrange.d.ts +7 -7
  30. package/dist/dom/istext.d.ts +7 -7
  31. package/dist/dom/isvalidattributename.d.ts +7 -7
  32. package/dist/dom/isvisible.d.ts +12 -12
  33. package/dist/dom/iswindow.d.ts +7 -7
  34. package/dist/dom/position.d.ts +200 -200
  35. package/dist/dom/rect.d.ts +194 -194
  36. package/dist/dom/remove.d.ts +9 -9
  37. package/dist/dom/resizeobserver.d.ts +70 -70
  38. package/dist/dom/scroll.d.ts +75 -72
  39. package/dist/dom/setdatainelement.d.ts +10 -10
  40. package/dist/dom/tounit.d.ts +16 -16
  41. package/dist/elementreplacer.d.ts +26 -26
  42. package/dist/emittermixin.d.ts +290 -280
  43. package/dist/env.d.ts +124 -124
  44. package/dist/eventinfo.d.ts +58 -55
  45. package/dist/fastdiff.d.ts +112 -109
  46. package/dist/first.d.ts +7 -7
  47. package/dist/focustracker.d.ts +133 -131
  48. package/dist/formathtml.d.ts +15 -15
  49. package/dist/index-content.css +1 -0
  50. package/dist/index-editor.css +1 -0
  51. package/dist/index.css +0 -2
  52. package/dist/index.d.ts +78 -77
  53. package/dist/index.js +5695 -6360
  54. package/dist/index.js.map +1 -1
  55. package/dist/inserttopriorityarray.d.ts +23 -23
  56. package/dist/isfeatureblockedbylicensekey.d.ts +10 -10
  57. package/dist/isiterable.d.ts +10 -10
  58. package/dist/keyboard.d.ts +107 -109
  59. package/dist/keystrokehandler.d.ts +90 -90
  60. package/dist/language.d.ts +12 -12
  61. package/dist/legacyerrors.d.ts +0 -4
  62. package/dist/locale.d.ts +122 -122
  63. package/dist/mapsequal.d.ts +11 -11
  64. package/dist/mix.d.ts +54 -53
  65. package/dist/nth.d.ts +12 -12
  66. package/dist/objecttomap.d.ts +18 -18
  67. package/dist/observablemixin.d.ts +621 -539
  68. package/dist/parsebase64encodedobject.d.ts +7 -7
  69. package/dist/parsedimensionwithunit.d.ts +40 -0
  70. package/dist/priorities.d.ts +24 -24
  71. package/dist/retry.d.ts +27 -27
  72. package/dist/splicearray.d.ts +22 -22
  73. package/dist/spy.d.ts +15 -15
  74. package/dist/toarray.d.ts +17 -17
  75. package/dist/tomap.d.ts +15 -15
  76. package/dist/translation-service.d.ts +157 -157
  77. package/dist/uid.d.ts +12 -12
  78. package/dist/unicode.d.ts +42 -42
  79. package/dist/version.d.ts +5 -5
  80. package/dist/wait.d.ts +11 -11
  81. package/package.json +2 -2
  82. package/dist/index.css.map +0 -1
@@ -1,30 +1,30 @@
1
1
  /**
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
- */
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
- * @module utils/inserttopriorityarray
7
- */
8
- import { type PriorityString } from './priorities.js';
6
+ * @module utils/inserttopriorityarray
7
+ */
8
+ import { type PriorityString } from "./priorities.js";
9
9
  /**
10
- * The priority object descriptor.
11
- *
12
- * ```ts
13
- * const objectWithPriority = {
14
- * priority: 'high'
15
- * }
16
- * ```
17
- */
10
+ * The priority object descriptor.
11
+ *
12
+ * ```ts
13
+ * const objectWithPriority = {
14
+ * priority: 'high'
15
+ * }
16
+ * ```
17
+ */
18
18
  export interface ObjectWithPriority {
19
- /**
20
- * Priority of the object.
21
- */
22
- priority: PriorityString;
19
+ /**
20
+ * Priority of the object.
21
+ */
22
+ priority: PriorityString;
23
23
  }
24
24
  /**
25
- * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.
26
- *
27
- * @param objects Array of objects with priority to insert object to.
28
- * @param objectToInsert Object with `priority` property.
29
- */
25
+ * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.
26
+ *
27
+ * @param objects Array of objects with priority to insert object to.
28
+ * @param objectToInsert Object with `priority` property.
29
+ */
30
30
  export declare function insertToPriorityArray<T extends ObjectWithPriority>(objects: Array<T>, objectToInsert: T): void;
@@ -1,14 +1,14 @@
1
1
  /**
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
- */
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
- * @module utils/isfeatureblockedbylicensekey
7
- */
6
+ * @module utils/isfeatureblockedbylicensekey
7
+ */
8
8
  /**
9
- * Checks whether a feature (represented by an unique id) is blocked by the provided license key.
10
- *
11
- * @param licensePayload Decoded license key.
12
- * @param licenseFeatureCode An unique feature id to check.
13
- */
9
+ * Checks whether a feature (represented by an unique id) is blocked by the provided license key.
10
+ *
11
+ * @param licensePayload Decoded license key.
12
+ * @param licenseFeatureCode An unique feature id to check.
13
+ */
14
14
  export declare function isFeatureBlockedByLicenseKey(licensePayload: Record<string, any>, licenseFeatureCode: string): boolean;
@@ -1,14 +1,14 @@
1
1
  /**
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
- */
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
- * @module utils/isiterable
7
- */
6
+ * @module utils/isiterable
7
+ */
8
8
  /**
9
- * Checks if value implements iterator interface.
10
- *
11
- * @param value The value to check.
12
- * @returns True if value implements iterator interface.
13
- */
9
+ * Checks if value implements iterator interface.
10
+ *
11
+ * @param value The value to check.
12
+ * @returns True if value implements iterator interface.
13
+ */
14
14
  export declare function isIterable(value: any): value is Iterable<any>;
@@ -1,127 +1,125 @@
1
1
  /**
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
- */
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
- * A set of utilities related to keyboard support.
7
- *
8
- * @module utils/keyboard
9
- */
10
- import type { LanguageDirection } from './language.js';
6
+ * A set of utilities related to keyboard support.
7
+ *
8
+ * @module utils/keyboard
9
+ */
10
+ import type { LanguageDirection } from "./language.js";
11
11
  /**
12
- * An object with `keyName => keyCode` pairs for a set of known keys.
13
- *
14
- * Contains:
15
- *
16
- * * `a-z`,
17
- * * `0-9`,
18
- * * `f1-f12`,
19
- * * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\`,
20
- * * `arrow(left|up|right|bottom)`,
21
- * * `backspace`, `delete`, `end`, `enter`, `esc`, `home`, `tab`,
22
- * * `ctrl`, `cmd`, `shift`, `alt`.
23
- */
24
- export declare const keyCodes: {
25
- readonly [keyCode: string]: number;
26
- };
12
+ * An object with `keyName => keyCode` pairs for a set of known keys.
13
+ *
14
+ * Contains:
15
+ *
16
+ * * `a-z`,
17
+ * * `0-9`,
18
+ * * `f1-f12`,
19
+ * * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\`,
20
+ * * `arrow(left|up|right|bottom)`,
21
+ * * `backspace`, `delete`, `end`, `enter`, `esc`, `home`, `tab`,
22
+ * * `ctrl`, `cmd`, `shift`, `alt`.
23
+ */
24
+ export declare const keyCodes: Record<string, number>;
27
25
  /**
28
- * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
29
- *
30
- * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
31
- *
32
- * @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.
33
- * @returns Key or keystroke code.
34
- */
26
+ * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
27
+ *
28
+ * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
29
+ *
30
+ * @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.
31
+ * @returns Key or keystroke code.
32
+ */
35
33
  export declare function getCode(key: string | Readonly<KeystrokeInfo>): number;
36
34
  /**
37
- * Parses the keystroke and returns a keystroke code that will match the code returned by
38
- * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
39
- *
40
- * The keystroke can be passed in two formats:
41
- *
42
- * * as a single string – e.g. `ctrl + A`,
43
- * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
44
- * * `[ 'ctrl', 32 ]` (ctrl + space),
45
- * * `[ 'ctrl', 'a' ]` (ctrl + A).
46
- *
47
- * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
48
- *
49
- * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
50
- *
51
- * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
52
- * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
53
- * use the forced modifier: `Ctrl!+A` (note the exclamation mark).
54
- *
55
- * @param keystroke The keystroke definition.
56
- * @returns Keystroke code.
57
- */
35
+ * Parses the keystroke and returns a keystroke code that will match the code returned by
36
+ * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
37
+ *
38
+ * The keystroke can be passed in two formats:
39
+ *
40
+ * * as a single string – e.g. `ctrl + A`,
41
+ * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
42
+ * * `[ 'ctrl', 32 ]` (ctrl + space),
43
+ * * `[ 'ctrl', 'a' ]` (ctrl + A).
44
+ *
45
+ * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
46
+ *
47
+ * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
48
+ *
49
+ * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
50
+ * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
51
+ * use the forced modifier: `Ctrl!+A` (note the exclamation mark).
52
+ *
53
+ * @param keystroke The keystroke definition.
54
+ * @returns Keystroke code.
55
+ */
58
56
  export declare function parseKeystroke(keystroke: string | ReadonlyArray<number | string>): number;
59
57
  /**
60
- * Translates any keystroke string text like `"Ctrl+A"` to an
61
- * environment–specific keystroke, i.e. `"⌘A"` on macOS.
62
- *
63
- * @param keystroke The keystroke text.
64
- * @param [forcedEnv] The environment to force the key translation to. If not provided, the current environment is used.
65
- * @returns The keystroke text specific for the environment.
66
- */
67
- export declare function getEnvKeystrokeText(keystroke: string, forcedEnv?: 'PC' | 'Mac'): string;
58
+ * Translates any keystroke string text like `"Ctrl+A"` to an
59
+ * environment–specific keystroke, i.e. `"⌘A"` on macOS.
60
+ *
61
+ * @param keystroke The keystroke text.
62
+ * @param [forcedEnv] The environment to force the key translation to. If not provided, the current environment is used.
63
+ * @returns The keystroke text specific for the environment.
64
+ */
65
+ export declare function getEnvKeystrokeText(keystroke: string, forcedEnv?: "PC" | "Mac"): string;
68
66
  /**
69
- * Returns `true` if the provided key code represents one of the arrow keys.
70
- *
71
- * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
72
- */
67
+ * Returns `true` if the provided key code represents one of the arrow keys.
68
+ *
69
+ * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
70
+ */
73
71
  export declare function isArrowKeyCode(keyCode: number): boolean;
74
72
  /**
75
- * String representing a direction of an arrow key kode.
76
- */
77
- export type ArrowKeyCodeDirection = 'left' | 'up' | 'right' | 'down';
73
+ * String representing a direction of an arrow key kode.
74
+ */
75
+ export type ArrowKeyCodeDirection = "left" | "up" | "right" | "down";
78
76
  /**
79
- * Returns the direction in which the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
80
- * will move when the provided arrow key code is pressed considering the language direction of the editor content.
81
- *
82
- * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
83
- * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
84
- *
85
- * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
86
- * @param contentLanguageDirection The content language direction, corresponding to
87
- * {@link module:utils/locale~Locale#contentLanguageDirection}.
88
- * @returns Localized arrow direction or `undefined` for non-arrow key codes.
89
- */
77
+ * Returns the direction in which the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
78
+ * will move when the provided arrow key code is pressed considering the language direction of the editor content.
79
+ *
80
+ * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
81
+ * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
82
+ *
83
+ * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
84
+ * @param contentLanguageDirection The content language direction, corresponding to
85
+ * {@link module:utils/locale~Locale#contentLanguageDirection}.
86
+ * @returns Localized arrow direction or `undefined` for non-arrow key codes.
87
+ */
90
88
  export declare function getLocalizedArrowKeyCodeDirection(keyCode: number, contentLanguageDirection: LanguageDirection): ArrowKeyCodeDirection | undefined;
91
89
  /**
92
- * Determines if the provided key code moves the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
93
- * forward or backward considering the language direction of the editor content.
94
- *
95
- * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
96
- * in the model structure. Similarly, pressing the right arrow moves the selection backward.
97
- *
98
- * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
99
- * @param contentLanguageDirection The content language direction, corresponding to
100
- * {@link module:utils/locale~Locale#contentLanguageDirection}.
101
- */
90
+ * Determines if the provided key code moves the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
91
+ * forward or backward considering the language direction of the editor content.
92
+ *
93
+ * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
94
+ * in the model structure. Similarly, pressing the right arrow moves the selection backward.
95
+ *
96
+ * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
97
+ * @param contentLanguageDirection The content language direction, corresponding to
98
+ * {@link module:utils/locale~Locale#contentLanguageDirection}.
99
+ */
102
100
  export declare function isForwardArrowKeyCode(keyCode: number, contentLanguageDirection: LanguageDirection): boolean;
103
101
  /**
104
- * Information about the keystroke.
105
- */
102
+ * Information about the keystroke.
103
+ */
106
104
  export interface KeystrokeInfo {
107
- /**
108
- * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
109
- */
110
- keyCode: number;
111
- /**
112
- * Whether the <kbd>Alt</kbd> modifier was pressed.
113
- */
114
- altKey: boolean;
115
- /**
116
- * Whether the <kbd>Cmd</kbd> modifier was pressed.
117
- */
118
- metaKey: boolean;
119
- /**
120
- * Whether the <kbd>Ctrl</kbd> modifier was pressed.
121
- */
122
- ctrlKey: boolean;
123
- /**
124
- * Whether the <kbd>Shift</kbd> modifier was pressed.
125
- */
126
- shiftKey: boolean;
105
+ /**
106
+ * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
107
+ */
108
+ keyCode: number;
109
+ /**
110
+ * Whether the <kbd>Alt</kbd> modifier was pressed.
111
+ */
112
+ altKey: boolean;
113
+ /**
114
+ * Whether the <kbd>Cmd</kbd> modifier was pressed.
115
+ */
116
+ metaKey: boolean;
117
+ /**
118
+ * Whether the <kbd>Ctrl</kbd> modifier was pressed.
119
+ */
120
+ ctrlKey: boolean;
121
+ /**
122
+ * Whether the <kbd>Shift</kbd> modifier was pressed.
123
+ */
124
+ shiftKey: boolean;
127
125
  }
@@ -1,97 +1,97 @@
1
1
  /**
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 type { Emitter } from './emittermixin.js';
6
- import { type KeystrokeInfo } from './keyboard.js';
7
- import type { PriorityString } from './priorities.js';
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 type { Emitter } from "./emittermixin.js";
6
+ import { type KeystrokeInfo } from "./keyboard.js";
7
+ import type { PriorityString } from "./priorities.js";
8
8
  /**
9
- * Keystroke handler allows registering callbacks for given keystrokes.
10
- *
11
- * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
12
- * property. It allows listening to keystrokes executed in the editing view:
13
- *
14
- * ```ts
15
- * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
16
- * console.log( 'Ctrl+A has been pressed' );
17
- * cancel();
18
- * } );
19
- * ```
20
- *
21
- * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
22
- * can use it like this:
23
- *
24
- * ```ts
25
- * class MyView extends View {
26
- * constructor() {
27
- * this.keystrokes = new KeystrokeHandler();
28
- *
29
- * this.keystrokes.set( 'tab', handleTabKey );
30
- * }
31
- *
32
- * render() {
33
- * super.render();
34
- *
35
- * this.keystrokes.listenTo( this.element );
36
- * }
37
- * }
38
- * ```
39
- *
40
- * That keystroke handler will listen to `keydown` events fired in this view's main element.
41
- *
42
- */
9
+ * Keystroke handler allows registering callbacks for given keystrokes.
10
+ *
11
+ * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
12
+ * property. It allows listening to keystrokes executed in the editing view:
13
+ *
14
+ * ```ts
15
+ * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
16
+ * console.log( 'Ctrl+A has been pressed' );
17
+ * cancel();
18
+ * } );
19
+ * ```
20
+ *
21
+ * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
22
+ * can use it like this:
23
+ *
24
+ * ```ts
25
+ * class MyView extends View {
26
+ * constructor() {
27
+ * this.keystrokes = new KeystrokeHandler();
28
+ *
29
+ * this.keystrokes.set( 'tab', handleTabKey );
30
+ * }
31
+ *
32
+ * render() {
33
+ * super.render();
34
+ *
35
+ * this.keystrokes.listenTo( this.element );
36
+ * }
37
+ * }
38
+ * ```
39
+ *
40
+ * That keystroke handler will listen to `keydown` events fired in this view's main element.
41
+ *
42
+ */
43
43
  export declare class KeystrokeHandler {
44
- /**
45
- * Listener used to listen to events for easier keystroke handler destruction.
46
- */
47
- private readonly _listener;
48
- /**
49
- * Creates an instance of the keystroke handler.
50
- */
51
- constructor();
52
- /**
53
- * Starts listening for `keydown` events from a given emitter.
54
- */
55
- listenTo(emitter: Emitter | HTMLElement | Window): void;
56
- /**
57
- * Registers a handler for the specified keystroke.
58
- *
59
- * @param keystroke Keystroke defined in a format accepted by
60
- * the {@link module:utils/keyboard~parseKeystroke} function.
61
- * @param callback A function called with the
62
- * {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
63
- * a helper function to call both `preventDefault()` and `stopPropagation()` on the underlying event.
64
- * @param options Additional options.
65
- */
66
- set(keystroke: string | ReadonlyArray<string | number>, callback: (ev: KeyboardEvent, cancel: () => void) => void, options?: KeystrokeHandlerOptions): void;
67
- /**
68
- * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
69
- *
70
- * @param keyEvtData Key event data.
71
- * @returns Whether the keystroke was handled.
72
- */
73
- press(keyEvtData: Readonly<KeystrokeInfo>): boolean;
74
- /**
75
- * Stops listening to `keydown` events from the given emitter.
76
- */
77
- stopListening(emitter?: Emitter | HTMLElement | Window): void;
78
- /**
79
- * Destroys the keystroke handler.
80
- */
81
- destroy(): void;
44
+ /**
45
+ * Listener used to listen to events for easier keystroke handler destruction.
46
+ */
47
+ private readonly _listener;
48
+ /**
49
+ * Creates an instance of the keystroke handler.
50
+ */
51
+ constructor();
52
+ /**
53
+ * Starts listening for `keydown` events from a given emitter.
54
+ */
55
+ listenTo(emitter: Emitter | HTMLElement | Window): void;
56
+ /**
57
+ * Registers a handler for the specified keystroke.
58
+ *
59
+ * @param keystroke Keystroke defined in a format accepted by
60
+ * the {@link module:utils/keyboard~parseKeystroke} function.
61
+ * @param callback A function called with the
62
+ * {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
63
+ * a helper function to call both `preventDefault()` and `stopPropagation()` on the underlying event.
64
+ * @param options Additional options.
65
+ */
66
+ set(keystroke: string | ReadonlyArray<string | number>, callback: (ev: KeyboardEvent, cancel: () => void) => void, options?: KeystrokeHandlerOptions): void;
67
+ /**
68
+ * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
69
+ *
70
+ * @param keyEvtData Key event data.
71
+ * @returns Whether the keystroke was handled.
72
+ */
73
+ press(keyEvtData: Readonly<KeystrokeInfo>): boolean;
74
+ /**
75
+ * Stops listening to `keydown` events from the given emitter.
76
+ */
77
+ stopListening(emitter?: Emitter | HTMLElement | Window): void;
78
+ /**
79
+ * Destroys the keystroke handler.
80
+ */
81
+ destroy(): void;
82
82
  }
83
83
  /**
84
- * {@link module:utils/keystrokehandler~KeystrokeHandler#set} method options.
85
- */
84
+ * {@link module:utils/keystrokehandler~KeystrokeHandler#set} method options.
85
+ */
86
86
  export interface KeystrokeHandlerOptions {
87
- /**
88
- * The priority of the keystroke callback. The higher the priority value the sooner the callback will be executed.
89
- * Keystrokes having the same priority are called in the order they were added.
90
- */
91
- readonly priority?: PriorityString;
92
- /**
93
- * An optional callback function allowing for filtering keystrokes based on arbitrary criteria.
94
- * The callback function receives `keydown` DOM event as a parameter.
95
- */
96
- readonly filter?: (keyEvtData: KeyboardEvent) => boolean;
87
+ /**
88
+ * The priority of the keystroke callback. The higher the priority value the sooner the callback will be executed.
89
+ * Keystrokes having the same priority are called in the order they were added.
90
+ */
91
+ readonly priority?: PriorityString;
92
+ /**
93
+ * An optional callback function allowing for filtering keystrokes based on arbitrary criteria.
94
+ * The callback function receives `keydown` DOM event as a parameter.
95
+ */
96
+ readonly filter?: (keyEvtData: KeyboardEvent) => boolean;
97
97
  }
@@ -1,17 +1,17 @@
1
1
  /**
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
- */
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
- * @module utils/language
7
- */
6
+ * @module utils/language
7
+ */
8
8
  /**
9
- * String representing a language direction.
10
- */
11
- export type LanguageDirection = 'ltr' | 'rtl';
9
+ * String representing a language direction.
10
+ */
11
+ export type LanguageDirection = "ltr" | "rtl";
12
12
  /**
13
- * Helps determine whether a language text direction is LTR or RTL.
14
- *
15
- * @param languageCode The ISO 639-1 or ISO 639-2 language code.
16
- */
13
+ * Helps determine whether a language text direction is LTR or RTL.
14
+ *
15
+ * @param languageCode The ISO 639-1 or ISO 639-2 language code.
16
+ */
17
17
  export declare function getLanguageDirection(languageCode: string): LanguageDirection;
@@ -1,5 +1 @@
1
- /**
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
1
  export {};