@ckeditor/ckeditor5-watchdog 48.2.0 → 48.3.0-alpha.1
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/actionsrecorder.d.ts +246 -246
- package/dist/actionsrecorderconfig.d.ts +187 -187
- package/dist/augmentation.d.ts +18 -18
- package/dist/contextwatchdog.d.ts +315 -315
- package/dist/editorwatchdog.d.ts +214 -214
- 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 +12 -12
- package/dist/index.js +1633 -1849
- package/dist/index.js.map +1 -1
- package/dist/utils/areconnectedthroughproperties.d.ts +7 -7
- package/dist/utils/getsubnodes.d.ts +7 -7
- package/dist/utils/normalizerootsconfig.d.ts +15 -15
- package/dist/watchdog.d.ts +205 -205
- package/package.json +4 -4
- package/dist/index.css.map +0 -1
|
@@ -1,338 +1,338 @@
|
|
|
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 { Watchdog, type WatchdogConfig, type WatchdogState } from
|
|
9
|
-
import { EditorWatchdog, type EditorWatchdogCreatorFunction } from
|
|
10
|
-
import type { ArrayOrItem, CKEditorError } from
|
|
11
|
-
import type { Context, Editor, EditorConfig, ContextConfig } from
|
|
6
|
+
* @module watchdog/contextwatchdog
|
|
7
|
+
*/
|
|
8
|
+
import { Watchdog, type WatchdogConfig, type WatchdogState } from "./watchdog.js";
|
|
9
|
+
import { EditorWatchdog, type EditorWatchdogCreatorFunction } from "./editorwatchdog.js";
|
|
10
|
+
import type { ArrayOrItem, CKEditorError } from "@ckeditor/ckeditor5-utils";
|
|
11
|
+
import type { Context, Editor, EditorConfig, ContextConfig } from "@ckeditor/ckeditor5-core";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
* A watchdog for the {@link module:core/context~Context} class.
|
|
14
|
+
*
|
|
15
|
+
* See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and
|
|
16
|
+
* how to use it.
|
|
17
|
+
*/
|
|
18
18
|
export declare class ContextWatchdog<TContext extends Context = Context> extends Watchdog {
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
19
|
+
/**
|
|
20
|
+
* A map of internal watchdogs for added items.
|
|
21
|
+
*/
|
|
22
|
+
protected _watchdogs: Map<string, EditorWatchdog>;
|
|
23
|
+
/**
|
|
24
|
+
* The watchdog configuration.
|
|
25
|
+
*/
|
|
26
|
+
private readonly _watchdogConfig;
|
|
27
|
+
/**
|
|
28
|
+
* The current context instance.
|
|
29
|
+
*/
|
|
30
|
+
private _context;
|
|
31
|
+
/**
|
|
32
|
+
* Context properties (nodes/references) that are gathered during the initial context creation
|
|
33
|
+
* and are used to distinguish the origin of an error.
|
|
34
|
+
*/
|
|
35
|
+
private _contextProps;
|
|
36
|
+
/**
|
|
37
|
+
* An action queue, which is used to handle async functions queuing.
|
|
38
|
+
*/
|
|
39
|
+
private _actionQueues;
|
|
40
|
+
/**
|
|
41
|
+
* The configuration for the {@link module:core/context~Context}.
|
|
42
|
+
*/
|
|
43
|
+
private _contextConfig?;
|
|
44
|
+
/**
|
|
45
|
+
* The creation method.
|
|
46
|
+
*
|
|
47
|
+
* @see #setCreator
|
|
48
|
+
*/
|
|
49
|
+
protected _creator: (config: ContextConfig) => Promise<TContext>;
|
|
50
|
+
/**
|
|
51
|
+
* The destruction method.
|
|
52
|
+
*
|
|
53
|
+
* @see #setDestructor
|
|
54
|
+
*/
|
|
55
|
+
protected _destructor: (context: Context) => Promise<unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* The watched item.
|
|
58
|
+
*/
|
|
59
|
+
_item: unknown;
|
|
60
|
+
/**
|
|
61
|
+
* The context watchdog class constructor.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* const watchdog = new ContextWatchdog( Context );
|
|
65
|
+
*
|
|
66
|
+
* await watchdog.create( contextConfiguration );
|
|
67
|
+
*
|
|
68
|
+
* await watchdog.add( item );
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* See the {@glink features/watchdog Watchdog feature guide} to learn more how to use this feature.
|
|
72
|
+
*
|
|
73
|
+
* @param Context The {@link module:core/context~Context} class.
|
|
74
|
+
* @param watchdogConfig The watchdog configuration.
|
|
75
|
+
*/
|
|
76
|
+
constructor(Context: {
|
|
77
|
+
create(...args: any): Promise<TContext>;
|
|
78
|
+
}, watchdogConfig?: WatchdogConfig);
|
|
79
|
+
/**
|
|
80
|
+
* Sets the function that is responsible for the context creation.
|
|
81
|
+
* It expects a function that should return a promise (or `undefined`).
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* watchdog.setCreator( config => Context.create( config ) );
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
setCreator(creator: (config: ContextConfig) => Promise<TContext>): void;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the function that is responsible for the context destruction.
|
|
90
|
+
* Overrides the default destruction function, which destroys only the context instance.
|
|
91
|
+
* It expects a function that should return a promise (or `undefined`).
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* watchdog.setDestructor( context => {
|
|
95
|
+
* // Do something before the context is destroyed.
|
|
96
|
+
*
|
|
97
|
+
* return context
|
|
98
|
+
* .destroy()
|
|
99
|
+
* .then( () => {
|
|
100
|
+
* // Do something after the context is destroyed.
|
|
101
|
+
* } );
|
|
102
|
+
* } );
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
setDestructor(destructor: (context: Context) => Promise<unknown>): void;
|
|
106
|
+
/**
|
|
107
|
+
* The context instance. Keep in mind that this property might be changed when the context watchdog restarts,
|
|
108
|
+
* so do not keep this instance internally. Always operate on the `ContextWatchdog#context` property.
|
|
109
|
+
*/
|
|
110
|
+
get context(): Context | null;
|
|
111
|
+
/**
|
|
112
|
+
* Initializes the context watchdog. Once it is created, the watchdog takes care about
|
|
113
|
+
* recreating the context and the provided items, and starts the error handling mechanism.
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* await watchdog.create( {
|
|
117
|
+
* plugins: []
|
|
118
|
+
* } );
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* @param contextConfig The context configuration. See {@link module:core/context~Context}.
|
|
122
|
+
*/
|
|
123
|
+
create(contextConfig?: ContextConfig): Promise<unknown>;
|
|
124
|
+
/**
|
|
125
|
+
* Returns an item instance with the given `itemId`.
|
|
126
|
+
*
|
|
127
|
+
* ```ts
|
|
128
|
+
* const editor1 = watchdog.getItem( 'editor1' );
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @param itemId The item ID.
|
|
132
|
+
* @returns The item instance or `undefined` if an item with a given ID has not been found.
|
|
133
|
+
*/
|
|
134
|
+
getItem(itemId: string): unknown;
|
|
135
|
+
/**
|
|
136
|
+
* Gets the state of the given item. See {@link #state} for a list of available states.
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* const editor1State = watchdog.getItemState( 'editor1' );
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @param itemId Item ID.
|
|
143
|
+
* @returns The state of the item.
|
|
144
|
+
*/
|
|
145
|
+
getItemState(itemId: string): WatchdogState;
|
|
146
|
+
/**
|
|
147
|
+
* Adds items to the watchdog. Once created, instances of these items will be available using the {@link #getItem} method.
|
|
148
|
+
*
|
|
149
|
+
* Items can be passed together as an array of objects:
|
|
150
|
+
*
|
|
151
|
+
* ```ts
|
|
152
|
+
* await watchdog.add( [ {
|
|
153
|
+
* id: 'editor1',
|
|
154
|
+
* type: 'editor',
|
|
155
|
+
* config: {
|
|
156
|
+
* attachTo: document.querySelector( '#editor' ),
|
|
157
|
+
* plugins: [ Essentials, Paragraph, Bold, Italic ],
|
|
158
|
+
* toolbar: [ 'bold', 'italic', 'alignment' ]
|
|
159
|
+
* },
|
|
160
|
+
* creator: config => ClassicEditor.create( config )
|
|
161
|
+
* } ] );
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* Or one by one as objects:
|
|
165
|
+
*
|
|
166
|
+
* ```ts
|
|
167
|
+
* await watchdog.add( {
|
|
168
|
+
* id: 'editor1',
|
|
169
|
+
* type: 'editor',
|
|
170
|
+
* config: {
|
|
171
|
+
* attachTo: document.querySelector( '#editor' ),
|
|
172
|
+
* plugins: [ Essentials, Paragraph, Bold, Italic ],
|
|
173
|
+
* toolbar: [ 'bold', 'italic', 'alignment' ]
|
|
174
|
+
* },
|
|
175
|
+
* creator: config => ClassicEditor.create( config )
|
|
176
|
+
* } );
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* Then an instance can be retrieved using the {@link #getItem} method:
|
|
180
|
+
*
|
|
181
|
+
* ```ts
|
|
182
|
+
* const editor1 = watchdog.getItem( 'editor1' );
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* Note that this method can be called multiple times, but for performance reasons it is better
|
|
186
|
+
* to pass all items together.
|
|
187
|
+
*
|
|
188
|
+
* @param itemConfigurationOrItemConfigurations An item configuration object or an array of item configurations.
|
|
189
|
+
*/
|
|
190
|
+
add(itemConfigurationOrItemConfigurations: ArrayOrItem<ContextWatchdogItemConfiguration>): Promise<unknown>;
|
|
191
|
+
/**
|
|
192
|
+
* Removes and destroys item(s) with given ID(s).
|
|
193
|
+
*
|
|
194
|
+
* ```ts
|
|
195
|
+
* await watchdog.remove( 'editor1' );
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* Or
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* await watchdog.remove( [ 'editor1', 'editor2' ] );
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @param itemIdOrItemIds Item ID or an array of item IDs.
|
|
205
|
+
*/
|
|
206
|
+
remove(itemIdOrItemIds: ArrayOrItem<string>): Promise<unknown>;
|
|
207
|
+
/**
|
|
208
|
+
* Destroys the context watchdog and all added items.
|
|
209
|
+
* Once the context watchdog is destroyed, new items cannot be added.
|
|
210
|
+
*
|
|
211
|
+
* ```ts
|
|
212
|
+
* await watchdog.destroy();
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
override destroy(): Promise<unknown>;
|
|
216
|
+
/**
|
|
217
|
+
* Restarts the context watchdog.
|
|
218
|
+
*/
|
|
219
|
+
protected _restart(): Promise<unknown>;
|
|
220
|
+
/**
|
|
221
|
+
* Initializes the context watchdog.
|
|
222
|
+
*/
|
|
223
|
+
private _create;
|
|
224
|
+
/**
|
|
225
|
+
* Destroys the context instance and all added items.
|
|
226
|
+
*/
|
|
227
|
+
private _destroy;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the watchdog for a given item ID.
|
|
230
|
+
*
|
|
231
|
+
* @param itemId Item ID.
|
|
232
|
+
*/
|
|
233
|
+
protected _getWatchdog(itemId: string): Watchdog;
|
|
234
|
+
/**
|
|
235
|
+
* Checks whether an error comes from the context instance and not from the item instances.
|
|
236
|
+
*
|
|
237
|
+
* @internal
|
|
238
|
+
*/
|
|
239
|
+
_isErrorComingFromThisItem(error: CKEditorError): boolean;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
242
|
+
* Fired after the watchdog restarts the context and the added items because of a crash.
|
|
243
|
+
*
|
|
244
|
+
* ```ts
|
|
245
|
+
* watchdog.on( 'restart', () => {
|
|
246
|
+
* console.log( 'The context has been restarted.' );
|
|
247
|
+
* } );
|
|
248
|
+
* ```
|
|
249
|
+
*
|
|
250
|
+
* @eventName ~ContextWatchdog#restart
|
|
251
|
+
*/
|
|
252
252
|
export type ContextWatchdogRestartEvent = {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
name: "restart";
|
|
254
|
+
args: [];
|
|
255
|
+
return: undefined;
|
|
256
256
|
};
|
|
257
257
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
258
|
+
* Fired when a new error occurred in one of the added items.
|
|
259
|
+
*
|
|
260
|
+
* ```ts
|
|
261
|
+
* watchdog.on( 'itemError', ( evt, { error, itemId } ) => {
|
|
262
|
+
* console.log( `An error occurred in an item with the '${ itemId }' ID.` );
|
|
263
|
+
* } );
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* @eventName ~ContextWatchdog#itemError
|
|
267
|
+
*/
|
|
268
268
|
export type ContextWatchdogItemErrorEvent = {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
name: "itemError";
|
|
270
|
+
args: [ContextWatchdogItemErrorEventData];
|
|
271
|
+
return: undefined;
|
|
272
272
|
};
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
* The `itemError` event data.
|
|
275
|
+
*/
|
|
276
276
|
export type ContextWatchdogItemErrorEventData = {
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
itemId: string;
|
|
278
|
+
error: Error;
|
|
279
279
|
};
|
|
280
280
|
/**
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
281
|
+
* Fired after an item has been restarted.
|
|
282
|
+
*
|
|
283
|
+
* ```ts
|
|
284
|
+
* watchdog.on( 'itemRestart', ( evt, { itemId } ) => {
|
|
285
|
+
* console.log( 'An item with with the '${ itemId }' ID has been restarted.' );
|
|
286
|
+
* } );
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* @eventName ~ContextWatchdog#itemRestart
|
|
290
|
+
*/
|
|
291
291
|
export type ContextWatchdogItemRestartEvent = {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
name: "itemRestart";
|
|
293
|
+
args: [ContextWatchdogItemRestartEventData];
|
|
294
|
+
return: undefined;
|
|
295
295
|
};
|
|
296
296
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
* The `itemRestart` event data.
|
|
298
|
+
*/
|
|
299
299
|
export type ContextWatchdogItemRestartEventData = {
|
|
300
|
-
|
|
300
|
+
itemId: string;
|
|
301
301
|
};
|
|
302
302
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
* The watchdog item configuration interface.
|
|
304
|
+
*/
|
|
305
305
|
export interface ContextWatchdogItemConfiguration {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
306
|
+
/**
|
|
307
|
+
* id A unique item identificator.
|
|
308
|
+
*/
|
|
309
|
+
id: string;
|
|
310
|
+
/**
|
|
311
|
+
* The type of the item to create. At the moment, only `'editor'` is supported.
|
|
312
|
+
*/
|
|
313
|
+
type: "editor";
|
|
314
|
+
/**
|
|
315
|
+
* A function that initializes the item (the editor). The function takes the editor configuration
|
|
316
|
+
* and should return a promise. For example: `config => ClassicEditor.create( config )`.
|
|
317
|
+
*/
|
|
318
|
+
creator: EditorWatchdogCreatorFunction;
|
|
319
|
+
/**
|
|
320
|
+
* A function that destroys the item instance (the editor). The function
|
|
321
|
+
* takes an item and should return a promise. For example: `editor => editor.destroy()`
|
|
322
|
+
*/
|
|
323
|
+
destructor?: (editor: Editor) => Promise<unknown>;
|
|
324
|
+
/**
|
|
325
|
+
* The source element or data that will be passed
|
|
326
|
+
* as the first argument to the `Editor.create()` method.
|
|
327
|
+
*
|
|
328
|
+
* When not provided, the watchdog will use config-based creator mode, passing only the {@link #config}
|
|
329
|
+
* to the editor creator.
|
|
330
|
+
*
|
|
331
|
+
* @deprecated
|
|
332
|
+
*/
|
|
333
|
+
sourceElementOrData?: string | HTMLElement;
|
|
334
|
+
/**
|
|
335
|
+
* An editor configuration.
|
|
336
|
+
*/
|
|
337
|
+
config: EditorConfig;
|
|
338
338
|
}
|