@ckeditor/ckeditor5-utils 48.2.0 → 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,17 +1,23 @@
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/abortabledebounce
7
- */
6
+ * @module utils/abortabledebounce
7
+ */
8
8
  /**
9
- * Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.
10
- *
11
- * @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.
12
- */
13
- export declare function abortableDebounce<Args extends Array<any>, Ret>(func: (signal: AbortSignal, ...args: Args) => Ret): AbortableFunc<Args, Ret>;
14
- export interface AbortableFunc<Args extends Array<any>, Ret> {
15
- (...args: Args): Ret;
16
- abort(): void;
9
+ * Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.
10
+ *
11
+ * @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.
12
+ */
13
+ export declare function abortableDebounce<
14
+ Args extends Array<any>,
15
+ Ret
16
+ >(func: (signal: AbortSignal, ...args: Args) => Ret): AbortableFunc<Args, Ret>;
17
+ export interface AbortableFunc<
18
+ Args extends Array<any>,
19
+ Ret
20
+ > {
21
+ (...args: Args): Ret;
22
+ abort(): void;
17
23
  }
@@ -1,11 +1,11 @@
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/areconnectedthroughproperties
7
- */
6
+ * @module utils/areconnectedthroughproperties
7
+ */
8
8
  /**
9
- * Traverses both structures to find out whether there is a reference that is shared between both structures.
10
- */
9
+ * Traverses both structures to find out whether there is a reference that is shared between both structures.
10
+ */
11
11
  export declare function areConnectedThroughProperties(obj1: object, obj2: object): boolean;
@@ -1,124 +1,124 @@
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/ckeditorerror
7
- */
6
+ * @module utils/ckeditorerror
7
+ */
8
8
  /**
9
- * URL to the documentation with error codes.
10
- */
9
+ * URL to the documentation with error codes.
10
+ */
11
11
  export declare const DOCUMENTATION_URL = "https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";
12
12
  /**
13
- * The CKEditor error class.
14
- *
15
- * You should throw `CKEditorError` when:
16
- *
17
- * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
18
- * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
19
- * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
20
- * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
21
- * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
22
- * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
23
- * {@link module:utils/ckeditorerror~logError `logError()`}
24
- * to improve developers experience and let them see the a working editor as soon as possible.
25
- *
26
- * ```ts
27
- * /**
28
- * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
29
- * *
30
- * * @error plugin-load
31
- * * @param pluginName The name of the plugin that could not be loaded.
32
- * * @param moduleName The name of the module which tried to load this plugin.
33
- * *\/
34
- * throw new CKEditorError( 'plugin-load', {
35
- * pluginName: 'foo',
36
- * moduleName: 'bar'
37
- * } );
38
- * ```
39
- */
13
+ * The CKEditor error class.
14
+ *
15
+ * You should throw `CKEditorError` when:
16
+ *
17
+ * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
18
+ * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
19
+ * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
20
+ * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
21
+ * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
22
+ * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
23
+ * {@link module:utils/ckeditorerror~logError `logError()`}
24
+ * to improve developers experience and let them see the a working editor as soon as possible.
25
+ *
26
+ * ```ts
27
+ * /**
28
+ * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
29
+ * *
30
+ * * @error plugin-load
31
+ * * @param pluginName The name of the plugin that could not be loaded.
32
+ * * @param moduleName The name of the module which tried to load this plugin.
33
+ * *\/
34
+ * throw new CKEditorError( 'plugin-load', {
35
+ * pluginName: 'foo',
36
+ * moduleName: 'bar'
37
+ * } );
38
+ * ```
39
+ */
40
40
  export declare class CKEditorError extends Error {
41
- /**
42
- * A context of the error by which the Watchdog is able to determine which editor crashed.
43
- */
44
- readonly context: object | null | undefined;
45
- /**
46
- * The additional error data passed to the constructor. Undefined if none was passed.
47
- */
48
- readonly data?: object;
49
- /**
50
- * Creates an instance of the CKEditorError class.
51
- *
52
- * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added
53
- * to the thrown error's `message`.
54
- * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
55
- * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
56
- * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
57
- * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
58
- * to check if the object works as the context.
59
- * @param data Additional data describing the error. A stringified version of this object
60
- * will be appended to the error message, so the data are quickly visible in the console. The original
61
- * data object will also be later available under the {@link #data} property.
62
- * @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.
63
- */
64
- constructor(errorName: string, context?: object | null, data?: object, originalError?: Error);
65
- /**
66
- * Checks if the error is of the `CKEditorError` type.
67
- */
68
- is(type: string): boolean;
69
- /**
70
- * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
71
- * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
72
- * of a {@link module:utils/ckeditorerror~CKEditorError} error.
73
- *
74
- * @param error The error to rethrow.
75
- * @param context An object connected through properties with the editor instance. This context will be used
76
- * by the watchdog to verify which editor should be restarted.
77
- */
78
- static rethrowUnexpectedError(error: Error, context: object): never;
41
+ /**
42
+ * A context of the error by which the Watchdog is able to determine which editor crashed.
43
+ */
44
+ readonly context: object | null | undefined;
45
+ /**
46
+ * The additional error data passed to the constructor. Undefined if none was passed.
47
+ */
48
+ readonly data?: object;
49
+ /**
50
+ * Creates an instance of the CKEditorError class.
51
+ *
52
+ * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added
53
+ * to the thrown error's `message`.
54
+ * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
55
+ * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
56
+ * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
57
+ * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
58
+ * to check if the object works as the context.
59
+ * @param data Additional data describing the error. A stringified version of this object
60
+ * will be appended to the error message, so the data are quickly visible in the console. The original
61
+ * data object will also be later available under the {@link #data} property.
62
+ * @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.
63
+ */
64
+ constructor(errorName: string, context?: object | null, data?: object, originalError?: Error);
65
+ /**
66
+ * Checks if the error is of the `CKEditorError` type.
67
+ */
68
+ is(type: string): boolean;
69
+ /**
70
+ * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
71
+ * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
72
+ * of a {@link module:utils/ckeditorerror~CKEditorError} error.
73
+ *
74
+ * @param error The error to rethrow.
75
+ * @param context An object connected through properties with the editor instance. This context will be used
76
+ * by the watchdog to verify which editor should be restarted.
77
+ */
78
+ static rethrowUnexpectedError(error: Error, context: object): never;
79
79
  }
80
80
  /**
81
- * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
82
- * Use whenever you want to log a warning to the console.
83
- *
84
- * ```ts
85
- * /**
86
- * * There was a problem processing the configuration of the toolbar. The item with the given
87
- * * name does not exist, so it was omitted when rendering the toolbar.
88
- * *
89
- * * @error toolbarview-item-unavailable
90
- * * @param {String} name The name of the component.
91
- * *\/
92
- * logWarning( 'toolbarview-item-unavailable', { name } );
93
- * ```
94
- *
95
- * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
96
- * a warning or an error to the console.
97
- *
98
- * @param errorName The error name to be logged.
99
- * @param data Additional data to be logged.
100
- */
81
+ * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
82
+ * Use whenever you want to log a warning to the console.
83
+ *
84
+ * ```ts
85
+ * /**
86
+ * * There was a problem processing the configuration of the toolbar. The item with the given
87
+ * * name does not exist, so it was omitted when rendering the toolbar.
88
+ * *
89
+ * * @error toolbarview-item-unavailable
90
+ * * @param {String} name The name of the component.
91
+ * *\/
92
+ * logWarning( 'toolbarview-item-unavailable', { name } );
93
+ * ```
94
+ *
95
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
96
+ * a warning or an error to the console.
97
+ *
98
+ * @param errorName The error name to be logged.
99
+ * @param data Additional data to be logged.
100
+ */
101
101
  export declare function logWarning(errorName: string, data?: object): void;
102
102
  /**
103
- * Logs an error to the console with a properly formatted message and adds a link to the documentation.
104
- * Use whenever you want to log an error to the console.
105
- *
106
- * ```ts
107
- * /**
108
- * * There was a problem processing the configuration of the toolbar. The item with the given
109
- * * name does not exist, so it was omitted when rendering the toolbar.
110
- * *
111
- * * @error toolbarview-item-unavailable
112
- * * @param {String} name The name of the component.
113
- * *\/
114
- * logError( 'toolbarview-item-unavailable', { name } );
115
- * ```
116
- *
117
- * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
118
- *
119
- * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
120
- *
121
- * @param errorName The error name to be logged.
122
- * @param data Additional data to be logged.
123
- */
103
+ * Logs an error to the console with a properly formatted message and adds a link to the documentation.
104
+ * Use whenever you want to log an error to the console.
105
+ *
106
+ * ```ts
107
+ * /**
108
+ * * There was a problem processing the configuration of the toolbar. The item with the given
109
+ * * name does not exist, so it was omitted when rendering the toolbar.
110
+ * *
111
+ * * @error toolbarview-item-unavailable
112
+ * * @param {String} name The name of the component.
113
+ * *\/
114
+ * logError( 'toolbarview-item-unavailable', { name } );
115
+ * ```
116
+ *
117
+ * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
118
+ *
119
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
120
+ *
121
+ * @param errorName The error name to be logged.
122
+ * @param data Additional data to be logged.
123
+ */
124
124
  export declare function logError(errorName: string, data?: object): void;