eligius 2.3.2 → 3.0.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.
Files changed (92) hide show
  1. package/README.md +158 -33
  2. package/dist/configuration-api.d.mts +6110 -0
  3. package/dist/configuration-api.mjs +3876 -0
  4. package/dist/configuration-api.mjs.map +1 -0
  5. package/dist/index.d.mts +3980 -1278
  6. package/dist/index.mjs +10476 -4825
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/metadata.d.mts +1060 -282
  9. package/dist/metadata.mjs +592 -278
  10. package/dist/metadata.mjs.map +1 -1
  11. package/dist/{chunk-w6R9maHv.mjs → rolldown-runtime-BOlb2svz.mjs} +1 -0
  12. package/jsonschema/eligius-configuration.json +120 -9
  13. package/jsonschema/operations/add-class.json +2 -7
  14. package/jsonschema/operations/add-controller-to-element.json +4 -3
  15. package/jsonschema/operations/add-globals-to-operation.json +40 -0
  16. package/jsonschema/operations/animate-with-class.json +8 -8
  17. package/jsonschema/operations/animate.json +10 -9
  18. package/jsonschema/operations/announce-to-screen-reader.json +2 -2
  19. package/jsonschema/operations/break-for-each.json +27 -0
  20. package/jsonschema/operations/broadcast-event.json +2 -2
  21. package/jsonschema/operations/calc.json +16 -3
  22. package/jsonschema/operations/clear-element.json +5 -14
  23. package/jsonschema/operations/clear-operation-data.json +3 -4
  24. package/jsonschema/operations/clear-storage.json +48 -0
  25. package/jsonschema/operations/compare-date.json +2 -2
  26. package/jsonschema/operations/concatenate-strings.json +2 -2
  27. package/jsonschema/operations/continue-for-each.json +27 -0
  28. package/jsonschema/operations/create-element.json +21 -5
  29. package/jsonschema/operations/custom-function.json +2 -2
  30. package/jsonschema/operations/end-action.json +5 -13
  31. package/jsonschema/operations/end-for-each.json +27 -0
  32. package/jsonschema/operations/end-when.json +27 -0
  33. package/jsonschema/operations/extend-controller.json +9 -7
  34. package/jsonschema/operations/filter-array.json +4 -12
  35. package/jsonschema/operations/find-in-array.json +4 -12
  36. package/jsonschema/operations/for-each.json +2 -3
  37. package/jsonschema/operations/format-date.json +2 -17
  38. package/jsonschema/operations/format-text.json +15 -7
  39. package/jsonschema/operations/get-attributes-from-element.json +9 -8
  40. package/jsonschema/operations/get-controller-from-element.json +2 -7
  41. package/jsonschema/operations/get-controller-instance.json +18 -5
  42. package/jsonschema/operations/get-current-time.json +3 -4
  43. package/jsonschema/operations/get-element-dimensions.json +4 -12
  44. package/jsonschema/operations/get-focused-element.json +3 -4
  45. package/jsonschema/operations/get-form-data.json +4 -12
  46. package/jsonschema/operations/get-import.json +2 -2
  47. package/jsonschema/operations/get-query-params.json +12 -5
  48. package/jsonschema/operations/get-scroll-position.json +3 -4
  49. package/jsonschema/operations/get-text-content.json +4 -12
  50. package/jsonschema/operations/http-delete.json +11 -3
  51. package/jsonschema/operations/http-post.json +11 -3
  52. package/jsonschema/operations/http-put.json +11 -3
  53. package/jsonschema/operations/invoke-object-method.json +2 -6
  54. package/jsonschema/operations/is-element-in-viewport.json +4 -12
  55. package/jsonschema/operations/load-from-storage.json +12 -3
  56. package/jsonschema/operations/load-json.json +5 -5
  57. package/jsonschema/operations/log.json +4 -7
  58. package/jsonschema/operations/map-array.json +2 -7
  59. package/jsonschema/operations/math.json +18 -3
  60. package/jsonschema/operations/otherwise.json +27 -0
  61. package/jsonschema/operations/remove-class.json +2 -7
  62. package/jsonschema/operations/remove-controller-from-element.json +2 -7
  63. package/jsonschema/operations/remove-element.json +5 -14
  64. package/jsonschema/operations/remove-properties-from-operation-data.json +2 -2
  65. package/jsonschema/operations/reparent-element.json +2 -7
  66. package/jsonschema/operations/replace-string.json +2 -6
  67. package/jsonschema/operations/replace-text.json +2 -6
  68. package/jsonschema/operations/request-action.json +2 -2
  69. package/jsonschema/operations/save-to-storage.json +12 -3
  70. package/jsonschema/operations/scroll-to-element.json +23 -13
  71. package/jsonschema/operations/scroll-to-position.json +12 -3
  72. package/jsonschema/operations/select-element.json +2 -2
  73. package/jsonschema/operations/set-data.json +8 -3
  74. package/jsonschema/operations/set-element-attributes.json +10 -9
  75. package/jsonschema/operations/set-element-content.json +5 -15
  76. package/jsonschema/operations/set-focus.json +5 -14
  77. package/jsonschema/operations/set-form-value.json +2 -7
  78. package/jsonschema/operations/set-global-data.json +2 -2
  79. package/jsonschema/operations/{set.json → set-operation-data.json} +12 -7
  80. package/jsonschema/operations/set-style.json +3 -8
  81. package/jsonschema/operations/set-variable.json +3 -5
  82. package/jsonschema/operations/sort-array.json +14 -13
  83. package/jsonschema/operations/split-string.json +2 -6
  84. package/jsonschema/operations/start-action.json +4 -12
  85. package/jsonschema/operations/substring-text.json +2 -6
  86. package/jsonschema/operations/toggle-class.json +2 -7
  87. package/jsonschema/operations/toggle-element.json +5 -14
  88. package/jsonschema/operations/toggle-form-element.json +2 -7
  89. package/jsonschema/operations/validate-form.json +41 -13
  90. package/jsonschema/operations/wait.json +2 -2
  91. package/jsonschema/operations/when.json +2 -2
  92. package/package.json +49 -24
@@ -1,13 +1,31 @@
1
- import { AnimationItem, CanvasRendererConfig, HTMLRendererConfig, SVGRendererConfig } from "lottie-web";
2
-
1
+ /**
2
+ * Structural stand-in for jQuery's `JQuery` type, so these declarations do not
3
+ * depend on @types/jquery. Module scoped: it shadows the global `JQuery` only
4
+ * inside this file.
5
+ */
6
+ interface JQuery<TElement = HTMLElement> extends Iterable<TElement> {
7
+ readonly jquery: string;
8
+ readonly length: number;
9
+ [index: number]: TElement;
10
+ }
11
+ declare namespace JQuery {
12
+ type Duration = number | 'fast' | 'slow';
13
+ type Node = Element | Text | Comment | Document | DocumentFragment;
14
+ }
3
15
  //#region src/eventbus/events/before-request-timeline-uri.d.ts
4
16
  /**
5
17
  * Event: before-request-timeline-uri
18
+ *
19
+ * Broadcast by `RequestVideoUriInterceptor` just before a
20
+ * `request-timeline-uri` event is handled, with the same arguments.
21
+ *
22
+ * @param uri - The timeline URI that is about to be loaded
23
+ * @param position - Optional start position (defaults to 0)
6
24
  * @category Timeline
7
25
  */
8
26
  interface BeforeRequestTimelineUriEvent {
9
27
  name: 'before-request-timeline-uri';
10
- args: [];
28
+ args: [uri: string, position?: number];
11
29
  }
12
30
  //#endregion
13
31
  //#region src/eventbus/events/before-request-video-url.d.ts
@@ -16,6 +34,8 @@ interface BeforeRequestTimelineUriEvent {
16
34
  * @param index - The video URL index
17
35
  * @param requestedVideoPosition - Optional video position to seek to
18
36
  * @param isHistoryRequest - Flag indicating if this is a history request
37
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
38
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
19
39
  * @category Navigation
20
40
  */
21
41
  interface BeforeRequestVideoUrlEvent {
@@ -34,6 +54,22 @@ interface DomMutationEvent {
34
54
  args: [payload: any];
35
55
  }
36
56
  //#endregion
57
+ //#region src/eventbus/events/engine-command-error.d.ts
58
+ /**
59
+ * Event: engine-command-error
60
+ * Broadcast by EngineEventbusAdapter when an engine command that an eventbus
61
+ * event triggered fails, for example `engine.start()` after a
62
+ * `timeline-play-request` when the browser blocks autoplay. The failure is
63
+ * also logged with `console.error`.
64
+ * @param command - The engine method that failed: `'start'`, `'stop'`, `'seek'` or `'switchTimeline'`
65
+ * @param error - The value the engine's promise rejected with
66
+ * @category Engine
67
+ */
68
+ interface EngineCommandErrorEvent {
69
+ name: 'engine-command-error';
70
+ args: [command: string, error: unknown];
71
+ }
72
+ //#endregion
37
73
  //#region src/eventbus/events/highlight-navigation.d.ts
38
74
  /**
39
75
  * Event: highlight-navigation
@@ -45,41 +81,6 @@ interface HighlightNavigationEvent {
45
81
  args: [videoUrlIndex: number];
46
82
  }
47
83
  //#endregion
48
- //#region src/locale/types.d.ts
49
- /**
50
- * Locale Types
51
- * Feature: 005-rosetta-locale-manager
52
- *
53
- * These types define the public API for the locale management system.
54
- */
55
- /**
56
- * IETF language tag format (e.g., 'en-US', 'nl-NL')
57
- */
58
- type TLanguageCode = `${Lowercase<string>}-${Uppercase<string>}`;
59
- //#endregion
60
- //#region src/types.d.ts
61
- type TResultCallback<T> = (result: T) => void;
62
- /**
63
- * Describes a duration of time expressed in a start and an optional end range with a one second interval.
64
- */
65
- interface IDuration {
66
- start: number;
67
- end?: number;
68
- }
69
- /**
70
- * Describes a duration of time expressed in a start and an end range with a one second interval.
71
- */
72
- interface IStrictDuration extends Required<IDuration> {}
73
- interface ISubtitleCollection {
74
- languageCode: TLanguageCode;
75
- titles: ISubtitle[];
76
- }
77
- interface ISubtitle {
78
- id: string;
79
- duration: IStrictDuration;
80
- text: string;
81
- }
82
- //#endregion
83
84
  //#region src/eventbus/events/language-change.d.ts
84
85
  /**
85
86
  * Event: language-change
@@ -96,6 +97,8 @@ interface LanguageChangeEvent {
96
97
  * Event: navigate-to-video-url
97
98
  * @param index - The video URL index to navigate to
98
99
  * @param requestedVideoPosition - Optional video position to seek to
100
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
101
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
99
102
  * @category Navigation
100
103
  */
101
104
  interface NavigateToVideoUrlEvent {
@@ -116,25 +119,32 @@ interface PushHistoryStateEvent {
116
119
  //#endregion
117
120
  //#region src/eventbus/events/request-action.d.ts
118
121
  /**
119
- * Event: request-action
122
+ * Request: request-action
123
+ * Answered through `eventbus.request('request-action', actionName)` by
124
+ * EngineFactory with the configured action of that name. Throws for an
125
+ * unknown name, with a "did you mean" hint.
120
126
  * @param actionName - The name of the action to request
121
- * @param callback - Callback that receives the action instance
127
+ * @returns The action
122
128
  * @category Engine Request
123
129
  */
124
130
  interface RequestActionEvent {
125
131
  name: 'request-action';
126
- args: [actionName: string, callback: (actionInstance: any) => void];
132
+ args: [actionName: string];
133
+ returns: IAction;
127
134
  }
128
135
  //#endregion
129
136
  //#region src/eventbus/events/request-current-language.d.ts
130
137
  /**
131
- * Event: request-current-language
132
- * @param callback - Callback that receives the current language
138
+ * Request: request-current-language
139
+ * Answered through `eventbus.request('request-current-language')` by
140
+ * LocaleEventbusAdapter with the active locale.
141
+ * @returns The current language code
133
142
  * @category Engine Request
134
143
  */
135
144
  interface RequestCurrentLanguageEvent {
136
145
  name: 'request-current-language';
137
- args: [callback: (language: TLanguageCode) => void];
146
+ args: [];
147
+ returns: TLanguageCode;
138
148
  }
139
149
  //#endregion
140
150
  //#region src/eventbus/events/request-current-navigation.d.ts
@@ -150,19 +160,26 @@ interface RequestCurrentNavigationEvent {
150
160
  //#endregion
151
161
  //#region src/eventbus/events/request-current-timeline-position.d.ts
152
162
  /**
153
- * Event: request-current-timeline-position
154
- * @param callback - Callback that receives the current timeline position
163
+ * Request: request-current-timeline-position
164
+ * Answered through `eventbus.request('request-current-timeline-position')` by
165
+ * EngineEventbusAdapter with the position of the current timeline. The engine
166
+ * also answers the legacy form, a broadcast whose last argument is a
167
+ * callback that receives the value.
168
+ * @returns The current position in seconds
155
169
  * @category Engine Request
156
170
  */
157
171
  interface RequestCurrentTimelinePositionEvent {
158
172
  name: 'request-current-timeline-position';
159
- args: [callback: TResultCallback<number>];
173
+ args: [];
174
+ returns: number;
160
175
  }
161
176
  //#endregion
162
177
  //#region src/eventbus/events/request-current-video-position.d.ts
163
178
  /**
164
179
  * Event: request-current-video-position
165
180
  * @param callback - Callback that receives the current video position
181
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
182
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
166
183
  * @category Navigation
167
184
  */
168
185
  interface RequestCurrentVideoPositionEvent {
@@ -172,37 +189,52 @@ interface RequestCurrentVideoPositionEvent {
172
189
  //#endregion
173
190
  //#region src/eventbus/events/request-engine-root.d.ts
174
191
  /**
175
- * Event: request-engine-root
176
- * @param callback - Callback that receives the engine root element
192
+ * Request: request-engine-root
193
+ * Answered through `eventbus.request('request-engine-root')` with the
194
+ * engine's root element (the container selector). From `engine.init()` until
195
+ * `engine.destroy()` every answer is the same jQuery instance. The engine also
196
+ * answers the legacy form, a broadcast whose last argument is a callback that
197
+ * receives the value.
198
+ * @returns The engine root element
177
199
  * @category Engine Request
178
200
  */
179
201
  interface RequestEngineRootEvent {
180
202
  name: 'request-engine-root';
181
- args: [callback: (root: any) => void];
203
+ args: [];
204
+ returns: JQuery<HTMLElement>;
182
205
  }
183
206
  //#endregion
184
207
  //#region src/eventbus/events/request-function.d.ts
185
208
  /**
186
- * Event: request-function
209
+ * Request: request-function
210
+ * Answered through `eventbus.request('request-function', systemName)` by
211
+ * EngineFactory with the function (such as an operation) the resource
212
+ * importer provides under that name. Throws for an unknown name.
187
213
  * @param systemName - The name of the function to request
188
- * @param callback - Callback that receives the function
214
+ * @returns The function
189
215
  * @category Engine Request
190
216
  */
191
217
  interface RequestFunctionEvent {
192
218
  name: 'request-function';
193
- args: [systemName: string, callback: (fn: any) => void];
219
+ args: [systemName: string];
220
+ returns: unknown;
194
221
  }
195
222
  //#endregion
196
223
  //#region src/eventbus/events/request-instance.d.ts
197
224
  /**
198
- * Event: request-instance
199
- * @param instanceName - The name of the instance to request
200
- * @param callback - Callback that receives the instance
225
+ * Request: request-instance
226
+ * Answered through `eventbus.request('request-instance', systemName)` by
227
+ * EngineFactory with a new instance of the class the resource importer
228
+ * provides under that name (a controller, for example), constructed with the
229
+ * eventbus. Throws for an unknown name.
230
+ * @param systemName - The name of the class to instantiate
231
+ * @returns The new instance
201
232
  * @category Engine Request
202
233
  */
203
234
  interface RequestInstanceEvent {
204
235
  name: 'request-instance';
205
- args: [instanceName: string, callback: (instance: any) => void];
236
+ args: [systemName: string];
237
+ returns: unknown;
206
238
  }
207
239
  //#endregion
208
240
  //#region src/eventbus/events/request-label-collection.d.ts
@@ -210,6 +242,8 @@ interface RequestInstanceEvent {
210
242
  * Event: request-label-collection
211
243
  * @param language - The language code
212
244
  * @param callback - Callback that receives the label collection
245
+ * @deprecated Legacy label event; the engine does not handle it. Labels moved to the locale manager in
246
+ * 2.2.0: use `request-translation` (or LabelController with a `translationKey`) instead.
213
247
  * @category Engine Request
214
248
  */
215
249
  interface RequestLabelCollectionEvent {
@@ -222,6 +256,8 @@ interface RequestLabelCollectionEvent {
222
256
  * Event: request-label-collections
223
257
  * @param labelIds - Array of label IDs to retrieve
224
258
  * @param callback - Callback that receives the label collections
259
+ * @deprecated Legacy label event; the engine does not handle it. Labels moved to the locale manager in
260
+ * 2.2.0: use `request-translation` (or LabelController with a `translationKey`) instead.
225
261
  * @category Engine Request
226
262
  */
227
263
  interface RequestLabelCollectionsEvent {
@@ -251,9 +287,28 @@ interface RequestTimelineUriEvent {
251
287
  args: [uri: string, position?: number];
252
288
  }
253
289
  //#endregion
290
+ //#region src/eventbus/events/request-translation.d.ts
291
+ /**
292
+ * Request: request-translation
293
+ * Answered through `eventbus.request('request-translation', key, params)` by
294
+ * LocaleEventbusAdapter with the translation for the key in the active
295
+ * locale, see `ILocaleManager.t`.
296
+ * @param key - Dot-notation translation key, or its segments
297
+ * @param params - Optional values for the placeholders in the translation
298
+ * @returns The translated text
299
+ * @category Engine Request
300
+ */
301
+ interface RequestTranslationEvent {
302
+ name: 'request-translation';
303
+ args: [key: string | string[], params?: Record<string, unknown>];
304
+ returns: string;
305
+ }
306
+ //#endregion
254
307
  //#region src/eventbus/events/request-video-cleanup.d.ts
255
308
  /**
256
309
  * Event: request-video-cleanup
310
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
311
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
257
312
  * @category Navigation
258
313
  */
259
314
  interface RequestVideoCleanupEvent {
@@ -267,6 +322,8 @@ interface RequestVideoCleanupEvent {
267
322
  * @param videoUrlIndex - The index of the video URL
268
323
  * @param requestedVideoPosition - Optional video position to seek to
269
324
  * @param fromRouting - Optional flag indicating if request came from routing
325
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
326
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
270
327
  * @category Navigation
271
328
  */
272
329
  interface RequestVideoUrlEvent {
@@ -286,13 +343,18 @@ interface CompleteEvent {
286
343
  //#endregion
287
344
  //#region src/eventbus/events/timeline-container-request.d.ts
288
345
  /**
289
- * Event: timeline-container-request
290
- * @param callback - Callback that receives the container element
346
+ * Request: timeline-container-request
347
+ * Answered through `eventbus.request('timeline-container-request')` by
348
+ * EngineEventbusAdapter with the DOM container of the current timeline. The
349
+ * engine also answers the legacy form, a broadcast whose last argument is a
350
+ * callback that receives the value.
351
+ * @returns The container element, or undefined when there is none
291
352
  * @category Timeline
292
353
  */
293
354
  interface ContainerRequestEvent {
294
355
  name: 'timeline-container-request';
295
- args: [callback: (element: HTMLElement) => void];
356
+ args: [];
357
+ returns: JQuery<HTMLElement> | undefined;
296
358
  }
297
359
  //#endregion
298
360
  //#region src/eventbus/events/timeline-current-timeline-change.d.ts
@@ -306,17 +368,6 @@ interface CurrentTimelineChangeEvent {
306
368
  args: [timelineUri: string];
307
369
  }
308
370
  //#endregion
309
- //#region src/eventbus/events/timeline-duration-request.d.ts
310
- /**
311
- * Event: timeline-duration-request
312
- * @param callback - Callback that receives the duration
313
- * @category Timeline
314
- */
315
- interface DurationRequestEvent {
316
- name: 'timeline-duration-request';
317
- args: [callback: (duration: number) => void];
318
- }
319
- //#endregion
320
371
  //#region src/eventbus/events/timeline-duration.d.ts
321
372
  /**
322
373
  * Event: timeline-duration
@@ -328,6 +379,22 @@ interface DurationEvent {
328
379
  args: [getDuration: (() => number) | undefined];
329
380
  }
330
381
  //#endregion
382
+ //#region src/eventbus/events/timeline-duration-request.d.ts
383
+ /**
384
+ * Request: timeline-duration-request
385
+ * Answered through `eventbus.request('timeline-duration-request')` by
386
+ * EngineEventbusAdapter with the duration of the current timeline. The engine
387
+ * also answers the legacy form, a broadcast whose last argument is a
388
+ * callback that receives the value.
389
+ * @returns The duration in seconds, or undefined when it is not known yet
390
+ * @category Timeline
391
+ */
392
+ interface DurationRequestEvent {
393
+ name: 'timeline-duration-request';
394
+ args: [];
395
+ returns: number | undefined;
396
+ }
397
+ //#endregion
331
398
  //#region src/eventbus/events/timeline-firstframe.d.ts
332
399
  /**
333
400
  * Event: timeline-firstframe
@@ -338,6 +405,16 @@ interface FirstFrameEvent {
338
405
  args: [];
339
406
  }
340
407
  //#endregion
408
+ //#region src/eventbus/events/timeline-pause.d.ts
409
+ /**
410
+ * Event: timeline-pause
411
+ * @category Timeline
412
+ */
413
+ interface PauseEvent {
414
+ name: 'timeline-pause';
415
+ args: [];
416
+ }
417
+ //#endregion
341
418
  //#region src/eventbus/events/timeline-pause-request.d.ts
342
419
  /**
343
420
  * Event: timeline-pause-request
@@ -348,13 +425,13 @@ interface PauseRequestEvent {
348
425
  args: [];
349
426
  }
350
427
  //#endregion
351
- //#region src/eventbus/events/timeline-pause.d.ts
428
+ //#region src/eventbus/events/timeline-play.d.ts
352
429
  /**
353
- * Event: timeline-pause
430
+ * Event: timeline-play
354
431
  * @category Timeline
355
432
  */
356
- interface PauseEvent {
357
- name: 'timeline-pause';
433
+ interface PlayEvent {
434
+ name: 'timeline-play';
358
435
  args: [];
359
436
  }
360
437
  //#endregion
@@ -378,35 +455,20 @@ interface PlayToggleRequestEvent {
378
455
  args: [];
379
456
  }
380
457
  //#endregion
381
- //#region src/eventbus/events/timeline-play.d.ts
382
- /**
383
- * Event: timeline-play
384
- * @category Timeline
385
- */
386
- interface PlayEvent {
387
- name: 'timeline-play';
388
- args: [];
389
- }
390
- //#endregion
391
458
  //#region src/eventbus/events/timeline-request-current-timeline.d.ts
392
459
  /**
393
- * Event: timeline-request-current-timeline
394
- * @param callback - Callback that receives the current timeline URI
460
+ * Request: timeline-request-current-timeline
461
+ * Answered through `eventbus.request('timeline-request-current-timeline')` by
462
+ * EngineEventbusAdapter with the URI of the current timeline. The engine also
463
+ * answers the legacy form, a broadcast whose last argument is a callback that
464
+ * receives the value.
465
+ * @returns The current timeline URI
395
466
  * @category Engine Request
396
467
  */
397
468
  interface RequestCurrentTimelineEvent {
398
469
  name: 'timeline-request-current-timeline';
399
- args: [callback: TResultCallback<string>];
400
- }
401
- //#endregion
402
- //#region src/eventbus/events/timeline-resize-request.d.ts
403
- /**
404
- * Event: timeline-resize-request
405
- * @category Timeline
406
- */
407
- interface ResizeRequestEvent {
408
- name: 'timeline-resize-request';
409
470
  args: [];
471
+ returns: string;
410
472
  }
411
473
  //#endregion
412
474
  //#region src/eventbus/events/timeline-resize.d.ts
@@ -419,25 +481,24 @@ interface ResizeEvent {
419
481
  args: [];
420
482
  }
421
483
  //#endregion
422
- //#region src/eventbus/events/timeline-restart.d.ts
484
+ //#region src/eventbus/events/timeline-resize-request.d.ts
423
485
  /**
424
- * Event: timeline-restart
486
+ * Event: timeline-resize-request
425
487
  * @category Timeline
426
488
  */
427
- interface RestartEvent {
428
- name: 'timeline-restart';
489
+ interface ResizeRequestEvent {
490
+ name: 'timeline-resize-request';
429
491
  args: [];
430
492
  }
431
493
  //#endregion
432
- //#region src/eventbus/events/timeline-seek-request.d.ts
494
+ //#region src/eventbus/events/timeline-restart.d.ts
433
495
  /**
434
- * Event: timeline-seek-request
435
- * @param position - The timeline position to seek to
496
+ * Event: timeline-restart
436
497
  * @category Timeline
437
498
  */
438
- interface SeekRequestEvent {
439
- name: 'timeline-seek-request';
440
- args: [position: number];
499
+ interface RestartEvent {
500
+ name: 'timeline-restart';
501
+ args: [];
441
502
  }
442
503
  //#endregion
443
504
  //#region src/eventbus/events/timeline-seek.d.ts
@@ -453,6 +514,17 @@ interface SeekEvent {
453
514
  args: [seekPosition: number, currentPosition: number, duration: number];
454
515
  }
455
516
  //#endregion
517
+ //#region src/eventbus/events/timeline-seek-request.d.ts
518
+ /**
519
+ * Event: timeline-seek-request
520
+ * @param position - The timeline position to seek to
521
+ * @category Timeline
522
+ */
523
+ interface SeekRequestEvent {
524
+ name: 'timeline-seek-request';
525
+ args: [position: number];
526
+ }
527
+ //#endregion
456
528
  //#region src/eventbus/events/timeline-seeked.d.ts
457
529
  /**
458
530
  * Event: timeline-seeked
@@ -465,23 +537,23 @@ interface SeekedEvent {
465
537
  args: [position: number, duration: number];
466
538
  }
467
539
  //#endregion
468
- //#region src/eventbus/events/timeline-stop-request.d.ts
540
+ //#region src/eventbus/events/timeline-stop.d.ts
469
541
  /**
470
- * Event: timeline-stop-request
542
+ * Event: timeline-stop
471
543
  * @category Timeline
472
544
  */
473
- interface StopRequestEvent {
474
- name: 'timeline-stop-request';
545
+ interface StopEvent {
546
+ name: 'timeline-stop';
475
547
  args: [];
476
548
  }
477
549
  //#endregion
478
- //#region src/eventbus/events/timeline-stop.d.ts
550
+ //#region src/eventbus/events/timeline-stop-request.d.ts
479
551
  /**
480
- * Event: timeline-stop
552
+ * Event: timeline-stop-request
481
553
  * @category Timeline
482
554
  */
483
- interface StopEvent {
484
- name: 'timeline-stop';
555
+ interface StopRequestEvent {
556
+ name: 'timeline-stop-request';
485
557
  args: [];
486
558
  }
487
559
  //#endregion
@@ -500,6 +572,8 @@ interface TimeEvent {
500
572
  /**
501
573
  * Event: video-complete
502
574
  * @param index - The video URL index that completed
575
+ * @deprecated Legacy video navigation event; the engine does not handle it. Use a navigation entry with
576
+ * `timelineUri` (broadcast as `request-timeline-uri`) and the timeline events instead.
503
577
  * @category Navigation
504
578
  */
505
579
  interface VideoCompleteEvent {
@@ -507,60 +581,6 @@ interface VideoCompleteEvent {
507
581
  args: [index: number];
508
582
  }
509
583
  //#endregion
510
- //#region src/eventbus/events/types.d.ts
511
- type AllEvents = BeforeRequestTimelineUriEvent | BeforeRequestVideoUrlEvent | DomMutationEvent | HighlightNavigationEvent | LanguageChangeEvent | NavigateToVideoUrlEvent | PushHistoryStateEvent | RequestActionEvent | RequestCurrentLanguageEvent | RequestCurrentNavigationEvent | RequestCurrentTimelinePositionEvent | RequestCurrentVideoPositionEvent | RequestEngineRootEvent | RequestFunctionEvent | RequestInstanceEvent | RequestLabelCollectionEvent | RequestLabelCollectionsEvent | RequestTimelineCleanupEvent | RequestTimelineUriEvent | RequestVideoCleanupEvent | RequestVideoUrlEvent | CompleteEvent | ContainerRequestEvent | CurrentTimelineChangeEvent | DurationRequestEvent | DurationEvent | FirstFrameEvent | PauseRequestEvent | PauseEvent | PlayRequestEvent | PlayToggleRequestEvent | PlayEvent | RequestCurrentTimelineEvent | ResizeRequestEvent | ResizeEvent | RestartEvent | SeekRequestEvent | SeekEvent | SeekedEvent | StopRequestEvent | StopEvent | TimeEvent | VideoCompleteEvent;
512
- type EventMap = { [K in AllEvents as K['name']]: K['args'] };
513
- type EventName = keyof EventMap;
514
- //#endregion
515
- //#region src/eventbus/types.d.ts
516
- type TEventbusRemover = () => void;
517
- type TRequestResponder<T = unknown> = (...args: any[]) => T;
518
- interface IEventbus {
519
- clear(): void;
520
- on<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
521
- off<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): void;
522
- once<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
523
- broadcast<E extends EventName>(eventName: E, args: EventMap[E]): void;
524
- broadcastForTopic<E extends EventName>(eventName: E, eventTopic: string, args: EventMap[E]): void;
525
- /**
526
- * Register a responder for synchronous request/response queries.
527
- * Only the first registered responder for an event will be called.
528
- *
529
- * @param eventName - The request event name
530
- * @param responder - Function that returns the response value
531
- * @param eventTopic - Optional topic for topic-specific responders
532
- * @returns Function to unregister the responder
533
- */
534
- onRequest<T>(eventName: string, responder: TRequestResponder<T>, eventTopic?: string): TEventbusRemover;
535
- /**
536
- * Send a synchronous request and get an immediate response.
537
- * Returns undefined if no responder is registered.
538
- *
539
- * @param eventName - The request event name
540
- * @param args - Arguments to pass to the responder
541
- * @returns The response value, or undefined if no responder
542
- */
543
- request<T>(eventName: string, ...args: unknown[]): T | undefined;
544
- /**
545
- * Send a synchronous request for a specific topic.
546
- * Returns undefined if no responder is registered for that topic.
547
- *
548
- * @param eventName - The request event name
549
- * @param eventTopic - The topic to target
550
- * @param args - Arguments to pass to the responder
551
- * @returns The response value, or undefined if no responder
552
- */
553
- requestForTopic<T>(eventName: string, eventTopic: string, ...args: unknown[]): T | undefined;
554
- registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover;
555
- registerInterceptor(eventName: string, interceptor: IEventbusInterceptor, eventTopic?: string): TEventbusRemover;
556
- }
557
- interface IEventbusListener {
558
- handleEvent(eventName: string, eventTopic: string | undefined, args: any[]): void;
559
- }
560
- interface IEventbusInterceptor {
561
- intercept(eventArgs: any[]): any[];
562
- }
563
- //#endregion
564
584
  //#region src/eventbus/events/metadata/types.d.ts
565
585
  /**
566
586
  * Metadata for an event in the EventBus system.
@@ -582,16 +602,24 @@ interface IEventbusInterceptor {
582
602
  * };
583
603
  * ```
584
604
  */
585
- interface IEventMetadata<_TArgs extends any[] = any[]> {
605
+ export interface IEventMetadata<_TArgs extends any[] = any[]> {
586
606
  /** Human-readable description of the event, typically "Event: {event-name}" */
587
607
  description: string;
588
608
  /** Category grouping for the event (e.g., "Timeline", "Language", "Engine") */
589
609
  category: string;
590
610
  /** Metadata for each argument in the event's args tuple */
591
611
  args: Array<{
592
- /** Name of the argument (from labeled tuple element) */name: string; /** TypeScript type of the argument as a string (e.g., "number", "string") */
593
- type: string; /** Optional description of the argument from JSDoc @param tag */
612
+ /** Name of the argument (from labeled tuple element) */
613
+ name: string;
614
+ /** TypeScript type of the argument as a string (e.g., "number", "string") */
615
+ type: string;
616
+ /** Optional description of the argument from JSDoc @param tag */
594
617
  description?: string;
618
+ /**
619
+ * True when the argument may be left out (an optional tuple element such
620
+ * as `position?: number`); absent for required arguments
621
+ */
622
+ optional?: boolean;
595
623
  }>;
596
624
  }
597
625
  //#endregion
@@ -654,6 +682,274 @@ interface IOperationScope {
654
682
  }
655
683
  type TOperation<T extends TOperationData = TOperationData, RT = T> = (this: IOperationScope, operationData: T) => TOperationResult<RT>;
656
684
  //#endregion
685
+ //#region src/locale/types.d.ts
686
+ /**
687
+ * Locale Types
688
+ * Feature: 005-rosetta-locale-manager
689
+ *
690
+ * These types define the public API for the locale management system.
691
+ */
692
+ /**
693
+ * IETF language tag format (e.g., 'en-US', 'nl-NL')
694
+ */
695
+ type TLanguageCode = `${Lowercase<string>}-${Uppercase<string>}`;
696
+ //#endregion
697
+ //#region src/types.d.ts
698
+ /**
699
+ * The phase of an action in which an error occurred.
700
+ */
701
+ type TActionPhase = 'start' | 'end';
702
+ /**
703
+ * Error reported through the engine's `error` event (and the `engine-error`
704
+ * eventbus event) when a timeline action dispatched by the engine fails.
705
+ *
706
+ * The message names the action, the phase and, when the original error
707
+ * carries it, the operation, followed by the original message.
708
+ */
709
+ interface IEngineActionError extends Error {
710
+ /** Name of the failing action */
711
+ readonly actionName: string;
712
+ /** Id of the failing action */
713
+ readonly actionId: string;
714
+ /** Whether the start or the end operations failed */
715
+ readonly phase: TActionPhase;
716
+ /** System name of the failing operation, when known */
717
+ readonly operationSystemName?: string;
718
+ /** Index of the failing operation in its operation list, when known */
719
+ readonly operationIndex?: number;
720
+ /** The original error */
721
+ readonly cause: unknown;
722
+ }
723
+ /**
724
+ * Describes a duration of time expressed in a start and an optional end range with a one second interval.
725
+ */
726
+ interface IDuration {
727
+ start: number;
728
+ end?: number;
729
+ }
730
+ /**
731
+ * Describes a duration of time expressed in a start and an end range with a one second interval.
732
+ */
733
+ interface IStrictDuration extends Required<IDuration> {}
734
+ interface ISubtitleCollection {
735
+ languageCode: TLanguageCode;
736
+ titles: ISubtitle[];
737
+ }
738
+ interface ISubtitle {
739
+ id: string;
740
+ duration: IStrictDuration;
741
+ text: string;
742
+ }
743
+ //#endregion
744
+ //#region src/eventbus/events/engine-error.d.ts
745
+ /**
746
+ * Event: engine-error
747
+ * Broadcast when a timeline action that the engine started or ended on its
748
+ * own fails. The error names the action, the phase (start or end) and, when
749
+ * known, the failing operation.
750
+ * @param error - The error, with the original error as its `cause`
751
+ * @category Engine
752
+ */
753
+ interface EngineErrorEvent {
754
+ name: 'engine-error';
755
+ args: [error: IEngineActionError];
756
+ }
757
+ //#endregion
758
+ //#region src/eventbus/events/types.d.ts
759
+ type AllEvents = BeforeRequestTimelineUriEvent | BeforeRequestVideoUrlEvent | DomMutationEvent | EngineCommandErrorEvent | EngineErrorEvent | HighlightNavigationEvent | LanguageChangeEvent | NavigateToVideoUrlEvent | PushHistoryStateEvent | RequestActionEvent | RequestCurrentLanguageEvent | RequestCurrentNavigationEvent | RequestCurrentTimelinePositionEvent | RequestCurrentVideoPositionEvent | RequestEngineRootEvent | RequestFunctionEvent | RequestInstanceEvent | RequestLabelCollectionEvent | RequestLabelCollectionsEvent | RequestTimelineCleanupEvent | RequestTimelineUriEvent | RequestTranslationEvent | RequestVideoCleanupEvent | RequestVideoUrlEvent | CompleteEvent | ContainerRequestEvent | CurrentTimelineChangeEvent | DurationRequestEvent | DurationEvent | FirstFrameEvent | PauseRequestEvent | PauseEvent | PlayRequestEvent | PlayToggleRequestEvent | PlayEvent | RequestCurrentTimelineEvent | ResizeRequestEvent | ResizeEvent | RestartEvent | SeekRequestEvent | SeekEvent | SeekedEvent | StopRequestEvent | StopEvent | TimeEvent | VideoCompleteEvent;
760
+ type EventMap = { [K in AllEvents as K['name']]: K extends {
761
+ returns: infer R;
762
+ } ? [...K['args'], callback?: (result: R) => void] : K['args']; };
763
+ type EventName = keyof EventMap;
764
+ /**
765
+ * The request/response queries that Eligius itself answers through
766
+ * `IEventbus.onRequest`, with the arguments each takes and the value it
767
+ * returns. Generated from the event interfaces in `src/eventbus/events`
768
+ * that declare a `returns` property.
769
+ *
770
+ * Querying one of these names with `IEventbus.request` (without an
771
+ * explicit type argument) types the response, and registering a
772
+ * responder for one with `IEventbus.onRequest` checks the signature.
773
+ * The untyped string overloads remain for custom request names.
774
+ */
775
+ interface RequestMap {
776
+ 'request-action': {
777
+ args: RequestActionEvent['args'];
778
+ returns: RequestActionEvent['returns'];
779
+ };
780
+ 'request-current-language': {
781
+ args: RequestCurrentLanguageEvent['args'];
782
+ returns: RequestCurrentLanguageEvent['returns'];
783
+ };
784
+ 'request-current-timeline-position': {
785
+ args: RequestCurrentTimelinePositionEvent['args'];
786
+ returns: RequestCurrentTimelinePositionEvent['returns'];
787
+ };
788
+ 'request-engine-root': {
789
+ args: RequestEngineRootEvent['args'];
790
+ returns: RequestEngineRootEvent['returns'];
791
+ };
792
+ 'request-function': {
793
+ args: RequestFunctionEvent['args'];
794
+ returns: RequestFunctionEvent['returns'];
795
+ };
796
+ 'request-instance': {
797
+ args: RequestInstanceEvent['args'];
798
+ returns: RequestInstanceEvent['returns'];
799
+ };
800
+ 'request-translation': {
801
+ args: RequestTranslationEvent['args'];
802
+ returns: RequestTranslationEvent['returns'];
803
+ };
804
+ 'timeline-container-request': {
805
+ args: ContainerRequestEvent['args'];
806
+ returns: ContainerRequestEvent['returns'];
807
+ };
808
+ 'timeline-duration-request': {
809
+ args: DurationRequestEvent['args'];
810
+ returns: DurationRequestEvent['returns'];
811
+ };
812
+ 'timeline-request-current-timeline': {
813
+ args: RequestCurrentTimelineEvent['args'];
814
+ returns: RequestCurrentTimelineEvent['returns'];
815
+ };
816
+ }
817
+ //#endregion
818
+ //#region src/eventbus/types.d.ts
819
+ type TEventbusRemover = () => void;
820
+ type TRequestResponder<T = unknown> = (...args: any[]) => T;
821
+ /**
822
+ * Names of the request/response queries declared in {@link RequestMap}.
823
+ */
824
+ type RequestName = keyof RequestMap;
825
+ /**
826
+ * Responder signature for a request declared in {@link RequestMap}.
827
+ */
828
+ type TTypedRequestResponder<K extends RequestName> = (...args: RequestMap[K]['args']) => RequestMap[K]['returns'];
829
+ /**
830
+ * Describes who reports an error through {@link IEventbus.reportError}.
831
+ */
832
+ interface IEventbusErrorReport {
833
+ /** The reporting component, such as `'DOMEventListenerController'`. */
834
+ source: string;
835
+ /** The eventbus event being handled when the error occurred, if any. */
836
+ eventName?: string;
837
+ }
838
+ interface IEventbus {
839
+ clear(): void;
840
+ on<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
841
+ /**
842
+ * Removes one registration of the handler. A handler registered with
843
+ * {@link IEventbus.once} can be removed by passing the original function;
844
+ * an exact `on()` registration of the same function is removed first.
845
+ *
846
+ * @param eventName - The event name
847
+ * @param eventHandler - The handler that was registered
848
+ * @param eventTopic - The topic it was registered for, if any
849
+ */
850
+ off<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): void;
851
+ once<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
852
+ /**
853
+ * Broadcast an event to its interceptors, the eventbus listeners and its
854
+ * handlers, in that order.
855
+ *
856
+ * Errors are isolated: a handler, listener or interceptor that throws (or
857
+ * returns a promise that rejects) is reported through `console.error` and
858
+ * the `onHandlerError` option, and the remaining ones still run. A failing
859
+ * interceptor leaves the arguments as they were before it ran. This method
860
+ * never throws because of them.
861
+ *
862
+ * @param eventName - The event name
863
+ * @param args - The event arguments
864
+ */
865
+ broadcast<E extends EventName>(eventName: E, args: EventMap[E]): void;
866
+ /**
867
+ * Broadcast an event for a specific topic. Errors are isolated the same way
868
+ * as in {@link IEventbus.broadcast}.
869
+ *
870
+ * @param eventName - The event name
871
+ * @param eventTopic - The topic to target
872
+ * @param args - The event arguments
873
+ */
874
+ broadcastForTopic<E extends EventName>(eventName: E, eventTopic: string, args: EventMap[E]): void;
875
+ /**
876
+ * Register a responder for synchronous request/response queries.
877
+ * Only the first registered responder for an event will be called.
878
+ *
879
+ * For a name declared in {@link RequestMap} the responder's arguments and
880
+ * return value are type checked.
881
+ *
882
+ * @param eventName - The request event name
883
+ * @param responder - Function that returns the response value
884
+ * @param eventTopic - Optional topic for topic-specific responders
885
+ * @returns Function to unregister the responder
886
+ */
887
+ onRequest<K extends RequestName>(eventName: K, responder: TTypedRequestResponder<K>, eventTopic?: string): TEventbusRemover;
888
+ onRequest<T>(eventName: string, responder: TRequestResponder<T>, eventTopic?: string): TEventbusRemover;
889
+ /**
890
+ * Send a synchronous request and get an immediate response.
891
+ * Returns undefined if no responder is registered.
892
+ *
893
+ * For a name declared in {@link RequestMap}, called without an explicit
894
+ * type argument, the response is typed from the map.
895
+ *
896
+ * Unlike a broadcast, an error thrown by the responder is not caught: it
897
+ * propagates to the caller, which needs the response and has no other way
898
+ * to tell a failure from an `undefined` answer.
899
+ *
900
+ * @param eventName - The request event name
901
+ * @param args - Arguments to pass to the responder
902
+ * @returns The response value, or undefined if no responder
903
+ * @throws Whatever the responder throws
904
+ */
905
+ request<K extends RequestName>(eventName: K, ...args: RequestMap[K]['args']): RequestMap[K]['returns'] | undefined;
906
+ request<T>(eventName: string, ...args: unknown[]): T | undefined;
907
+ /**
908
+ * Send a synchronous request for a specific topic.
909
+ * Returns undefined if no responder is registered for that topic.
910
+ * Errors thrown by the responder propagate to the caller, as in
911
+ * {@link IEventbus.request}.
912
+ *
913
+ * @param eventName - The request event name
914
+ * @param eventTopic - The topic to target
915
+ * @param args - Arguments to pass to the responder
916
+ * @returns The response value, or undefined if no responder
917
+ * @throws Whatever the responder throws
918
+ */
919
+ requestForTopic<K extends RequestName>(eventName: K, eventTopic: string, ...args: RequestMap[K]['args']): RequestMap[K]['returns'] | undefined;
920
+ requestForTopic<T>(eventName: string, eventTopic: string, ...args: unknown[]): T | undefined;
921
+ /**
922
+ * Reports an error that a component caught and does not rethrow, such as
923
+ * an action that failed in a controller's DOM event handler. It goes the
924
+ * same way as a failing broadcast handler: `console.error` naming the
925
+ * source, then the `onHandlerError` option with source `'reported'`. It
926
+ * never throws.
927
+ *
928
+ * Optional, so existing `IEventbus` implementations still type check; the
929
+ * built-in {@link Eventbus} implements it. Callers fall back to
930
+ * `console.error` when it is missing.
931
+ *
932
+ * @param error - The caught error
933
+ * @param context - The reporting component and, if any, the eventbus event
934
+ * it was handling
935
+ */
936
+ reportError?(error: unknown, context: IEventbusErrorReport): void;
937
+ registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover;
938
+ registerInterceptor(eventName: string, interceptor: IEventbusInterceptor, eventTopic?: string): TEventbusRemover;
939
+ }
940
+ interface IEventbusListener {
941
+ /**
942
+ * Called for every broadcast event.
943
+ *
944
+ * May return a promise; the Eventbus does not await it, but reports a
945
+ * rejection the same way as a thrown error.
946
+ */
947
+ handleEvent(eventName: string, eventTopic: string | undefined, args: any[]): void | Promise<unknown>;
948
+ }
949
+ interface IEventbusInterceptor {
950
+ intercept(eventArgs: any[]): any[];
951
+ }
952
+ //#endregion
657
953
  //#region src/controllers/types.d.ts
658
954
  interface IController<T extends TOperationData> {
659
955
  name: string;
@@ -661,6 +957,147 @@ interface IController<T extends TOperationData> {
661
957
  attach(eventbus: IEventbus): Promise<any> | void;
662
958
  detach(eventbus: IEventbus): void;
663
959
  }
960
+ /** A start and end frame. Mirrors lottie-web's `AnimationSegment`. */
961
+ type TLottieAnimationSegment = [number, number];
962
+ /** Playback direction: forward or backward. Mirrors lottie-web's `AnimationDirection`. */
963
+ type TLottieAnimationDirection = 1 | -1;
964
+ /** The events a lottie animation emits. Mirrors lottie-web's `AnimationEventName`. */
965
+ type TLottieAnimationEventName = 'drawnFrame' | 'enterFrame' | 'loopComplete' | 'complete' | 'segmentStart' | 'destroy' | 'config_ready' | 'data_ready' | 'DOMLoaded' | 'error' | 'data_failed' | 'loaded_images';
966
+ /** Mirrors lottie-web's `AnimationEventCallback`. */
967
+ type TLottieAnimationEventCallback<T = any> = (args: T) => void;
968
+ /** Payload of the `complete` event. Mirrors lottie-web's `BMCompleteEvent`. */
969
+ interface ILottieCompleteEvent {
970
+ direction: number;
971
+ type: 'complete';
972
+ }
973
+ /** Payload of the `loopComplete` event. Mirrors lottie-web's `BMCompleteLoopEvent`. */
974
+ interface ILottieCompleteLoopEvent {
975
+ currentLoop: number;
976
+ direction: number;
977
+ totalLoops: number;
978
+ type: 'loopComplete';
979
+ }
980
+ /** Payload of the `destroy` event. Mirrors lottie-web's `BMDestroyEvent`. */
981
+ interface ILottieDestroyEvent {
982
+ type: 'destroy';
983
+ }
984
+ /** Payload of the `enterFrame` and `drawnFrame` events. Mirrors lottie-web's `BMEnterFrameEvent`. */
985
+ interface ILottieEnterFrameEvent {
986
+ /** The current time in frames. */
987
+ currentTime: number;
988
+ direction: number;
989
+ /** The total number of frames. */
990
+ totalTime: number;
991
+ type: 'enterFrame';
992
+ }
993
+ /** Payload of the `segmentStart` event. Mirrors lottie-web's `BMSegmentStartEvent`. */
994
+ interface ILottieSegmentStartEvent {
995
+ firstFrame: number;
996
+ totalFrames: number;
997
+ type: 'segmentStart';
998
+ }
999
+ /** The payload of each lottie animation event. Mirrors lottie-web's `AnimationEvents`. */
1000
+ interface ILottieAnimationEvents {
1001
+ DOMLoaded: undefined;
1002
+ complete: ILottieCompleteEvent;
1003
+ config_ready: undefined;
1004
+ data_failed: undefined;
1005
+ data_ready: undefined;
1006
+ destroy: ILottieDestroyEvent;
1007
+ drawnFrame: ILottieEnterFrameEvent;
1008
+ enterFrame: ILottieEnterFrameEvent;
1009
+ error: undefined;
1010
+ loaded_images: undefined;
1011
+ loopComplete: ILottieCompleteLoopEvent;
1012
+ segmentStart: ILottieSegmentStartEvent;
1013
+ }
1014
+ /**
1015
+ * A loaded lottie animation, as created by `LottieController`. Mirrors
1016
+ * lottie-web's `AnimationItem`.
1017
+ */
1018
+ interface ILottieAnimationItem {
1019
+ name: string;
1020
+ isLoaded: boolean;
1021
+ currentFrame: number;
1022
+ currentRawFrame: number;
1023
+ firstFrame: number;
1024
+ totalFrames: number;
1025
+ frameRate: number;
1026
+ frameMult: number;
1027
+ playSpeed: number;
1028
+ playDirection: number;
1029
+ playCount: number;
1030
+ isPaused: boolean;
1031
+ autoplay: boolean;
1032
+ loop: boolean | number;
1033
+ renderer: any;
1034
+ animationID: string;
1035
+ assetsPath: string;
1036
+ timeCompleted: number;
1037
+ segmentPos: number;
1038
+ isSubframeEnabled: boolean;
1039
+ segments: TLottieAnimationSegment | TLottieAnimationSegment[];
1040
+ play(name?: string): void;
1041
+ stop(name?: string): void;
1042
+ togglePause(name?: string): void;
1043
+ destroy(name?: string): void;
1044
+ pause(name?: string): void;
1045
+ goToAndStop(value: number | string, isFrame?: boolean, name?: string): void;
1046
+ goToAndPlay(value: number | string, isFrame?: boolean, name?: string): void;
1047
+ includeLayers(data: any): void;
1048
+ setSegment(init: number, end: number): void;
1049
+ resetSegments(forceFlag: boolean): void;
1050
+ hide(): void;
1051
+ show(): void;
1052
+ resize(width?: number, height?: number): void;
1053
+ setSpeed(speed: number): void;
1054
+ setDirection(direction: TLottieAnimationDirection): void;
1055
+ setLoop(isLooping: boolean): void;
1056
+ playSegments(segments: TLottieAnimationSegment | TLottieAnimationSegment[], forceFlag?: boolean): void;
1057
+ setSubframe(useSubFrames: boolean): void;
1058
+ getDuration(inFrames?: boolean): number;
1059
+ triggerEvent<T extends TLottieAnimationEventName>(name: T, args: ILottieAnimationEvents[T]): void;
1060
+ addEventListener<T extends TLottieAnimationEventName>(name: T, callback: TLottieAnimationEventCallback<ILottieAnimationEvents[T]>): () => void;
1061
+ removeEventListener<T extends TLottieAnimationEventName>(name: T, callback?: TLottieAnimationEventCallback<ILottieAnimationEvents[T]>): void;
1062
+ }
1063
+ /** Mirrors lottie-web's `FilterSizeConfig`. */
1064
+ interface ILottieFilterSizeConfig {
1065
+ width: string;
1066
+ height: string;
1067
+ x: string;
1068
+ y: string;
1069
+ }
1070
+ /** Settings shared by all renderers. Mirrors lottie-web's `BaseRendererConfig`. */
1071
+ interface ILottieBaseRendererConfig {
1072
+ imagePreserveAspectRatio?: string;
1073
+ className?: string;
1074
+ }
1075
+ /** SVG renderer settings. Mirrors lottie-web's `SVGRendererConfig`. */
1076
+ interface ILottieSVGRendererConfig extends ILottieBaseRendererConfig {
1077
+ title?: string;
1078
+ description?: string;
1079
+ preserveAspectRatio?: string;
1080
+ progressiveLoad?: boolean;
1081
+ hideOnTransparent?: boolean;
1082
+ viewBoxOnly?: boolean;
1083
+ viewBoxSize?: string;
1084
+ focusable?: boolean;
1085
+ filterSize?: ILottieFilterSizeConfig;
1086
+ }
1087
+ /** Canvas renderer settings. Mirrors lottie-web's `CanvasRendererConfig`. */
1088
+ interface ILottieCanvasRendererConfig extends ILottieBaseRendererConfig {
1089
+ clearCanvas?: boolean;
1090
+ context?: CanvasRenderingContext2D;
1091
+ progressiveLoad?: boolean;
1092
+ preserveAspectRatio?: string;
1093
+ dpr?: number;
1094
+ }
1095
+ /** HTML renderer settings. Mirrors lottie-web's `HTMLRendererConfig`. */
1096
+ interface ILottieHTMLRendererConfig extends ILottieBaseRendererConfig {
1097
+ hideOnTransparent?: boolean;
1098
+ }
1099
+ /** The renderer settings a `LottieController` accepts. */
1100
+ type TLottieRendererConfig = ILottieSVGRendererConfig | ILottieCanvasRendererConfig | ILottieHTMLRendererConfig;
664
1101
  //#endregion
665
1102
  //#region src/controllers/base-controller.d.ts
666
1103
  /**
@@ -669,8 +1106,9 @@ interface IController<T extends TOperationData> {
669
1106
  * Benefits:
670
1107
  * - Eliminates boilerplate event listener tracking code
671
1108
  * - Automatic binding of event handlers to controller instance
1109
+ * - Handler arguments are type checked against the event's argument tuple
672
1110
  * - Centralized cleanup preventing memory leaks
673
- * - Consistent event management pattern across all controllers
1111
+ * - An attached-state guard, so a second attach never duplicates listeners
674
1112
  *
675
1113
  * @example
676
1114
  * ```typescript
@@ -682,11 +1120,12 @@ interface IController<T extends TOperationData> {
682
1120
  * }
683
1121
  *
684
1122
  * attach(eventbus: IEventbus): void {
685
- * this.addListener(eventbus, 'my-event', this.handleMyEvent);
1123
+ * this.beginAttach(eventbus);
1124
+ * this.addListener(eventbus, 'timeline-time', this.handleTime);
686
1125
  * // Handler automatically bound, cleanup tracked
687
1126
  * }
688
1127
  *
689
- * private handleMyEvent(): void {
1128
+ * private handleTime(position: number): void {
690
1129
  * // 'this' context preserved
691
1130
  * }
692
1131
  * }
@@ -696,24 +1135,25 @@ declare abstract class BaseController<T extends TOperationData> implements ICont
696
1135
  operationData: T | null;
697
1136
  abstract name: string;
698
1137
  protected eventListeners: TEventbusRemover[];
1138
+ /** True between {@link BaseController.beginAttach} and the next detach. */
1139
+ protected isAttached: boolean;
699
1140
  /**
700
1141
  * Register event listener with automatic binding and cleanup tracking
701
1142
  *
702
1143
  * @param eventbus - The eventbus to register with
703
1144
  * @param eventName - Name of the event to listen for
704
- * @param handler - Event handler function (will be bound to this controller)
1145
+ * @param handler - Event handler function (will be bound to this controller).
1146
+ * Its parameters must match the event's argument tuple.
705
1147
  */
706
- protected addListener(eventbus: IEventbus, eventName: EventName, handler: (...args: any[]) => void): void;
1148
+ protected addListener<E extends EventName>(eventbus: IEventbus, eventName: E, handler: (this: this, ...args: EventMap[E]) => void): void;
707
1149
  /**
708
- * Register multiple event listeners at once
1150
+ * Call at the start of `attach`. When the controller is still attached, it
1151
+ * is detached first, so attaching twice replaces the previous attachment
1152
+ * instead of registering every listener (and any DOM it builds) twice.
709
1153
  *
710
- * @param eventbus - The eventbus to register with
711
- * @param listeners - Array of {eventName, handler} pairs
1154
+ * @param eventbus - The eventbus passed to `attach`
712
1155
  */
713
- protected attachMultiple(eventbus: IEventbus, listeners: Array<{
714
- eventName: string;
715
- handler: (...args: any[]) => void;
716
- }>): void;
1156
+ protected beginAttach(eventbus: IEventbus): void;
717
1157
  /**
718
1158
  * Clean up all tracked event listeners
719
1159
  * Prevents memory leaks by removing all registered handlers
@@ -739,8 +1179,12 @@ interface ILabelControllerMetadata {
739
1179
  translationKey: string;
740
1180
  /**
741
1181
  * By default the label is added to the inner HTML of the `selectedElement`,
742
- * otherwise if this property is set, the label text is added to the specified attribute
743
- * of the `selectedElement`.
1182
+ * after sanitizing: inline formatting such as `<br>`, `<strong>`, `<em>`
1183
+ * and links is kept, scripts, event handlers and other markup are removed.
1184
+ * If this property is set, the label is written as plain text to the
1185
+ * specified attribute of the `selectedElement` instead. Event handler
1186
+ * attributes (`on*`) and `srcdoc` are rejected, and URL attributes such as
1187
+ * `href` and `src` are only set when the translation is a safe URL.
744
1188
  */
745
1189
  attributeName?: string;
746
1190
  }
@@ -748,6 +1192,11 @@ interface ILabelControllerMetadata {
748
1192
  * This controller attaches to the given selected element and renders the text
749
1193
  * associated with the given translation key.
750
1194
  *
1195
+ * Translations may contain simple inline markup. They are passed through
1196
+ * `sanitizeHtml` before insertion, so `<br>`, `<strong>`, `<em>`,
1197
+ * `<span>` and http(s)/mailto/relative links render, while scripts, event
1198
+ * handlers, `javascript:` URLs, images, iframes and SVG are removed.
1199
+ *
751
1200
  * The controller listens for the `language-change` event and re-renders the text
752
1201
  * with the new language after such an event.
753
1202
  *
@@ -756,6 +1205,10 @@ interface ILabelControllerMetadata {
756
1205
  declare class LabelController$1 extends BaseController<ILabelControllerMetadata> {
757
1206
  name: string;
758
1207
  private _eventbus;
1208
+ /**
1209
+ * @throws Error when `attributeName` is an event handler attribute
1210
+ * (`on*`) or `srcdoc`.
1211
+ */
759
1212
  init(operationData: ILabelControllerMetadata): void;
760
1213
  /**
761
1214
  * Sets the translation key and re-renders the label.
@@ -777,15 +1230,18 @@ interface IInnerMetadata {
777
1230
  /**
778
1231
  * @type=ParameterType:string
779
1232
  */
780
- renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;
1233
+ renderer: TLottieRendererConfig;
781
1234
  loop: boolean;
782
1235
  autoplay: boolean;
783
1236
  /**
784
- * ParameterType:object
1237
+ * The lottie animation data. Give either this or `json`; `json` wins when
1238
+ * both are set.
1239
+ *
1240
+ * @type=ParameterType:object
785
1241
  */
786
1242
  animationData: any;
787
1243
  /**
788
- * @required
1244
+ * The lottie animation data. Give either this or `animationData`.
789
1245
  */
790
1246
  json: any;
791
1247
  /**
@@ -794,39 +1250,97 @@ interface IInnerMetadata {
794
1250
  */
795
1251
  labelIds: string[];
796
1252
  viewBox: string;
1253
+ /**
1254
+ * @deprecated Ignored: the fallback targeted Internet Explorer and legacy
1255
+ * Edge, which are no longer supported. Will be removed in the next major
1256
+ * version.
1257
+ */
797
1258
  iefallback: any;
798
1259
  }
799
1260
  interface ILottieControllerMetadata extends IInnerMetadata {
800
1261
  /**
1262
+ * The animation file name. It is not loaded; it is only read for freeze and
1263
+ * end markers, like `my-url/filename[freeze=10,end=21].json`.
1264
+ *
801
1265
  * @type=ParameterType:url
802
- * @required
803
1266
  */
804
- url: string;
1267
+ url?: string;
805
1268
  }
806
1269
  /**
807
1270
  * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.
808
1271
  *
809
1272
  * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json
810
1273
  *
1274
+ * lottie-web is an optional peer dependency. It is loaded with a dynamic
1275
+ * `import()` the first time a LottieController attaches, so applications that
1276
+ * never use this controller do not need it installed.
811
1277
  */
812
1278
  declare class LottieController$1 extends BaseController<ILottieControllerMetadata> {
813
1279
  name: string;
814
1280
  currentLanguage: TLanguageCode;
1281
+ /**
1282
+ * @deprecated Label collections come from a `request-label-collections`
1283
+ * responder, which nothing in Eligius provides since the labels array was
1284
+ * removed in 2.2.0. Use translation keys as label ids instead; they resolve
1285
+ * through `request-translation`. Will be removed in the next major version.
1286
+ */
815
1287
  labelData: Record<string, Record<string, string>>;
816
- animationItem: AnimationItem | null;
1288
+ animationItem: ILottieAnimationItem | null;
817
1289
  serializedData: string | null;
1290
+ /**
1291
+ * @deprecated Never used: see `iefallback`. Will be removed in the next
1292
+ * major version.
1293
+ */
818
1294
  serializedIEData: string | null;
819
1295
  freezePosition: number;
820
1296
  endPosition: number;
1297
+ private _eventbus;
1298
+ private _lottie;
1299
+ /** Incremented by detach() so an attach still loading lottie-web gives up */
1300
+ private _attachGeneration;
1301
+ /**
1302
+ * @throws when neither `json` nor `animationData` is given
1303
+ */
821
1304
  init(operationData: ILottieControllerMetadata): void;
822
1305
  private _parseFilename;
823
- attach(eventbus: IEventbus): void;
1306
+ /**
1307
+ * Loads lottie-web (on first use), registers the language listener when
1308
+ * label ids are configured and creates the animation.
1309
+ *
1310
+ * If detach() is called before lottie-web has loaded, the attach is
1311
+ * abandoned: no listeners are registered and no animation is created.
1312
+ *
1313
+ * @param eventbus - The eventbus to request labels and language from
1314
+ * @returns a promise that resolves once the animation has been created
1315
+ * @throws when the optional peer dependency lottie-web cannot be loaded
1316
+ */
1317
+ attach(eventbus: IEventbus): Promise<void>;
1318
+ /**
1319
+ * Removes the listeners and releases the lottie animation.
1320
+ *
1321
+ * When the url configured a freeze position and the animation does not loop,
1322
+ * the animation first plays out from the freeze position to the end position
1323
+ * (or its natural end) and is destroyed when it completes. Otherwise it is
1324
+ * destroyed immediately, since a looping animation never completes.
1325
+ */
824
1326
  detach(eventbus: IEventbus): void;
825
- private _destroy;
826
1327
  private _createAnimation;
827
1328
  private _createTextDataLookup;
1329
+ /**
1330
+ * Resolves the text for a label id in the current language. Label collections
1331
+ * take precedence; otherwise the label id is looked up as a translation key
1332
+ * through the locale manager (`request-translation`).
1333
+ *
1334
+ * @returns the text, or undefined when no text is available
1335
+ */
1336
+ private _resolveLabel;
1337
+ /**
1338
+ * Rebuilds the animation with the texts of the new language and moves it to
1339
+ * the frame the old one was at, playing or paused as before, so a language
1340
+ * switch does not restart it. Frames are counted from the start of the
1341
+ * current segment, which for the freeze segment is frame 0.
1342
+ */
828
1343
  private _handleLanguageChange;
829
- private _isIE;
830
1344
  }
831
1345
  //#endregion
832
1346
  //#region src/controllers/mutation-observer-controller.d.ts
@@ -942,11 +1456,15 @@ declare class MutationObserverController$1 extends BaseController<IMutationObser
942
1456
  * Initialize the controller with configuration metadata.
943
1457
  *
944
1458
  * @param operationData - Configuration for observation behavior
1459
+ * @throws when the options would make `MutationObserver.observe` throw:
1460
+ * nothing to observe, or an attribute or character data option without the
1461
+ * matching observe flag
945
1462
  */
946
1463
  init(operationData: IMutationObserverControllerMetadata): void;
947
1464
  /**
948
1465
  * Attach the controller and start observing mutations.
949
1466
  * Creates MutationObserver instance and begins monitoring the target element.
1467
+ * Attaching again replaces the previous observer.
950
1468
  *
951
1469
  * @param eventbus - Eligius eventbus for broadcasting mutation events
952
1470
  */
@@ -960,9 +1478,11 @@ declare class MutationObserverController$1 extends BaseController<IMutationObser
960
1478
  detach(eventbus: IEventbus): void;
961
1479
  /**
962
1480
  * Build MutationObserverInit options from controller metadata.
963
- * Applies default values for optional configuration properties.
1481
+ * Applies default values for optional configuration properties, and leaves
1482
+ * out `attributeFilter` when it is not configured.
964
1483
  *
965
1484
  * @returns MutationObserverInit options object
1485
+ * @throws when the combination of options is invalid
966
1486
  * @private
967
1487
  */
968
1488
  private _buildObserverOptions;
@@ -985,10 +1505,31 @@ interface INavigationControllerOperationData {
985
1505
  */
986
1506
  selectedElement: JQuery;
987
1507
  /**
1508
+ * The navigation json: `{navigationData: [...], roots: [...]}`. Each entry
1509
+ * has an `id`, a `labelId`, a `videoUrlIndex` and optionally `visible`,
1510
+ * `children` (ids), `nextId`, `autoNext` and `timelineUri`. Give an entry a
1511
+ * `timelineUri` to let the engine switch to that timeline when the entry is
1512
+ * activated.
1513
+ *
988
1514
  * @required
989
1515
  */
990
1516
  json: any;
991
1517
  }
1518
+ /**
1519
+ * Renders a navigation menu in the selected element and keeps it in sync with
1520
+ * the active navigation entry.
1521
+ *
1522
+ * Activating a menu item (click, Enter or Space) navigates to its entry:
1523
+ * - an entry with a `timelineUri` broadcasts `request-timeline-uri`
1524
+ * [timelineUri, position], which the engine handles by switching timelines;
1525
+ * - an entry without one broadcasts the legacy `request-video-url`
1526
+ * [videoUrlIndex, position], which the engine does not handle.
1527
+ *
1528
+ * With `autoNext`, the next entry is started when the active entry's timeline
1529
+ * completes (`timeline-complete`) or, for legacy entries, on `video-complete`.
1530
+ * When the engine switches to a timeline that an entry names
1531
+ * (`timeline-current-timeline-change`), that entry becomes the active one.
1532
+ */
992
1533
  declare class NavigationController$1 extends BaseController<INavigationControllerOperationData> {
993
1534
  name: string;
994
1535
  navigation: any[];
@@ -999,22 +1540,64 @@ declare class NavigationController$1 extends BaseController<INavigationControlle
999
1540
  labelControllers: LabelController$1[];
1000
1541
  eventbus: IEventbus | null;
1001
1542
  container: JQuery | null;
1002
- init(operationData: TOperationData): void;
1543
+ private _menuElement;
1544
+ private _anchorLookup;
1545
+ private _highlightedAnchor;
1546
+ private _navByTimelineUri;
1547
+ /**
1548
+ * @throws when the json has no navigationData array or names an unknown
1549
+ * navigation id in roots, nextId or children
1550
+ */
1551
+ init(operationData: INavigationControllerOperationData): void;
1003
1552
  attach(eventbus: IEventbus): void;
1553
+ /**
1554
+ * Sets the active navigation point and the menu highlight from the URL hash,
1555
+ * falling back to the item with videoUrlIndex 0 when the hash is missing or
1556
+ * names an unknown navigation id.
1557
+ */
1004
1558
  private _initHistory;
1005
1559
  private _getQueryVariable;
1006
1560
  private _handleRequestCurrentNavigation;
1007
1561
  detach(eventbus: IEventbus): void;
1008
1562
  private _pushCurrentState;
1009
1563
  private _buildHtml;
1564
+ /**
1565
+ * Renders an entry and its children. `ancestors` holds the entries on the
1566
+ * current path, so a children list that refers back to an ancestor cannot
1567
+ * recurse forever.
1568
+ */
1010
1569
  private _addNavElement;
1011
- private _addClickHandler;
1012
- private _menuMouseupHandler;
1570
+ /**
1571
+ * Activates the entry on click, which the browser also fires for Enter on a
1572
+ * focused link and for the default action of assistive technology, and on
1573
+ * Space, which links do not handle natively. Only one of click and mouseup
1574
+ * may be bound, since a mouse click fires both.
1575
+ */
1576
+ private _addActivationHandlers;
1013
1577
  private _handleNavigateVideoUrl;
1578
+ /**
1579
+ * Highlights the entry, requests its content, makes it the active entry and
1580
+ * pushes a history state for it.
1581
+ */
1582
+ private _navigateTo;
1014
1583
  private _highlightMenu;
1584
+ private _highlightNav;
1585
+ /**
1586
+ * Legacy completion event for entries driven by `request-video-url`.
1587
+ */
1015
1588
  private _handleVideoComplete;
1589
+ /**
1590
+ * Starts the next entry when the active entry's timeline completes. Legacy
1591
+ * entries without a `timelineUri` are left to `video-complete`, so a host
1592
+ * that bridges both events does not navigate twice.
1593
+ */
1594
+ private _handleTimelineComplete;
1595
+ /**
1596
+ * Keeps the active entry and the highlight in sync when the engine switches
1597
+ * timelines, whoever asked for the switch.
1598
+ */
1599
+ private _handleTimelineChange;
1016
1600
  private _addLabel;
1017
- private _buildNavigationData;
1018
1601
  }
1019
1602
  //#endregion
1020
1603
  //#region src/controllers/progressbar-controller.d.ts
@@ -1038,9 +1621,24 @@ declare class ProgressbarController$1 extends BaseController<IProgressbarControl
1038
1621
  selectedElement: JQuery | null;
1039
1622
  textElement: JQuery | null;
1040
1623
  duration: number;
1041
- init(operationData: TOperationData): void;
1624
+ private _eventbus;
1625
+ /** The inline pointer-events value attach() replaced, restored on detach */
1626
+ private _previousPointerEvents;
1627
+ /** The last width and text written, so unchanged values are not rewritten */
1628
+ private _renderedWidth;
1629
+ private _renderedText;
1630
+ init(operationData: IProgressbarControllerOperationData): void;
1042
1631
  attach(eventbus: IEventbus): void;
1043
1632
  detach(eventbus: IEventbus): void;
1633
+ /**
1634
+ * Requests the duration of the active timeline.
1635
+ */
1636
+ private _refreshDuration;
1637
+ /**
1638
+ * Stores the duration the engine reports when a timeline starts, which
1639
+ * changes when the engine switches timelines.
1640
+ */
1641
+ private _durationHandler;
1044
1642
  private _positionUpdateHandler;
1045
1643
  private _clickHandler;
1046
1644
  }
@@ -1048,11 +1646,24 @@ declare class ProgressbarController$1 extends BaseController<IProgressbarControl
1048
1646
  //#region src/controllers/routing-controller.d.ts
1049
1647
  interface IRoutingControllerOperationData {
1050
1648
  /**
1649
+ * The navigation json, in the same format as NavigationController's. Give
1650
+ * an entry a `timelineUri` to let the engine switch to that timeline on
1651
+ * back/forward navigation.
1652
+ *
1051
1653
  * @required
1052
1654
  */
1053
1655
  json: any;
1054
1656
  }
1055
1657
  /**
1658
+ * Keeps the browser history in sync with the navigation entries: each entry
1659
+ * gets a `#/<id>/<position>` URL, and back/forward navigation requests the
1660
+ * entry in the URL.
1661
+ *
1662
+ * Requests go to the engine as `request-timeline-uri` for entries with a
1663
+ * `timelineUri`, and as the legacy `request-video-url` otherwise. Before the
1664
+ * engine switches timelines (`before-request-timeline-uri`, or the legacy
1665
+ * `before-request-video-url`), the current entry is saved with its position.
1666
+ *
1056
1667
  * This is a work in progress, do not use this yet please....
1057
1668
  */
1058
1669
  declare class RoutingController$1 extends BaseController<IRoutingControllerOperationData> {
@@ -1061,15 +1672,54 @@ declare class RoutingController$1 extends BaseController<IRoutingControllerOpera
1061
1672
  navVidIdLookup: Record<string, any>;
1062
1673
  navigation: any;
1063
1674
  eventbus: IEventbus | null;
1064
- init(operationData: TOperationData): void;
1675
+ private _popstateHandler;
1676
+ /** True while this controller requests an entry from the history */
1677
+ private _isHistoryRequest;
1678
+ /**
1679
+ * @throws when the json has no navigationData array or names an unknown
1680
+ * navigation id in roots, nextId or children
1681
+ */
1682
+ init(operationData: IRoutingControllerOperationData): void;
1065
1683
  attach(eventbus: IEventbus): void;
1684
+ /**
1685
+ * Requests the entry in the URL. A null state comes from a hash change (an
1686
+ * in-page link, an edited URL, or the entry before this controller added
1687
+ * state), so the URL is read. A state object without a navigation id belongs
1688
+ * to the host page and is ignored.
1689
+ */
1066
1690
  private _handlePopstate;
1691
+ /**
1692
+ * Requests an entry without saving the current one: the history already
1693
+ * has it.
1694
+ */
1695
+ private _requestFromHistory;
1696
+ /**
1697
+ * Looks up a navigation entry by id (own properties only), falling back to
1698
+ * the first navigation entry for a missing or unknown id.
1699
+ */
1700
+ private _findNavigation;
1701
+ /**
1702
+ * @returns the position as a finite, non-negative number, or 0
1703
+ */
1704
+ private _parsePosition;
1067
1705
  detach(eventbus: IEventbus): void;
1068
1706
  private _handleBeforeRequestVideoUrl;
1707
+ /**
1708
+ * The interceptor passes on the `request-timeline-uri` arguments, which
1709
+ * have no history flag; requests this controller makes itself are skipped
1710
+ * through `_isHistoryRequest`.
1711
+ */
1712
+ private _handleBeforeRequestTimelineUri;
1713
+ private _saveCurrentNavigation;
1069
1714
  private _getQueryVariable;
1070
1715
  private _handlePushHistoryState;
1071
1716
  private _pushState;
1072
- private _buildNavigationData;
1717
+ /**
1718
+ * A missing or negative position means "where the timeline is now": the
1719
+ * engine position minus a short rewind. When nothing reports a position,
1720
+ * the position is left out of the URL and the state.
1721
+ */
1722
+ private _resolveStatePosition;
1073
1723
  }
1074
1724
  //#endregion
1075
1725
  //#region src/controllers/subtitles-controller.d.ts
@@ -1079,29 +1729,93 @@ interface ISubtitlesControllerOperationData {
1079
1729
  */
1080
1730
  selectedElement: JQuery;
1081
1731
  /**
1732
+ * The language to fall back to when the eventbus cannot tell the current
1733
+ * language (`request-current-language`).
1734
+ *
1082
1735
  * @type=ParameterType:languagecode
1083
1736
  */
1084
1737
  language: TLanguageCode;
1085
1738
  /**
1739
+ * One collection per language. Titles are matched by index across the
1740
+ * languages, so every collection needs the same number of titles.
1741
+ *
1086
1742
  * @type=ParameterType:array
1087
1743
  * @itemType=ParameterType:object
1088
1744
  */
1089
1745
  subtitleData: ISubtitleCollection[];
1090
1746
  }
1747
+ /**
1748
+ * This controller shows the subtitle whose duration contains the current
1749
+ * timeline position in the selected element, in the current language, and
1750
+ * re-renders it after a `language-change` event.
1751
+ *
1752
+ * The starting language is the locale's current language
1753
+ * (`request-current-language`); the configured `language` is only used when
1754
+ * nothing answers that request.
1755
+ *
1756
+ * Subtitle texts may contain simple inline markup. They are passed through
1757
+ * `sanitizeHtml` before insertion, so `<br>`, `<i>`, `<em>`,
1758
+ * `<strong>` and `<span>` render, while scripts, event handlers,
1759
+ * `javascript:` URLs, images, iframes and SVG are removed.
1760
+ */
1091
1761
  declare class SubtitlesController$1 extends BaseController<ISubtitlesControllerOperationData> {
1762
+ /**
1763
+ * @deprecated Subtitles are looked up by range, not by exact position; this
1764
+ * lookup is no longer read and will be removed in the next major version.
1765
+ */
1092
1766
  actionLookup: Record<string, any>;
1093
1767
  currentLanguage: TLanguageCode | null;
1094
1768
  lastFunc: (() => void) | null;
1095
1769
  name: string;
1770
+ /**
1771
+ * @deprecated No longer read; will be removed in the next major version.
1772
+ */
1096
1773
  subtitleDurations: IStrictDuration[] | null;
1774
+ private _titleRanges;
1775
+ /** True when no two ranges overlap, so the ranges are sorted by start */
1776
+ private _rangesDisjoint;
1777
+ /** Index of the last range a position was found in (or just after) */
1778
+ private _lastRangeIndex;
1779
+ private _configuredLanguage;
1097
1780
  attach(eventbus: IEventbus): void;
1781
+ /**
1782
+ * Stops listening and removes the subtitle this controller is showing, since
1783
+ * no later time event would remove it.
1784
+ */
1098
1785
  detach(eventbus: IEventbus): void;
1099
1786
  languageChangeHandler(newLanguage: TLanguageCode): void;
1100
1787
  removeTitle(container?: JQuery): void;
1788
+ /**
1789
+ * Shows the subtitle whose range contains the given position, or removes the
1790
+ * current subtitle when no range contains it.
1791
+ *
1792
+ * Positions arrive as fractional seconds, so the lookup is range based
1793
+ * (`start <= position < end`) rather than an exact key match.
1794
+ */
1101
1795
  onTimeHandler(position: number): void;
1102
1796
  onSeekedHandler(position: number, _duration: number): void;
1797
+ /**
1798
+ * Playback almost always stays in the last range, moves into the gap after
1799
+ * it or into the next range, so those are checked first; other positions
1800
+ * (after a seek) are found with a binary search. Overlapping ranges fall
1801
+ * back to a linear search in configuration order, where the first range
1802
+ * containing the position wins.
1803
+ */
1804
+ private _findTitleFunc;
1103
1805
  setTitle(container: JQuery, titleLanguageLookup: Record<string, string>): void;
1806
+ /**
1807
+ * Builds the subtitle ranges. Missing or empty subtitle data means there are
1808
+ * no subtitles.
1809
+ *
1810
+ * @returns the deprecated position lookup
1811
+ * @throws when a subtitle collection has no titles array, or a different
1812
+ * number of titles than the first collection
1813
+ */
1104
1814
  createActionLookup(operationData: ISubtitlesControllerOperationData, container: JQuery): Record<number, () => void>;
1815
+ private _validateSubtitleData;
1816
+ /**
1817
+ * @throws when the subtitle data is ragged (see createActionLookup)
1818
+ */
1105
1819
  init(operationData: ISubtitlesControllerOperationData): void;
1106
1820
  }
1107
1821
  declare namespace index_d_exports$3 {
@@ -1148,7 +1862,7 @@ interface IAddGlobalsToOperationData {
1148
1862
  //#region src/operation/animate.d.ts
1149
1863
  interface IAnimateOperationData {
1150
1864
  /**
1151
- * @type=ParameterType:boolean
1865
+ * @type=ParameterType:string
1152
1866
  * @erased
1153
1867
  */
1154
1868
  animationEasing?: string;
@@ -1178,9 +1892,23 @@ interface IAnimateWithClassOperationData {
1178
1892
  /**
1179
1893
  * @type=ParameterType:className
1180
1894
  * @required
1895
+ * @erased
1181
1896
  */
1182
1897
  className: string;
1898
+ /**
1899
+ * When true (the default), the class is removed again after the animation ends
1900
+ *
1901
+ * @erased
1902
+ */
1183
1903
  removeClass?: boolean;
1904
+ /**
1905
+ * When true, the operation resolves on the first `animationend` event from the selected
1906
+ * element or any of its descendants. Use this for a class that only animates descendants.
1907
+ * When false (the default), only animations on the selected elements themselves are awaited.
1908
+ *
1909
+ * @erased
1910
+ */
1911
+ includeDescendants?: boolean;
1184
1912
  }
1185
1913
  //#endregion
1186
1914
  //#region src/operation/announce-to-screen-reader.d.ts
@@ -1291,19 +2019,19 @@ interface ICompareDateOperationData {
1291
2019
  /**
1292
2020
  * @output
1293
2021
  */
1294
- comparison: number;
2022
+ comparison?: number;
1295
2023
  /**
1296
2024
  * @output
1297
2025
  */
1298
- isEqual: boolean;
2026
+ isEqual?: boolean;
1299
2027
  /**
1300
2028
  * @output
1301
2029
  */
1302
- isBefore: boolean;
2030
+ isBefore?: boolean;
1303
2031
  /**
1304
2032
  * @output
1305
2033
  */
1306
- isAfter: boolean;
2034
+ isAfter?: boolean;
1307
2035
  }
1308
2036
  //#endregion
1309
2037
  //#region src/operation/concatenate-strings.d.ts
@@ -1321,7 +2049,7 @@ interface IConcatenateStringsOperationData {
1321
2049
  /**
1322
2050
  * @output
1323
2051
  */
1324
- result: string;
2052
+ result?: string;
1325
2053
  }
1326
2054
  //#endregion
1327
2055
  //#region src/operation/create-element.d.ts
@@ -1366,10 +2094,10 @@ interface IEndActionOperationData {
1366
2094
  */
1367
2095
  actionInstance: IEndableAction;
1368
2096
  /**
1369
- * @required
2097
+ * @type=ParameterType:object
1370
2098
  * @erased
1371
2099
  */
1372
- actionOperationData: Record<string, unknown>;
2100
+ actionOperationData?: Record<string, unknown>;
1373
2101
  }
1374
2102
  //#endregion
1375
2103
  //#region src/operation/extend-controller.d.ts
@@ -1391,7 +2119,6 @@ interface IExtendControllerOperationData {
1391
2119
  //#region src/operation/filter-array.d.ts
1392
2120
  interface IFilterArrayOperationData {
1393
2121
  /**
1394
- * @required
1395
2122
  * @dependency
1396
2123
  */
1397
2124
  arrayData: any[];
@@ -1413,13 +2140,12 @@ interface IFilterArrayOperationData {
1413
2140
  /**
1414
2141
  * @output
1415
2142
  */
1416
- filteredArray: any[];
2143
+ filteredArray?: any[];
1417
2144
  }
1418
2145
  //#endregion
1419
2146
  //#region src/operation/find-in-array.d.ts
1420
2147
  interface IFindInArrayOperationData {
1421
2148
  /**
1422
- * @required
1423
2149
  * @dependency
1424
2150
  */
1425
2151
  arrayData: any[];
@@ -1441,11 +2167,11 @@ interface IFindInArrayOperationData {
1441
2167
  /**
1442
2168
  * @output
1443
2169
  */
1444
- foundItem: any | undefined;
2170
+ foundItem?: any | undefined;
1445
2171
  /**
1446
2172
  * @output
1447
2173
  */
1448
- foundIndex: number;
2174
+ foundIndex?: number;
1449
2175
  }
1450
2176
  //#endregion
1451
2177
  //#region src/operation/for-each.d.ts
@@ -1460,7 +2186,6 @@ interface IForEachOperationData {
1460
2186
  //#region src/operation/format-date.d.ts
1461
2187
  interface IFormatDateOperationData {
1462
2188
  /**
1463
- * @required
1464
2189
  * @dependency
1465
2190
  */
1466
2191
  date: Date | string | number;
@@ -1472,14 +2197,13 @@ interface IFormatDateOperationData {
1472
2197
  /**
1473
2198
  * @output
1474
2199
  */
1475
- formattedDate: string;
2200
+ formattedDate?: string;
1476
2201
  }
1477
2202
  //#endregion
1478
2203
  //#region src/operation/format-text.d.ts
1479
2204
  type TextTransformation = 'uppercase' | 'lowercase' | 'capitalize' | 'titlecase' | 'trim';
1480
2205
  interface IFormatTextOperationData {
1481
2206
  /**
1482
- * @required
1483
2207
  * @dependency
1484
2208
  */
1485
2209
  textContent: string;
@@ -1491,7 +2215,7 @@ interface IFormatTextOperationData {
1491
2215
  /**
1492
2216
  * @output
1493
2217
  */
1494
- formattedText: string;
2218
+ formattedText?: string;
1495
2219
  }
1496
2220
  //#endregion
1497
2221
  //#region src/operation/get-attributes-from-element.d.ts
@@ -1537,10 +2261,14 @@ interface IGetControllerFromElementOperationData {
1537
2261
  type TSystemName = keyof typeof index_d_exports$3;
1538
2262
  interface IGetControllerInstanceOperationData {
1539
2263
  /**
2264
+ * The name of a built-in controller, or of a controller registered on the
2265
+ * `EligiusResourceImporter`.
2266
+ *
2267
+ * @type=ParameterType:controllerName
1540
2268
  * @required
1541
2269
  * @erased
1542
2270
  */
1543
- systemName: TSystemName;
2271
+ systemName: TSystemName | (string & {});
1544
2272
  /**
1545
2273
  * @type=ParameterType:object
1546
2274
  * @output
@@ -1553,11 +2281,11 @@ interface IGetCurrentTimeOperationData {
1553
2281
  /**
1554
2282
  * @output
1555
2283
  */
1556
- timestamp: number;
2284
+ timestamp?: number;
1557
2285
  /**
1558
2286
  * @output
1559
2287
  */
1560
- date: Date;
2288
+ date?: Date;
1561
2289
  }
1562
2290
  //#endregion
1563
2291
  //#region src/operation/get-element-dimensions.d.ts
@@ -1587,13 +2315,12 @@ interface IGetFocusedElementOperationData {
1587
2315
  * @type=ParameterType:jQuery
1588
2316
  * @output
1589
2317
  */
1590
- focusedElement: JQuery;
2318
+ focusedElement?: JQuery;
1591
2319
  }
1592
2320
  //#endregion
1593
2321
  //#region src/operation/get-form-data.d.ts
1594
2322
  interface IGetFormDataOperationData {
1595
2323
  /**
1596
- * @required
1597
2324
  * @dependency
1598
2325
  */
1599
2326
  selectedElement: JQuery;
@@ -1648,17 +2375,16 @@ interface IGetScrollPositionOperationData {
1648
2375
  /**
1649
2376
  * @output
1650
2377
  */
1651
- scrollX: number;
2378
+ scrollX?: number;
1652
2379
  /**
1653
2380
  * @output
1654
2381
  */
1655
- scrollY: number;
2382
+ scrollY?: number;
1656
2383
  }
1657
2384
  //#endregion
1658
2385
  //#region src/operation/get-text-content.d.ts
1659
2386
  interface IGetTextContentOperationData {
1660
2387
  /**
1661
- * @required
1662
2388
  * @dependency
1663
2389
  */
1664
2390
  selectedElement: JQuery;
@@ -1683,11 +2409,11 @@ interface IHttpDeleteOperationData {
1683
2409
  /**
1684
2410
  * @output
1685
2411
  */
1686
- response: any;
2412
+ response?: any;
1687
2413
  /**
1688
2414
  * @output
1689
2415
  */
1690
- status: number;
2416
+ status?: number;
1691
2417
  }
1692
2418
  //#endregion
1693
2419
  //#region src/operation/http-post.d.ts
@@ -1710,11 +2436,11 @@ interface IHttpPostOperationData {
1710
2436
  /**
1711
2437
  * @output
1712
2438
  */
1713
- response: any;
2439
+ response?: any;
1714
2440
  /**
1715
2441
  * @output
1716
2442
  */
1717
- status: number;
2443
+ status?: number;
1718
2444
  }
1719
2445
  //#endregion
1720
2446
  //#region src/operation/http-put.d.ts
@@ -1737,11 +2463,11 @@ interface IHttpPutOperationData {
1737
2463
  /**
1738
2464
  * @output
1739
2465
  */
1740
- response: any;
2466
+ response?: any;
1741
2467
  /**
1742
2468
  * @output
1743
2469
  */
1744
- status: number;
2470
+ status?: number;
1745
2471
  }
1746
2472
  //#endregion
1747
2473
  //#region src/operation/invoke-object-method.d.ts
@@ -1774,14 +2500,13 @@ interface IInvokeObjectMethodOperationData {
1774
2500
  //#region src/operation/is-element-in-viewport.d.ts
1775
2501
  interface IIsElementInViewportOperationData {
1776
2502
  /**
1777
- * @required
1778
2503
  * @dependency
1779
2504
  */
1780
2505
  selectedElement: JQuery;
1781
2506
  /**
1782
2507
  * @output
1783
2508
  */
1784
- isInViewport: boolean;
2509
+ isInViewport?: boolean;
1785
2510
  }
1786
2511
  //#endregion
1787
2512
  //#region src/operation/load-from-storage.d.ts
@@ -1800,7 +2525,7 @@ interface ILoadFromStorageOperationData {
1800
2525
  /**
1801
2526
  * @output
1802
2527
  */
1803
- loadedValue: any;
2528
+ loadedValue?: any;
1804
2529
  }
1805
2530
  //#endregion
1806
2531
  //#region src/operation/load-json.d.ts
@@ -1839,7 +2564,6 @@ interface ILogOperationData {
1839
2564
  //#region src/operation/map-array.d.ts
1840
2565
  interface IMapArrayOperationData {
1841
2566
  /**
1842
- * @required
1843
2567
  * @dependency
1844
2568
  */
1845
2569
  arrayData: any[];
@@ -1855,8 +2579,8 @@ interface IMapArrayOperationData {
1855
2579
  }
1856
2580
  //#endregion
1857
2581
  //#region src/operation/math.d.ts
1858
- type MathFunctionKeys = { [K in keyof Math]: Math[K] extends ((...args: any) => any) ? K : never }[keyof Math];
1859
- type MathNonFunctionKeys = { [K in keyof Math]: Math[K] extends ((...args: any) => any) ? never : K }[keyof Math];
2582
+ type MathFunctionKeys = { [K in keyof Math]: Math[K] extends ((...args: any) => any) ? K : never; }[keyof Math];
2583
+ type MathNonFunctionKeys = { [K in keyof Math]: Math[K] extends ((...args: any) => any) ? never : K; }[keyof Math];
1860
2584
  interface IMathOperationData {
1861
2585
  /**
1862
2586
  * @type=ParameterType:array
@@ -1938,7 +2662,6 @@ interface IReparentElementOperationData {
1938
2662
  //#region src/operation/replace-string.d.ts
1939
2663
  interface IReplaceStringOperationData {
1940
2664
  /**
1941
- * @required
1942
2665
  * @dependency
1943
2666
  */
1944
2667
  textContent: string;
@@ -1955,13 +2678,12 @@ interface IReplaceStringOperationData {
1955
2678
  /**
1956
2679
  * @output
1957
2680
  */
1958
- result: string;
2681
+ result?: string;
1959
2682
  }
1960
2683
  //#endregion
1961
2684
  //#region src/operation/replace-text.d.ts
1962
2685
  interface IReplaceTextOperationData {
1963
2686
  /**
1964
- * @required
1965
2687
  * @dependency
1966
2688
  */
1967
2689
  textContent: string;
@@ -1978,7 +2700,7 @@ interface IReplaceTextOperationData {
1978
2700
  /**
1979
2701
  * @output
1980
2702
  */
1981
- replacementCount: number;
2703
+ replacementCount?: number;
1982
2704
  }
1983
2705
  //#endregion
1984
2706
  //#region src/operation/request-action.d.ts
@@ -2021,7 +2743,6 @@ type ScrollBehavior$1 = 'auto' | 'smooth';
2021
2743
  type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
2022
2744
  interface IScrollToElementOperationData {
2023
2745
  /**
2024
- * @required
2025
2746
  * @dependency
2026
2747
  */
2027
2748
  selectedElement: JQuery;
@@ -2121,15 +2842,16 @@ interface ISetElementContentOperationData {
2121
2842
  *
2122
2843
  * prepend = the new content will be inserted before the current content
2123
2844
  *
2845
+ * Defaults to overwrite.
2846
+ *
2124
2847
  * @erased
2125
2848
  */
2126
- insertionType: 'overwrite' | 'append' | 'prepend';
2849
+ insertionType?: 'overwrite' | 'append' | 'prepend';
2127
2850
  }
2128
2851
  //#endregion
2129
2852
  //#region src/operation/set-focus.d.ts
2130
2853
  interface ISetFocusOperationData {
2131
2854
  /**
2132
- * @required
2133
2855
  * @dependency
2134
2856
  */
2135
2857
  selectedElement: JQuery;
@@ -2138,7 +2860,6 @@ interface ISetFocusOperationData {
2138
2860
  //#region src/operation/set-form-value.d.ts
2139
2861
  interface ISetFormValueOperationData {
2140
2862
  /**
2141
- * @required
2142
2863
  * @dependency
2143
2864
  */
2144
2865
  selectedElement: JQuery;
@@ -2205,7 +2926,6 @@ interface ISetVariableOperationData {
2205
2926
  type SortOrder = 'asc' | 'desc';
2206
2927
  interface ISortArrayOperationData {
2207
2928
  /**
2208
- * @required
2209
2929
  * @dependency
2210
2930
  */
2211
2931
  arrayData: any[];
@@ -2227,13 +2947,12 @@ interface ISortArrayOperationData {
2227
2947
  /**
2228
2948
  * @output
2229
2949
  */
2230
- sortedArray: any[];
2950
+ sortedArray?: any[];
2231
2951
  }
2232
2952
  //#endregion
2233
2953
  //#region src/operation/split-string.d.ts
2234
2954
  interface ISplitStringOperationData {
2235
2955
  /**
2236
- * @required
2237
2956
  * @dependency
2238
2957
  */
2239
2958
  textContent: string;
@@ -2250,7 +2969,7 @@ interface ISplitStringOperationData {
2250
2969
  /**
2251
2970
  * @output
2252
2971
  */
2253
- resultArray: string[];
2972
+ resultArray?: string[];
2254
2973
  }
2255
2974
  //#endregion
2256
2975
  //#region src/operation/start-action.d.ts
@@ -2263,13 +2982,12 @@ interface IStartActionOperationData {
2263
2982
  * @type=ParameterType:object
2264
2983
  * @erased
2265
2984
  */
2266
- actionOperationData: TOperationData;
2985
+ actionOperationData?: TOperationData;
2267
2986
  }
2268
2987
  //#endregion
2269
2988
  //#region src/operation/substring-text.d.ts
2270
2989
  interface ISubstringTextOperationData {
2271
2990
  /**
2272
- * @required
2273
2991
  * @dependency
2274
2992
  */
2275
2993
  textContent: string;
@@ -2286,7 +3004,7 @@ interface ISubstringTextOperationData {
2286
3004
  /**
2287
3005
  * @output
2288
3006
  */
2289
- substring: string;
3007
+ substring?: string;
2290
3008
  }
2291
3009
  //#endregion
2292
3010
  //#region src/operation/toggle-class.d.ts
@@ -2317,7 +3035,6 @@ interface IToggleElementOperationData {
2317
3035
  //#region src/operation/toggle-form-element.d.ts
2318
3036
  interface IToggleFormElementOperationData {
2319
3037
  /**
2320
- * @required
2321
3038
  * @dependency
2322
3039
  */
2323
3040
  selectedElement: JQuery;
@@ -2338,7 +3055,6 @@ interface IValidationRules {
2338
3055
  }
2339
3056
  interface IValidateFormOperationData {
2340
3057
  /**
2341
- * @required
2342
3058
  * @dependency
2343
3059
  */
2344
3060
  selectedElement: JQuery;
@@ -2368,9 +3084,10 @@ interface IWaitOperationData {
2368
3084
  }
2369
3085
  //#endregion
2370
3086
  //#region src/operation/when.d.ts
2371
- type TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';
2372
- type TValue = `'${string}'` | number | `$operationdata.${string}` | `$globaldata.${string}` | `$scope.${string}`;
2373
- type TExpression = `${TValue}${TOperator}${TValue}`;
3087
+ /**
3088
+ * A condition expression, see {@link when} for the grammar.
3089
+ */
3090
+ type TExpression = string;
2374
3091
  interface IWhenOperationData {
2375
3092
  /**
2376
3093
  * @type=ParameterType:expression
@@ -2427,56 +3144,108 @@ interface IDOMEventListenerControllerOperationData {
2427
3144
  *
2428
3145
  * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,
2429
3146
  * prefix the action name with `end:`.
3147
+ *
3148
+ * The actions run in order, each receiving the operation data the previous one returned. When an action fails, the
3149
+ * remaining actions are skipped and the failure is reported through the eventbus's `reportError` (an error naming
3150
+ * this controller, the action and the DOM event, with the original error as `cause`), or logged with
3151
+ * `console.error` when the eventbus has no `reportError`.
2430
3152
  */
2431
3153
  declare class DOMEventListenerController$1 implements IController<IDOMEventListenerControllerOperationData> {
2432
3154
  operationData?: IDOMEventListenerControllerOperationData;
2433
3155
  actionInstanceInfos?: IActionInstanceInfo[];
2434
3156
  name: string;
3157
+ private _boundEventHandler;
3158
+ /** The eventbus passed to attach(), used to report failing actions */
3159
+ private _eventbus;
2435
3160
  init(operationData: IDOMEventListenerControllerOperationData): void;
3161
+ /**
3162
+ * Looks up the configured actions and starts listening for the DOM event.
3163
+ *
3164
+ * @param eventbus - The eventbus to request the actions from
3165
+ * @throws when an action name is unknown (`request-action` throws or
3166
+ * returns nothing); the message names the controller, the action and the
3167
+ * DOM event, and keeps the responder's "did you mean" hint
3168
+ */
2436
3169
  attach(eventbus: IEventbus): void;
2437
3170
  private _isStartAction;
2438
3171
  private _eventHandler;
2439
- private _executeAction;
3172
+ /**
3173
+ * Runs the actions one after another, merging each action's result into the
3174
+ * operation data for the next. A failing action stops the chain, since later
3175
+ * actions consume the earlier actions' output, and is reported with an error
3176
+ * naming this controller, the action, the phase and the DOM event (see
3177
+ * `_reportFailure`). The operation data is never logged.
3178
+ */
3179
+ private _executeActions;
3180
+ /**
3181
+ * Reports through the eventbus's `reportError` when it has one, so the
3182
+ * application's `onHandlerError` sees it; otherwise logs it.
3183
+ */
3184
+ private _reportFailure;
3185
+ /**
3186
+ * Removes only the handler this controller registered, so other handlers for
3187
+ * the same event on the element keep working, and resets the action
3188
+ * instances so a later attach registers again.
3189
+ */
2440
3190
  detach(_eventbus: IEventbus): void;
2441
3191
  }
2442
3192
  //#endregion
3193
+ //#region src/operation/metadata/parameter-types.d.ts
3194
+ /**
3195
+ * Every parameter type the operation and controller metadata may use. The
3196
+ * metadata generator fails on a type name that is not in this list.
3197
+ *
3198
+ * `RegExp` and the DOM node types (`Element`, `Text`, `Comment`, `Document`,
3199
+ * `DocumentFragment`) are the names the generator emits for `string | RegExp`
3200
+ * and `string | JQuery.Node` properties.
3201
+ *
3202
+ * Kept out of `types.ts`: the generated metadata index re-exports `types.ts`
3203
+ * into the `metadata` namespace, whose consumers expect only metadata
3204
+ * functions there.
3205
+ */
3206
+ export declare const PARAMETER_TYPES: readonly ["ParameterType:htmlElementName", "ParameterType:className", "ParameterType:selector", "ParameterType:string", "ParameterType:number", "ParameterType:object", "ParameterType:boolean", "ParameterType:array", "ParameterType:eventTopic", "ParameterType:eventName", "ParameterType:systemName", "ParameterType:actionName", "ParameterType:controllerName", "ParameterType:dimensions", "ParameterType:dimensionsModifier", "ParameterType:url", "ParameterType:htmlContent", "ParameterType:labelId", "ParameterType:ImagePath", "ParameterType:QuadrantPosition", "ParameterType:jQuery", "ParameterType:expression", "ParameterType:mathfunction", "ParameterType:cssProperties", "ParameterType:function", "ParameterType:Date", "ParameterType:languagecode", "ParameterType:RegExp", "ParameterType:Element", "ParameterType:Text", "ParameterType:Comment", "ParameterType:Document", "ParameterType:DocumentFragment"];
3207
+ //#endregion
2443
3208
  //#region src/operation/metadata/types.d.ts
2444
- type THasRequired = {
3209
+ export type THasRequired = {
2445
3210
  required?: boolean;
2446
3211
  };
2447
- type THasErased = {
3212
+ export type THasErased = {
2448
3213
  erased?: boolean;
2449
3214
  };
2450
- type THasDescription = {
3215
+ export type THasDescription = {
2451
3216
  description?: string;
2452
3217
  };
2453
- type TComplexPropertyMetadata = {
3218
+ export type TComplexPropertyMetadata = {
2454
3219
  type: TConstantParametersTypes[] | TParameterTypes | TParameterTypesDelimited;
2455
3220
  defaultValue?: unknown;
2456
3221
  } & THasRequired & THasErased & THasDescription;
2457
- type TArrayProperyMetadata = {
3222
+ export type TArrayProperyMetadata = {
2458
3223
  type: 'ParameterType:array';
2459
3224
  itemType: TParameterTypes;
2460
3225
  } & THasRequired & THasErased & THasDescription;
2461
- type TConstantParametersTypes = {
3226
+ export type TConstantParametersTypes = {
2462
3227
  value: string;
2463
3228
  default?: boolean;
2464
3229
  } & THasDescription;
2465
- type TPropertyMetadata = TComplexPropertyMetadata | TArrayProperyMetadata | TParameterTypes;
2466
- type TPropertiesMetadata<T> = { [P in keyof T]?: TPropertyMetadata };
2467
- interface IOperationMetadata<T> {
3230
+ export type TPropertyMetadata = TComplexPropertyMetadata | TArrayProperyMetadata | TParameterTypes;
3231
+ export type TPropertiesMetadata<T> = { [P in keyof T]?: TPropertyMetadata; };
3232
+ export interface IOperationMetadata<T> {
2468
3233
  category: TOperationCategory;
2469
3234
  description: string;
2470
3235
  dependentProperties?: (keyof T)[];
2471
3236
  properties?: TPropertiesMetadata<T>;
2472
3237
  outputProperties?: TPropertiesMetadata<T>;
2473
3238
  }
2474
- type TParameterTypesDelimited = `${TParameterTypes}` | `${TParameterTypes}|${string}`;
2475
- type TParameterTypes = 'ParameterType:htmlElementName' | 'ParameterType:className' | 'ParameterType:selector' | 'ParameterType:string' | 'ParameterType:number' | 'ParameterType:object' | 'ParameterType:boolean' | 'ParameterType:array' | 'ParameterType:eventTopic' | 'ParameterType:eventName' | 'ParameterType:systemName' | 'ParameterType:actionName' | 'ParameterType:controllerName' | 'ParameterType:dimensions' | 'ParameterType:dimensionsModifier' | 'ParameterType:url' | 'ParameterType:htmlContent' | 'ParameterType:labelId' | 'ParameterType:ImagePath' | 'ParameterType:QuadrantPosition' | 'ParameterType:jQuery' | 'ParameterType:expression' | 'ParameterType:mathfunction' | 'ParameterType:cssProperties' | 'ParameterType:function' | 'ParameterType:Date' | 'ParameterType:languagecode';
2476
- type TOperationCategory = 'DOM' | 'Controller' | 'Data' | 'Control Flow' | 'Animation' | 'Form' | 'Scroll' | 'Focus' | 'Array' | 'String' | 'Text' | 'Date' | 'HTTP' | 'Action' | 'Utility' | 'Accessibility';
3239
+ export type TParameterTypesDelimited = `${TParameterTypes}` | `${TParameterTypes}|${string}`;
3240
+ export type TParameterTypes = (typeof PARAMETER_TYPES)[number];
3241
+ /**
3242
+ * A parameter type without its `ParameterType:` prefix, e.g. `className`.
3243
+ */
3244
+ export type TParameterTypeName = TParameterTypes extends `ParameterType:${infer Name}` ? Name : never;
3245
+ export type TOperationCategory = 'DOM' | 'Controller' | 'Data' | 'Control Flow' | 'Animation' | 'Form' | 'Scroll' | 'Focus' | 'Array' | 'String' | 'Text' | 'Date' | 'HTTP' | 'Action' | 'Utility' | 'Accessibility';
2477
3246
  //#endregion
2478
3247
  //#region src/controllers/metadata/types.d.ts
2479
- type IControllerMetadata<T> = {
3248
+ export type IControllerMetadata<T> = {
2480
3249
  description: string;
2481
3250
  dependentProperties?: (keyof T)[];
2482
3251
  properties?: Partial<Record<keyof T, TPropertyMetadata>>;
@@ -2518,6 +3287,12 @@ declare function beforeRequestVideoUrl(): IEventMetadata<BeforeRequestVideoUrlEv
2518
3287
  //#region src/eventbus/events/metadata/dom-mutation.d.ts
2519
3288
  declare function domMutation(): IEventMetadata<DomMutationEvent['args']>;
2520
3289
  //#endregion
3290
+ //#region src/eventbus/events/metadata/engine-command-error.d.ts
3291
+ declare function engineCommandError(): IEventMetadata<EngineCommandErrorEvent['args']>;
3292
+ //#endregion
3293
+ //#region src/eventbus/events/metadata/engine-error.d.ts
3294
+ declare function engineError(): IEventMetadata<EngineErrorEvent['args']>;
3295
+ //#endregion
2521
3296
  //#region src/eventbus/events/metadata/highlight-navigation.d.ts
2522
3297
  declare function highlightNavigation(): IEventMetadata<HighlightNavigationEvent['args']>;
2523
3298
  //#endregion
@@ -2566,6 +3341,9 @@ declare function requestTimelineCleanup(): IEventMetadata<RequestTimelineCleanup
2566
3341
  //#region src/eventbus/events/metadata/request-timeline-uri.d.ts
2567
3342
  declare function requestTimelineUri(): IEventMetadata<RequestTimelineUriEvent['args']>;
2568
3343
  //#endregion
3344
+ //#region src/eventbus/events/metadata/request-translation.d.ts
3345
+ declare function requestTranslation(): IEventMetadata<RequestTranslationEvent['args']>;
3346
+ //#endregion
2569
3347
  //#region src/eventbus/events/metadata/request-video-cleanup.d.ts
2570
3348
  declare function requestVideoCleanup(): IEventMetadata<RequestVideoCleanupEvent['args']>;
2571
3349
  //#endregion
@@ -2638,7 +3416,7 @@ declare function timelineTime(): IEventMetadata<TimeEvent['args']>;
2638
3416
  //#region src/eventbus/events/metadata/video-complete.d.ts
2639
3417
  declare function videoComplete(): IEventMetadata<VideoCompleteEvent['args']>;
2640
3418
  declare namespace index_d_exports$1 {
2641
- export { IEventMetadata, beforeRequestTimelineUri, beforeRequestVideoUrl, domMutation, highlightNavigation, languageChange, navigateToVideoUrl, pushHistoryState, requestAction$1 as requestAction, requestCurrentLanguage, requestCurrentNavigation, requestCurrentTimelinePosition, requestCurrentVideoPosition, requestEngineRoot, requestFunction, requestInstance, requestLabelCollection, requestLabelCollections, requestTimelineCleanup, requestTimelineUri, requestVideoCleanup, requestVideoUrl, timelineComplete, timelineContainerRequest, timelineCurrentTimelineChange, timelineDuration, timelineDurationRequest, timelineFirstframe, timelinePause, timelinePauseRequest, timelinePlay, timelinePlayRequest, timelinePlayToggleRequest, timelineRequestCurrentTimeline, timelineResize, timelineResizeRequest, timelineRestart, timelineSeek, timelineSeekRequest, timelineSeeked, timelineStop, timelineStopRequest, timelineTime, videoComplete };
3419
+ export { IEventMetadata, beforeRequestTimelineUri, beforeRequestVideoUrl, domMutation, engineCommandError, engineError, highlightNavigation, languageChange, navigateToVideoUrl, pushHistoryState, requestAction$1 as requestAction, requestCurrentLanguage, requestCurrentNavigation, requestCurrentTimelinePosition, requestCurrentVideoPosition, requestEngineRoot, requestFunction, requestInstance, requestLabelCollection, requestLabelCollections, requestTimelineCleanup, requestTimelineUri, requestTranslation, requestVideoCleanup, requestVideoUrl, timelineComplete, timelineContainerRequest, timelineCurrentTimelineChange, timelineDuration, timelineDurationRequest, timelineFirstframe, timelinePause, timelinePauseRequest, timelinePlay, timelinePlayRequest, timelinePlayToggleRequest, timelineRequestCurrentTimeline, timelineResize, timelineResizeRequest, timelineRestart, timelineSeek, timelineSeekRequest, timelineSeeked, timelineStop, timelineStopRequest, timelineTime, videoComplete };
2642
3420
  }
2643
3421
  //#endregion
2644
3422
  //#region src/operation/metadata/add-class.d.ts
@@ -2660,7 +3438,7 @@ declare function animate(): IOperationMetadata<IAnimateOperationData>;
2660
3438
  declare function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData>;
2661
3439
  //#endregion
2662
3440
  //#region src/operation/metadata/break-for-each.d.ts
2663
- declare function breakForEach(): IOperationMetadata<undefined>;
3441
+ declare function breakForEach(): IOperationMetadata<TOperationData>;
2664
3442
  //#endregion
2665
3443
  //#region src/operation/metadata/broadcast-event.d.ts
2666
3444
  declare function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData>;
@@ -2684,7 +3462,7 @@ declare function compareDate(): IOperationMetadata<ICompareDateOperationData>;
2684
3462
  declare function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData>;
2685
3463
  //#endregion
2686
3464
  //#region src/operation/metadata/continue-for-each.d.ts
2687
- declare function continueForEach(): IOperationMetadata<undefined>;
3465
+ declare function continueForEach(): IOperationMetadata<TOperationData>;
2688
3466
  //#endregion
2689
3467
  //#region src/operation/metadata/create-element.d.ts
2690
3468
  declare function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>>;
@@ -2696,10 +3474,10 @@ declare function customFunction(): IOperationMetadata<ICustomFunctionOperationDa
2696
3474
  declare function endAction(): IOperationMetadata<IEndActionOperationData>;
2697
3475
  //#endregion
2698
3476
  //#region src/operation/metadata/end-for-each.d.ts
2699
- declare function endForEach(): IOperationMetadata<undefined>;
3477
+ declare function endForEach(): IOperationMetadata<TOperationData>;
2700
3478
  //#endregion
2701
3479
  //#region src/operation/metadata/end-when.d.ts
2702
- declare function endWhen(): IOperationMetadata<undefined>;
3480
+ declare function endWhen(): IOperationMetadata<TOperationData>;
2703
3481
  //#endregion
2704
3482
  //#region src/operation/metadata/extend-controller.d.ts
2705
3483
  declare function extendController(): IOperationMetadata<IExtendControllerOperationData>;
@@ -2783,7 +3561,7 @@ declare function mapArray(): IOperationMetadata<IMapArrayOperationData>;
2783
3561
  declare function math(): IOperationMetadata<IMathOperationData>;
2784
3562
  //#endregion
2785
3563
  //#region src/operation/metadata/otherwise.d.ts
2786
- declare function otherwise(): IOperationMetadata<undefined>;
3564
+ declare function otherwise(): IOperationMetadata<TOperationData>;
2787
3565
  //#endregion
2788
3566
  //#region src/operation/metadata/remove-class.d.ts
2789
3567
  declare function removeClass(): IOperationMetadata<IRemoveClassOperationData>;
@@ -2878,8 +3656,8 @@ declare function wait(): IOperationMetadata<IWaitOperationData>;
2878
3656
  //#region src/operation/metadata/when.d.ts
2879
3657
  declare function when(): IOperationMetadata<IWhenOperationData>;
2880
3658
  declare namespace index_d_exports$2 {
2881
- export { IOperationMetadata, TArrayProperyMetadata, TComplexPropertyMetadata, TConstantParametersTypes, THasDescription, THasErased, THasRequired, TOperationCategory, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, customFunction, endAction, endForEach, endWhen, extendController, filterArray, findInArray, forEach, formatDate, formatText, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isElementInViewport, loadFromStorage, loadJson, log, mapArray, math, otherwise, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, replaceString, replaceText, requestAction, saveToStorage, scrollToElement, scrollToPosition, selectElement, setData, setElementAttributes, setElementContent, setFocus, setFormValue, setGlobalData, setOperationData, setStyle, setVariable, sortArray, splitString, startAction, substringText, toggleClass, toggleElement, toggleFormElement, validateForm, wait, when };
3659
+ export { IOperationMetadata, TArrayProperyMetadata, TComplexPropertyMetadata, TConstantParametersTypes, THasDescription, THasErased, THasRequired, TOperationCategory, TParameterTypeName, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, customFunction, endAction, endForEach, endWhen, extendController, filterArray, findInArray, forEach, formatDate, formatText, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isElementInViewport, loadFromStorage, loadJson, log, mapArray, math, otherwise, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, replaceString, replaceText, requestAction, saveToStorage, scrollToElement, scrollToPosition, selectElement, setData, setElementAttributes, setElementContent, setFocus, setFormValue, setGlobalData, setOperationData, setStyle, setVariable, sortArray, splitString, startAction, substringText, toggleClass, toggleElement, toggleFormElement, validateForm, wait, when };
2882
3660
  }
2883
3661
  //#endregion
2884
- export { IControllerMetadata, IEventMetadata, IOperationMetadata, TArrayProperyMetadata, TComplexPropertyMetadata, TConstantParametersTypes, THasDescription, THasErased, THasRequired, TOperationCategory, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, index_d_exports as ctrlmetadata, index_d_exports$1 as eventmetadata, index_d_exports$2 as metadata };
3662
+ export { index_d_exports as ctrlmetadata, index_d_exports$1 as eventmetadata, index_d_exports$2 as metadata };
2885
3663
  //# sourceMappingURL=metadata.d.mts.map