eligius 1.5.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -25
- package/dist/index.d.mts +1965 -340
- package/dist/index.mjs +2130 -777
- package/dist/index.mjs.map +1 -1
- package/jsonschema/eligius-configuration.json +101 -47
- package/jsonschema/endable-action-template.json +4 -2
- package/jsonschema/endable-action.json +3 -1
- package/jsonschema/event-action.json +3 -1
- package/jsonschema/mediaplayer-timeline-provider-settings.json +85 -30
- package/jsonschema/raf-timeline-provider-settings.json +132 -20
- package/jsonschema/timeline-action.json +4 -2
- package/jsonschema/timeline-provider-settings.json +6 -3
- package/jsonschema/timeline.json +31 -10
- package/package.json +8 -9
package/dist/index.d.mts
CHANGED
|
@@ -46,57 +46,415 @@ interface HighlightNavigationEvent {
|
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/timelineproviders/types.d.ts
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Position source state.
|
|
51
|
+
* - `active`: Source is emitting position updates
|
|
52
|
+
* - `suspended`: Source is paused, position preserved
|
|
53
|
+
* - `inactive`: Source is stopped, position reset to initial state
|
|
54
|
+
*/
|
|
55
|
+
type TSourceState = 'active' | 'suspended' | 'inactive';
|
|
56
|
+
/**
|
|
57
|
+
* Boundary type for position source events.
|
|
58
|
+
* - `start`: Position reached the beginning (e.g., after reverse or loop)
|
|
59
|
+
* - `end`: Position reached the end of duration
|
|
60
|
+
*/
|
|
61
|
+
type TBoundary = 'start' | 'end';
|
|
62
|
+
/**
|
|
63
|
+
* Core interface for timeline position sources.
|
|
64
|
+
*
|
|
65
|
+
* A position source provides the current position within a timeline and emits
|
|
66
|
+
* position updates. The source of position can vary: elapsed time (RAF),
|
|
67
|
+
* media playback (video), scroll position, mouse position, external data, etc.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* // RAF-based position source
|
|
72
|
+
* const source = new RafPositionSource(config);
|
|
73
|
+
* await source.init();
|
|
74
|
+
*
|
|
75
|
+
* source.onPosition((position) => {
|
|
76
|
+
* console.log(`Current position: ${position}`);
|
|
77
|
+
* });
|
|
78
|
+
*
|
|
79
|
+
* source.onBoundaryReached((boundary) => {
|
|
80
|
+
* if (boundary === 'end') console.log('Reached end');
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* await source.activate();
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
interface IPositionSource {
|
|
87
|
+
/** Current state of the position source */
|
|
88
|
+
readonly state: TSourceState;
|
|
89
|
+
/**
|
|
90
|
+
* Whether to loop when reaching the end boundary.
|
|
91
|
+
*
|
|
92
|
+
* When `true`, the source resets to position 0 and continues.
|
|
93
|
+
* When `false`, the source emits `'end'` boundary and deactivates.
|
|
94
|
+
*
|
|
95
|
+
* For sources where looping is not applicable (e.g., mouse position),
|
|
96
|
+
* this property has no effect.
|
|
97
|
+
*/
|
|
52
98
|
loop: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Initialize the position source.
|
|
101
|
+
*
|
|
102
|
+
* Performs any async setup required before the source can be activated.
|
|
103
|
+
* For example: loading media, binding event listeners, establishing connections.
|
|
104
|
+
*
|
|
105
|
+
* @throws If initialization fails (e.g., media load error, connection refused)
|
|
106
|
+
*/
|
|
53
107
|
init(): Promise<void>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Destroy the position source and release all resources.
|
|
110
|
+
*
|
|
111
|
+
* After calling destroy, the source cannot be reused.
|
|
112
|
+
* Removes event listeners, closes connections, clears timers.
|
|
113
|
+
*/
|
|
114
|
+
destroy(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Activate the position source to begin emitting position updates.
|
|
117
|
+
*
|
|
118
|
+
* Transitions state from `inactive` or `suspended` to `active`.
|
|
119
|
+
*
|
|
120
|
+
* @throws If activation fails (e.g., autoplay blocked, permission denied)
|
|
121
|
+
*/
|
|
122
|
+
activate(): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Suspend the position source, preserving current position.
|
|
125
|
+
*
|
|
126
|
+
* Transitions state from `active` to `suspended`.
|
|
127
|
+
* Position updates stop but position is preserved for later resumption.
|
|
128
|
+
*/
|
|
129
|
+
suspend(): void;
|
|
130
|
+
/**
|
|
131
|
+
* Deactivate the position source and reset to initial state.
|
|
132
|
+
*
|
|
133
|
+
* Transitions state to `inactive`.
|
|
134
|
+
* Position is reset (typically to 0).
|
|
135
|
+
*/
|
|
136
|
+
deactivate(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Get the current position.
|
|
139
|
+
*
|
|
140
|
+
* @returns Current position in seconds (or source-specific units)
|
|
141
|
+
*/
|
|
59
142
|
getPosition(): number;
|
|
143
|
+
/**
|
|
144
|
+
* Get the total duration.
|
|
145
|
+
*
|
|
146
|
+
* @returns Duration in seconds (or source-specific units), or `Infinity` for unbounded sources
|
|
147
|
+
*/
|
|
60
148
|
getDuration(): number;
|
|
149
|
+
/**
|
|
150
|
+
* Register a callback for position updates.
|
|
151
|
+
*
|
|
152
|
+
* Called whenever the position changes while the source is active.
|
|
153
|
+
* Frequency depends on the source type (e.g., RAF tick, video timeupdate).
|
|
154
|
+
*
|
|
155
|
+
* @param callback - Function receiving the current position
|
|
156
|
+
*/
|
|
157
|
+
onPosition(callback: (position: number) => void): void;
|
|
158
|
+
/**
|
|
159
|
+
* Register a callback for boundary events.
|
|
160
|
+
*
|
|
161
|
+
* Called when position reaches a boundary (start or end).
|
|
162
|
+
* For looping sources, `'end'` is emitted before reset.
|
|
163
|
+
*
|
|
164
|
+
* @param callback - Function receiving the boundary type
|
|
165
|
+
*/
|
|
166
|
+
onBoundaryReached(callback: (boundary: TBoundary) => void): void;
|
|
167
|
+
/**
|
|
168
|
+
* Register a callback for when the source becomes active.
|
|
169
|
+
*
|
|
170
|
+
* Called once each time the source transitions to the `active` state.
|
|
171
|
+
* This is equivalent to "first frame" semantics - for RAF sources it's
|
|
172
|
+
* the first tick, for video sources it's when playback actually starts.
|
|
173
|
+
*
|
|
174
|
+
* @param callback - Function called when source becomes active
|
|
175
|
+
*/
|
|
176
|
+
onActivated(callback: () => void): void;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Interface for position sources that support seeking to arbitrary positions.
|
|
180
|
+
*
|
|
181
|
+
* Not all position sources are seekable. For example:
|
|
182
|
+
* - Seekable: RAF, video, scroll (programmatic), step-based
|
|
183
|
+
* - Not seekable: mouse position, external WebSocket, live streams
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* if (isSeekable(source)) {
|
|
188
|
+
* const actualPosition = await source.seek(30.5);
|
|
189
|
+
* console.log(`Seeked to: ${actualPosition}`);
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
interface ISeekable {
|
|
194
|
+
/**
|
|
195
|
+
* Seek to a specific position.
|
|
196
|
+
*
|
|
197
|
+
* @param position - Target position in seconds (or source-specific units)
|
|
198
|
+
* @returns Actual position after seek (may differ from requested if clamped)
|
|
199
|
+
*/
|
|
200
|
+
seek(position: number): Promise<number>;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Type guard to check if a position source is seekable.
|
|
204
|
+
*
|
|
205
|
+
* @param source - Position source to check
|
|
206
|
+
* @returns `true` if source implements ISeekable
|
|
207
|
+
*/
|
|
208
|
+
declare function isSeekable(source: IPositionSource): source is IPositionSource & ISeekable;
|
|
209
|
+
/**
|
|
210
|
+
* Interface for managing a collection of timeline items.
|
|
211
|
+
*
|
|
212
|
+
* A playlist allows switching between multiple timeline configurations
|
|
213
|
+
* (e.g., multiple videos, multiple animation sequences).
|
|
214
|
+
*
|
|
215
|
+
* @typeParam TItem - Type of playlist items (default: unknown)
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* playlist.onItemChange((item) => {
|
|
220
|
+
* console.log(`Switched to: ${item.uri}`);
|
|
221
|
+
* });
|
|
222
|
+
*
|
|
223
|
+
* playlist.selectItem('chapter-2');
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
interface IPlaylist<TItem = unknown> {
|
|
227
|
+
/** Currently active playlist item */
|
|
228
|
+
readonly currentItem: TItem;
|
|
229
|
+
/** All items in the playlist */
|
|
230
|
+
readonly items: readonly TItem[];
|
|
231
|
+
/**
|
|
232
|
+
* Select a playlist item by identifier.
|
|
233
|
+
*
|
|
234
|
+
* @param identifier - Unique identifier for the item (e.g., URI, ID)
|
|
235
|
+
* @throws If no item matches the identifier
|
|
236
|
+
*/
|
|
237
|
+
selectItem(identifier: string): void;
|
|
238
|
+
/**
|
|
239
|
+
* Register a callback for item changes.
|
|
240
|
+
*
|
|
241
|
+
* Called whenever the current item changes via `selectItem()`.
|
|
242
|
+
*
|
|
243
|
+
* @param callback - Function receiving the new current item
|
|
244
|
+
*/
|
|
245
|
+
onItemChange(callback: (item: TItem) => void): void;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Interface for providing the DOM container where content is rendered.
|
|
249
|
+
*
|
|
250
|
+
* The container is where operations render their output (elements, animations, etc.).
|
|
251
|
+
* For some sources (video), the container is intrinsic. For others (WebSocket),
|
|
252
|
+
* the container is a separate concern configured independently.
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```typescript
|
|
256
|
+
* containerProvider.onContainerReady(() => {
|
|
257
|
+
* const $container = containerProvider.getContainer();
|
|
258
|
+
* $container?.append('<div class="content">Loaded!</div>');
|
|
259
|
+
* });
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
interface IContainerProvider {
|
|
263
|
+
/**
|
|
264
|
+
* Get the container element.
|
|
265
|
+
*
|
|
266
|
+
* @returns jQuery-wrapped container element, or `undefined` if not available
|
|
267
|
+
*/
|
|
61
268
|
getContainer(): JQuery<HTMLElement> | undefined;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Register a callback for when the container is ready.
|
|
271
|
+
*
|
|
272
|
+
* Called once when the container becomes available and ready for content.
|
|
273
|
+
* For video sources, this corresponds to the first frame.
|
|
274
|
+
* For DOM containers, this is called after the element is found/created.
|
|
275
|
+
*
|
|
276
|
+
* @param callback - Function called when container is ready
|
|
277
|
+
*/
|
|
278
|
+
onContainerReady(callback: () => void): void;
|
|
67
279
|
}
|
|
68
280
|
//#endregion
|
|
69
281
|
//#region src/types.d.ts
|
|
70
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Event map for EligiusEngine
|
|
284
|
+
* Maps event names to their argument tuples
|
|
285
|
+
*
|
|
286
|
+
* Note: Must be a `type` alias (not `interface`) for TypedEventEmitter constraint
|
|
287
|
+
*/
|
|
288
|
+
type EngineEvents = {
|
|
289
|
+
/** Playback started */
|
|
290
|
+
start: [];
|
|
291
|
+
/** Playback paused */
|
|
292
|
+
pause: [];
|
|
293
|
+
/** Playback stopped */
|
|
294
|
+
stop: [];
|
|
295
|
+
/** Timeline position changed */
|
|
296
|
+
time: [position: number];
|
|
297
|
+
/** Duration became available */
|
|
298
|
+
duration: [duration: number];
|
|
299
|
+
/** Seek operation initiated */
|
|
300
|
+
seekStart: [target: number, current: number, duration: number];
|
|
301
|
+
/** Seek operation completed */
|
|
302
|
+
seekComplete: [position: number, duration: number];
|
|
303
|
+
/** Timeline switched to different URI */
|
|
304
|
+
timelineChange: [uri: string];
|
|
305
|
+
/** Timeline playback completed */
|
|
306
|
+
timelineComplete: [];
|
|
307
|
+
/** First frame of timeline rendered */
|
|
308
|
+
timelineFirstFrame: [];
|
|
309
|
+
/** Timeline looped/restarted */
|
|
310
|
+
timelineRestart: [];
|
|
311
|
+
/** Engine initialization completed */
|
|
312
|
+
initialized: [];
|
|
313
|
+
/** Engine destroyed */
|
|
314
|
+
destroyed: [];
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Event map for LanguageManager
|
|
318
|
+
*
|
|
319
|
+
* Note: Must be a `type` alias (not `interface`) for TypedEventEmitter constraint
|
|
320
|
+
*/
|
|
321
|
+
type LanguageEvents = {
|
|
322
|
+
/** Language changed */
|
|
323
|
+
change: [language: TLanguageCode, previousLanguage: TLanguageCode];
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Manages multi-language labels with explicit, testable API
|
|
327
|
+
*/
|
|
328
|
+
interface ILanguageManager {
|
|
329
|
+
/** Current language code (e.g., 'en-US', 'nl-NL') */
|
|
330
|
+
readonly language: string;
|
|
331
|
+
/** List of available language codes, derived from unique languages in label collections */
|
|
332
|
+
readonly availableLanguages: string[];
|
|
333
|
+
/**
|
|
334
|
+
* Subscribe to language manager events
|
|
335
|
+
* @param event - Event name
|
|
336
|
+
* @param handler - Event handler
|
|
337
|
+
* @returns Unsubscribe function
|
|
338
|
+
*/
|
|
339
|
+
on<K$1 extends keyof LanguageEvents>(event: K$1, handler: (...args: LanguageEvents[K$1]) => void): () => void;
|
|
340
|
+
/**
|
|
341
|
+
* Change the current language
|
|
342
|
+
* @param language - New language code
|
|
343
|
+
* @throws If language code is empty or null
|
|
344
|
+
*/
|
|
345
|
+
setLanguage(language: TLanguageCode): void;
|
|
346
|
+
/**
|
|
347
|
+
* Get a label collection by ID
|
|
348
|
+
* @param collectionId - Label collection ID
|
|
349
|
+
* @returns Label array or undefined if not found
|
|
350
|
+
*/
|
|
351
|
+
getLabelCollection(collectionId: string): ILabel[] | undefined;
|
|
352
|
+
/**
|
|
353
|
+
* Get multiple label collections by IDs
|
|
354
|
+
* @param collectionIds - Array of label collection IDs
|
|
355
|
+
* @returns Array of label arrays (undefined for not found collections)
|
|
356
|
+
*/
|
|
357
|
+
getLabelCollections(collectionIds: string[]): (ILabel[] | undefined)[];
|
|
358
|
+
/**
|
|
359
|
+
* Clean up resources
|
|
360
|
+
*/
|
|
361
|
+
destroy(): void;
|
|
362
|
+
}
|
|
363
|
+
type KeysOfType<T, U> = { [P in keyof T]-?: T[P] extends U | undefined ? P : never }[keyof T];
|
|
364
|
+
/**
|
|
365
|
+
* Result of creating an engine via the factory
|
|
366
|
+
*/
|
|
367
|
+
interface IEngineFactoryResult {
|
|
368
|
+
/** The engine instance */
|
|
369
|
+
engine: IEligiusEngine;
|
|
370
|
+
/** The language manager instance */
|
|
371
|
+
languageManager: ILanguageManager;
|
|
372
|
+
/** The eventbus for external consumers */
|
|
373
|
+
eventbus: IEventbus;
|
|
374
|
+
/**
|
|
375
|
+
* Destroy everything - engine, adapters, and cleanup
|
|
376
|
+
*/
|
|
377
|
+
destroy: () => Promise<void>;
|
|
378
|
+
}
|
|
71
379
|
/**
|
|
72
380
|
* Describes an object that is capable of processing the given configuration and constructing an IEligiusEngine
|
|
73
381
|
* based on this configuration.
|
|
74
382
|
*/
|
|
75
383
|
interface IEngineFactory {
|
|
76
384
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
80
|
-
* @
|
|
385
|
+
* Create a fully wired engine with adapters
|
|
386
|
+
* @param configuration - Engine configuration
|
|
387
|
+
* @param resolver - Optional custom configuration resolver
|
|
388
|
+
* @returns Engine result with engine, language manager, eventbus, and destroy function
|
|
389
|
+
*/
|
|
390
|
+
createEngine(configuration: IEngineConfiguration, resolver?: IConfigurationResolver): IEngineFactoryResult;
|
|
391
|
+
/**
|
|
392
|
+
* Destroy the factory and its resources
|
|
81
393
|
*/
|
|
82
|
-
|
|
394
|
+
destroy(): void;
|
|
83
395
|
}
|
|
84
396
|
interface IEngineFactoryOptions {
|
|
85
397
|
eventbus?: IEventbus;
|
|
86
|
-
devtools?: boolean;
|
|
87
398
|
}
|
|
88
399
|
/**
|
|
89
|
-
*
|
|
400
|
+
* The Eligius timeline engine with explicit, testable API
|
|
90
401
|
*/
|
|
91
402
|
interface IEligiusEngine {
|
|
403
|
+
/** Current timeline position in seconds */
|
|
404
|
+
readonly position: number;
|
|
405
|
+
/** Timeline duration in seconds, undefined if not yet available */
|
|
406
|
+
readonly duration: number | undefined;
|
|
407
|
+
/** Current playback state */
|
|
408
|
+
readonly playState: 'playing' | 'paused' | 'stopped';
|
|
409
|
+
/** URI of the currently active timeline */
|
|
410
|
+
readonly currentTimelineUri: string;
|
|
411
|
+
/** Container element for the active timeline provider */
|
|
412
|
+
readonly container: JQuery<HTMLElement> | undefined;
|
|
413
|
+
/** Root element of the engine (container selector) */
|
|
414
|
+
readonly engineRoot: JQuery<HTMLElement>;
|
|
415
|
+
/**
|
|
416
|
+
* Subscribe to engine events
|
|
417
|
+
* @param event - Event name
|
|
418
|
+
* @param handler - Event handler
|
|
419
|
+
* @returns Unsubscribe function
|
|
420
|
+
*/
|
|
421
|
+
on<K$1 extends keyof EngineEvents>(event: K$1, handler: (...args: EngineEvents[K$1]) => void): () => void;
|
|
422
|
+
/**
|
|
423
|
+
* Initialize the engine
|
|
424
|
+
* Creates layout, initializes timeline provider, executes init actions
|
|
425
|
+
* @returns The initialized position source
|
|
426
|
+
*/
|
|
427
|
+
init(): Promise<IPositionSource>;
|
|
428
|
+
/**
|
|
429
|
+
* Destroy the engine
|
|
430
|
+
* Cleans up resources, ends actions, removes event listeners
|
|
431
|
+
*/
|
|
432
|
+
destroy(): Promise<void>;
|
|
92
433
|
/**
|
|
93
|
-
*
|
|
434
|
+
* Start playback
|
|
435
|
+
* @throws If autoplay is blocked (video provider)
|
|
94
436
|
*/
|
|
95
|
-
|
|
437
|
+
start(): Promise<void>;
|
|
96
438
|
/**
|
|
97
|
-
*
|
|
439
|
+
* Pause playback
|
|
98
440
|
*/
|
|
99
|
-
|
|
441
|
+
pause(): void;
|
|
442
|
+
/**
|
|
443
|
+
* Stop playback and reset to beginning
|
|
444
|
+
*/
|
|
445
|
+
stop(): void;
|
|
446
|
+
/**
|
|
447
|
+
* Seek to a specific position
|
|
448
|
+
* @param position - Target position in seconds
|
|
449
|
+
* @returns Actual position after seek
|
|
450
|
+
*/
|
|
451
|
+
seek(position: number): Promise<number>;
|
|
452
|
+
/**
|
|
453
|
+
* Switch to a different timeline
|
|
454
|
+
* @param uri - Timeline URI to switch to
|
|
455
|
+
* @param position - Optional starting position
|
|
456
|
+
*/
|
|
457
|
+
switchTimeline(uri: string, position?: number): Promise<void>;
|
|
100
458
|
}
|
|
101
459
|
/**
|
|
102
460
|
* Describes an object that acts as a registry for imported resources.
|
|
@@ -116,7 +474,7 @@ interface IResourceImporter extends ISimpleResourceImporter {
|
|
|
116
474
|
interface IConfigurationResolver {
|
|
117
475
|
process(configuration: IEngineConfiguration, actionRegistryListener?: IEventbusListener): [Record<string, IAction>, IResolvedEngineConfiguration];
|
|
118
476
|
}
|
|
119
|
-
type TResultCallback<T
|
|
477
|
+
type TResultCallback<T> = (result: T) => void;
|
|
120
478
|
/**
|
|
121
479
|
* Describes a duration of time expressed in a start and an optional end range with a one second interval.
|
|
122
480
|
*/
|
|
@@ -133,12 +491,20 @@ interface IStrictDuration extends Required<IDuration> {}
|
|
|
133
491
|
*/
|
|
134
492
|
type TimelineTypes = 'animation' | 'mediaplayer';
|
|
135
493
|
/**
|
|
494
|
+
* Contains the decomposed components for a timeline provider.
|
|
136
495
|
*
|
|
496
|
+
* Timeline providers are assembled from:
|
|
497
|
+
* - Position source: drives timeline position (required)
|
|
498
|
+
* - Container provider: manages render container (optional)
|
|
499
|
+
* - Playlist: manages multi-item navigation (optional)
|
|
137
500
|
*/
|
|
138
501
|
interface ITimelineProviderInfo {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
provider
|
|
502
|
+
/** The position source driving timeline position */
|
|
503
|
+
positionSource: IPositionSource;
|
|
504
|
+
/** Optional container provider for DOM element management */
|
|
505
|
+
containerProvider?: IContainerProvider;
|
|
506
|
+
/** Optional playlist for multi-item timelines */
|
|
507
|
+
playlist?: IPlaylist;
|
|
142
508
|
}
|
|
143
509
|
interface ILanguageLabel {
|
|
144
510
|
id: string;
|
|
@@ -175,7 +541,7 @@ interface ISubtitle {
|
|
|
175
541
|
duration: IStrictDuration;
|
|
176
542
|
text: string;
|
|
177
543
|
}
|
|
178
|
-
type RequireKeys<T
|
|
544
|
+
type RequireKeys<T, K$1 extends keyof T> = { [P in K$1]-?: T[P] };
|
|
179
545
|
//#endregion
|
|
180
546
|
//#region src/eventbus/events/language-change.d.ts
|
|
181
547
|
/**
|
|
@@ -248,11 +614,12 @@ interface RequestCurrentNavigationEvent {
|
|
|
248
614
|
//#region src/eventbus/events/request-current-timeline-position.d.ts
|
|
249
615
|
/**
|
|
250
616
|
* Event: request-current-timeline-position
|
|
617
|
+
* @param callback - Callback that receives the current timeline position
|
|
251
618
|
* @category Engine Request
|
|
252
619
|
*/
|
|
253
620
|
interface RequestCurrentTimelinePositionEvent {
|
|
254
621
|
name: 'request-current-timeline-position';
|
|
255
|
-
args: [];
|
|
622
|
+
args: [callback: TResultCallback<number>];
|
|
256
623
|
}
|
|
257
624
|
//#endregion
|
|
258
625
|
//#region src/eventbus/events/request-current-video-position.d.ts
|
|
@@ -338,11 +705,13 @@ interface RequestTimelineCleanupEvent {
|
|
|
338
705
|
//#region src/eventbus/events/request-timeline-uri.d.ts
|
|
339
706
|
/**
|
|
340
707
|
* Event: request-timeline-uri
|
|
708
|
+
* @param uri - The timeline URI to load
|
|
709
|
+
* @param position - Optional start position (defaults to 0)
|
|
341
710
|
* @category Engine Request
|
|
342
711
|
*/
|
|
343
712
|
interface RequestTimelineUriEvent {
|
|
344
713
|
name: 'request-timeline-uri';
|
|
345
|
-
args: [];
|
|
714
|
+
args: [uri: string, position?: number];
|
|
346
715
|
}
|
|
347
716
|
//#endregion
|
|
348
717
|
//#region src/eventbus/events/request-video-cleanup.d.ts
|
|
@@ -485,11 +854,12 @@ interface PlayEvent {
|
|
|
485
854
|
//#region src/eventbus/events/timeline-request-current-timeline.d.ts
|
|
486
855
|
/**
|
|
487
856
|
* Event: timeline-request-current-timeline
|
|
857
|
+
* @param callback - Callback that receives the current timeline URI
|
|
488
858
|
* @category Engine Request
|
|
489
859
|
*/
|
|
490
860
|
interface RequestCurrentTimelineEvent {
|
|
491
861
|
name: 'timeline-request-current-timeline';
|
|
492
|
-
args: [];
|
|
862
|
+
args: [callback: TResultCallback<string>];
|
|
493
863
|
}
|
|
494
864
|
//#endregion
|
|
495
865
|
//#region src/eventbus/events/timeline-resize-request.d.ts
|
|
@@ -608,6 +978,7 @@ type EventName = keyof EventMap;
|
|
|
608
978
|
//#region src/eventbus/types.d.ts
|
|
609
979
|
type TEventHandler = (...args: any[]) => void;
|
|
610
980
|
type TEventbusRemover = () => void;
|
|
981
|
+
type TRequestResponder<T = unknown> = (...args: any[]) => T;
|
|
611
982
|
interface IEventbus {
|
|
612
983
|
clear(): void;
|
|
613
984
|
on<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
|
|
@@ -615,6 +986,35 @@ interface IEventbus {
|
|
|
615
986
|
once<E extends EventName>(eventName: E, eventHandler: (...args: EventMap[E]) => void, eventTopic?: string): TEventbusRemover;
|
|
616
987
|
broadcast<E extends EventName>(eventName: E, args: EventMap[E]): void;
|
|
617
988
|
broadcastForTopic<E extends EventName>(eventName: E, eventTopic: string, args: EventMap[E]): void;
|
|
989
|
+
/**
|
|
990
|
+
* Register a responder for synchronous request/response queries.
|
|
991
|
+
* Only the first registered responder for an event will be called.
|
|
992
|
+
*
|
|
993
|
+
* @param eventName - The request event name
|
|
994
|
+
* @param responder - Function that returns the response value
|
|
995
|
+
* @param eventTopic - Optional topic for topic-specific responders
|
|
996
|
+
* @returns Function to unregister the responder
|
|
997
|
+
*/
|
|
998
|
+
onRequest<T>(eventName: string, responder: TRequestResponder<T>, eventTopic?: string): TEventbusRemover;
|
|
999
|
+
/**
|
|
1000
|
+
* Send a synchronous request and get an immediate response.
|
|
1001
|
+
* Returns undefined if no responder is registered.
|
|
1002
|
+
*
|
|
1003
|
+
* @param eventName - The request event name
|
|
1004
|
+
* @param args - Arguments to pass to the responder
|
|
1005
|
+
* @returns The response value, or undefined if no responder
|
|
1006
|
+
*/
|
|
1007
|
+
request<T>(eventName: string, ...args: unknown[]): T | undefined;
|
|
1008
|
+
/**
|
|
1009
|
+
* Send a synchronous request for a specific topic.
|
|
1010
|
+
* Returns undefined if no responder is registered for that topic.
|
|
1011
|
+
*
|
|
1012
|
+
* @param eventName - The request event name
|
|
1013
|
+
* @param eventTopic - The topic to target
|
|
1014
|
+
* @param args - Arguments to pass to the responder
|
|
1015
|
+
* @returns The response value, or undefined if no responder
|
|
1016
|
+
*/
|
|
1017
|
+
requestForTopic<T>(eventName: string, eventTopic: string, ...args: unknown[]): T | undefined;
|
|
618
1018
|
registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover;
|
|
619
1019
|
registerInterceptor(eventName: string, interceptor: IEventbusInterceptor, eventTopic?: string): TEventbusRemover;
|
|
620
1020
|
}
|
|
@@ -637,11 +1037,37 @@ declare class ActionRegistryEventbusListener implements IEventbusListener {
|
|
|
637
1037
|
}
|
|
638
1038
|
//#endregion
|
|
639
1039
|
//#region src/eventbus/eventbus.d.ts
|
|
1040
|
+
/**
|
|
1041
|
+
* Central event bus for pub/sub communication and synchronous request/response queries.
|
|
1042
|
+
*
|
|
1043
|
+
* The eventbus supports:
|
|
1044
|
+
* - **Pub/Sub**: `on()`, `once()`, `off()`, `broadcast()`, `broadcastForTopic()`
|
|
1045
|
+
* - **Request/Response**: `onRequest()`, `request()`, `requestForTopic()` for synchronous queries
|
|
1046
|
+
* - **Interceptors**: Transform event arguments before handlers receive them
|
|
1047
|
+
* - **Listeners**: Global event observers for logging/debugging
|
|
1048
|
+
*
|
|
1049
|
+
* @example Pub/Sub pattern
|
|
1050
|
+
* ```ts
|
|
1051
|
+
* const remover = eventbus.on('timeline-play', () => console.log('Playing'));
|
|
1052
|
+
* eventbus.broadcast('timeline-play', []);
|
|
1053
|
+
* remover(); // Unsubscribe
|
|
1054
|
+
* ```
|
|
1055
|
+
*
|
|
1056
|
+
* @example Request/Response pattern
|
|
1057
|
+
* ```ts
|
|
1058
|
+
* eventbus.onRequest('request-instance', (name) => new MyClass(name));
|
|
1059
|
+
* const instance = eventbus.request<MyClass>('request-instance', 'test');
|
|
1060
|
+
* ```
|
|
1061
|
+
*/
|
|
640
1062
|
declare class Eventbus implements IEventbus {
|
|
641
1063
|
private eventHandlers;
|
|
642
1064
|
private eventInterceptors;
|
|
643
1065
|
private eventListeners;
|
|
1066
|
+
private requestResponders;
|
|
644
1067
|
constructor();
|
|
1068
|
+
/**
|
|
1069
|
+
* Clears all handlers, listeners, interceptors, and request responders.
|
|
1070
|
+
*/
|
|
645
1071
|
clear(): void;
|
|
646
1072
|
_getEventInterceptors(eventName: string, eventTopic?: string): IEventbusInterceptor[];
|
|
647
1073
|
_getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[];
|
|
@@ -652,6 +1078,11 @@ declare class Eventbus implements IEventbus {
|
|
|
652
1078
|
broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void;
|
|
653
1079
|
registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover;
|
|
654
1080
|
registerInterceptor(eventName: string, interceptor: IEventbusInterceptor, eventTopic?: string): TEventbusRemover;
|
|
1081
|
+
onRequest<T>(eventName: string, responder: TRequestResponder<T>, eventTopic?: string): TEventbusRemover;
|
|
1082
|
+
request<T>(eventName: string, ...args: unknown[]): T | undefined;
|
|
1083
|
+
requestForTopic<T>(eventName: string, eventTopic: string, ...args: unknown[]): T | undefined;
|
|
1084
|
+
private _getRequestResponders;
|
|
1085
|
+
private _callResponder;
|
|
655
1086
|
_callHandlers(eventName: string, eventTopic: string | undefined, args?: any): void;
|
|
656
1087
|
}
|
|
657
1088
|
//#endregion
|
|
@@ -701,7 +1132,7 @@ declare class RequestVideoUriInterceptor implements IEventbusInterceptor {
|
|
|
701
1132
|
//#endregion
|
|
702
1133
|
//#region src/operation/types.d.ts
|
|
703
1134
|
type TOperationData = Record<string, any>;
|
|
704
|
-
type TOperationResult<T
|
|
1135
|
+
type TOperationResult<T = TOperationData> = Promise<T> | T;
|
|
705
1136
|
interface IOperationScope {
|
|
706
1137
|
/**
|
|
707
1138
|
* When inside a loop, this is the current iteration of said loop
|
|
@@ -756,14 +1187,14 @@ interface IOperationScope {
|
|
|
756
1187
|
*/
|
|
757
1188
|
variables?: Record<string, unknown>;
|
|
758
1189
|
}
|
|
759
|
-
type TOperation<T
|
|
760
|
-
type ExtractOperationData<T
|
|
761
|
-
type ExtractReturnedOperationData<T
|
|
1190
|
+
type TOperation<T extends TOperationData = TOperationData, RT = T> = (this: IOperationScope, operationData: T) => TOperationResult<RT>;
|
|
1191
|
+
type ExtractOperationData<T extends TOperation<TOperationData>> = T extends TOperation<infer K> ? K : never;
|
|
1192
|
+
type ExtractReturnedOperationData<T extends TOperation<TOperationData, TOperationData>> = T extends TOperation<any, infer K> ? unknown extends K ? ExtractOperationData<T> : K : never;
|
|
762
1193
|
//#endregion
|
|
763
1194
|
//#region src/controllers/types.d.ts
|
|
764
|
-
interface IController<T
|
|
1195
|
+
interface IController<T extends TOperationData> {
|
|
765
1196
|
name: string;
|
|
766
|
-
init(operationData: T
|
|
1197
|
+
init(operationData: T): void;
|
|
767
1198
|
attach(eventbus: IEventbus): Promise<any> | void;
|
|
768
1199
|
detach(eventbus: IEventbus): void;
|
|
769
1200
|
}
|
|
@@ -838,8 +1269,8 @@ declare class DOMEventListenerController implements IController<IDOMEventListene
|
|
|
838
1269
|
* }
|
|
839
1270
|
* ```
|
|
840
1271
|
*/
|
|
841
|
-
declare abstract class BaseController<T
|
|
842
|
-
operationData: T
|
|
1272
|
+
declare abstract class BaseController<T extends TOperationData> implements IController<T> {
|
|
1273
|
+
operationData: T | null;
|
|
843
1274
|
abstract name: string;
|
|
844
1275
|
protected eventListeners: TEventbusRemover[];
|
|
845
1276
|
/**
|
|
@@ -867,7 +1298,7 @@ declare abstract class BaseController<T$1 extends TOperationData> implements ICo
|
|
|
867
1298
|
* @param _eventbus - The eventbus (ignored, included for IController compatibility)
|
|
868
1299
|
*/
|
|
869
1300
|
detach(_eventbus: IEventbus): void;
|
|
870
|
-
abstract init(operationData: T
|
|
1301
|
+
abstract init(operationData: T): void;
|
|
871
1302
|
abstract attach(eventbus: IEventbus): Promise<any> | void;
|
|
872
1303
|
}
|
|
873
1304
|
//#endregion
|
|
@@ -1271,7 +1702,7 @@ interface IAddClassOperationData {
|
|
|
1271
1702
|
declare const addClass: TOperation<IAddClassOperationData, Omit<IAddClassOperationData, 'className'>>;
|
|
1272
1703
|
//#endregion
|
|
1273
1704
|
//#region src/operation/add-controller-to-element.d.ts
|
|
1274
|
-
type IAddControllerToElementOperationData<T
|
|
1705
|
+
type IAddControllerToElementOperationData<T extends TOperationData = TOperationData> = {
|
|
1275
1706
|
/**
|
|
1276
1707
|
* @dependency
|
|
1277
1708
|
*/
|
|
@@ -1279,8 +1710,8 @@ type IAddControllerToElementOperationData<T$1 extends TOperationData = TOperatio
|
|
|
1279
1710
|
/**
|
|
1280
1711
|
* @dependency
|
|
1281
1712
|
*/
|
|
1282
|
-
controllerInstance: IController<T
|
|
1283
|
-
} & T
|
|
1713
|
+
controllerInstance: IController<T>;
|
|
1714
|
+
} & T;
|
|
1284
1715
|
/**
|
|
1285
1716
|
* This operation adds the specified controller instance to the given selected element.
|
|
1286
1717
|
*
|
|
@@ -1611,13 +2042,13 @@ declare const continueForEach: TOperation<TOperationData>;
|
|
|
1611
2042
|
//#endregion
|
|
1612
2043
|
//#region src/operation/create-element.d.ts
|
|
1613
2044
|
type TTagNames = keyof HTMLElementTagNameMap;
|
|
1614
|
-
interface ICreateElementOperationData<T
|
|
2045
|
+
interface ICreateElementOperationData<T extends TTagNames> {
|
|
1615
2046
|
/**
|
|
1616
2047
|
* @type=ParameterType:htmlElementName
|
|
1617
2048
|
* @required
|
|
1618
2049
|
* @erased
|
|
1619
2050
|
*/
|
|
1620
|
-
elementName: T
|
|
2051
|
+
elementName: T;
|
|
1621
2052
|
/**
|
|
1622
2053
|
* @erased
|
|
1623
2054
|
*/
|
|
@@ -1626,7 +2057,7 @@ interface ICreateElementOperationData<T$1 extends TTagNames> {
|
|
|
1626
2057
|
* @type=ParameterType:object
|
|
1627
2058
|
* @erased
|
|
1628
2059
|
*/
|
|
1629
|
-
attributes?: Partial<HTMLElementTagNameMap[T
|
|
2060
|
+
attributes?: Partial<HTMLElementTagNameMap[T]>;
|
|
1630
2061
|
/**
|
|
1631
2062
|
* @type=ParameterType:object
|
|
1632
2063
|
* @output
|
|
@@ -3651,11 +4082,11 @@ declare namespace index_d_exports$3 {
|
|
|
3651
4082
|
type Controllers = typeof index_d_exports$4;
|
|
3652
4083
|
type TControllerName = keyof Controllers;
|
|
3653
4084
|
type TControllerType = Controllers[TControllerName];
|
|
3654
|
-
type GetControllerByName<T
|
|
4085
|
+
type GetControllerByName<T extends TControllerName> = Controllers[T];
|
|
3655
4086
|
type Operations = typeof index_d_exports$3;
|
|
3656
4087
|
type TOperationName = keyof Operations;
|
|
3657
4088
|
type TOperationType = Operations[TOperationName];
|
|
3658
|
-
type GetOperationByName<T
|
|
4089
|
+
type GetOperationByName<T extends TOperationName> = Operations[T];
|
|
3659
4090
|
type ExtractOperationDataType<P$1> = P$1 extends TOperation<infer T, any> ? T : never;
|
|
3660
4091
|
interface IEngineInfo {
|
|
3661
4092
|
systemName: string;
|
|
@@ -3701,12 +4132,167 @@ interface IResolvedEndableActionConfiguration extends IResolvedActionConfigurati
|
|
|
3701
4132
|
endOperations: IResolvedOperation[];
|
|
3702
4133
|
}
|
|
3703
4134
|
type ITimelineFlow = Record<string, never>;
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
4135
|
+
/**
|
|
4136
|
+
* Configuration for a position source.
|
|
4137
|
+
*
|
|
4138
|
+
* Position sources drive timeline position. They are resolved dynamically
|
|
4139
|
+
* via the resource importer using the `systemName` property.
|
|
4140
|
+
*
|
|
4141
|
+
* Built-in position sources:
|
|
4142
|
+
* - `RafPositionSource`: RAF-based, drives timeline by elapsed time
|
|
4143
|
+
* - `ScrollPositionSource`: Scroll-based, drives timeline by scroll position
|
|
4144
|
+
* - `VideoPositionSource`: Video.js-based, drives timeline by video playback
|
|
4145
|
+
*
|
|
4146
|
+
* @example
|
|
4147
|
+
* ```typescript
|
|
4148
|
+
* // RAF-based position source
|
|
4149
|
+
* const rafConfig: IPositionSourceConfig = {
|
|
4150
|
+
* systemName: 'RafPositionSource',
|
|
4151
|
+
* tickInterval: 1000,
|
|
4152
|
+
* };
|
|
4153
|
+
*
|
|
4154
|
+
* // Scroll-based position source
|
|
4155
|
+
* const scrollConfig: IPositionSourceConfig = {
|
|
4156
|
+
* systemName: 'ScrollPositionSource',
|
|
4157
|
+
* selector: '.scroll-container',
|
|
4158
|
+
* };
|
|
4159
|
+
*
|
|
4160
|
+
* // Video-based position source
|
|
4161
|
+
* const videoConfig: IPositionSourceConfig = {
|
|
4162
|
+
* systemName: 'VideoPositionSource',
|
|
4163
|
+
* selector: '#video-player',
|
|
4164
|
+
* poster: '/poster.jpg',
|
|
4165
|
+
* };
|
|
4166
|
+
* ```
|
|
4167
|
+
*/
|
|
4168
|
+
interface IPositionSourceConfig {
|
|
4169
|
+
/**
|
|
4170
|
+
* Name of the position source class to instantiate.
|
|
4171
|
+
* Resolved via the resource importer.
|
|
4172
|
+
*
|
|
4173
|
+
* Built-in options: 'RafPositionSource', 'ScrollPositionSource', 'VideoPositionSource'
|
|
4174
|
+
*/
|
|
3707
4175
|
systemName: string;
|
|
4176
|
+
/**
|
|
4177
|
+
* CSS selector for sources that need a DOM element (scroll, video).
|
|
4178
|
+
*/
|
|
3708
4179
|
selector?: string;
|
|
4180
|
+
/**
|
|
4181
|
+
* Interval between position updates in milliseconds (RAF sources).
|
|
4182
|
+
* @default 1000
|
|
4183
|
+
*/
|
|
4184
|
+
tickInterval?: number;
|
|
4185
|
+
/**
|
|
4186
|
+
* Optional poster image URL (video sources).
|
|
4187
|
+
*/
|
|
3709
4188
|
poster?: string;
|
|
4189
|
+
/**
|
|
4190
|
+
* Additional configuration options passed to the position source constructor.
|
|
4191
|
+
* Use this for custom position source implementations.
|
|
4192
|
+
*/
|
|
4193
|
+
[key: string]: unknown;
|
|
4194
|
+
}
|
|
4195
|
+
/**
|
|
4196
|
+
* Configuration for a container provider.
|
|
4197
|
+
*
|
|
4198
|
+
* Container providers manage DOM elements where timeline content is rendered.
|
|
4199
|
+
* They are resolved dynamically via the resource importer using `systemName`.
|
|
4200
|
+
*
|
|
4201
|
+
* Built-in container providers:
|
|
4202
|
+
* - `DomContainerProvider`: Manages a DOM element by selector
|
|
4203
|
+
*
|
|
4204
|
+
* @example
|
|
4205
|
+
* ```typescript
|
|
4206
|
+
* const config: IContainerProviderConfig = {
|
|
4207
|
+
* systemName: 'DomContainerProvider',
|
|
4208
|
+
* selector: '#render-area',
|
|
4209
|
+
* };
|
|
4210
|
+
* ```
|
|
4211
|
+
*/
|
|
4212
|
+
interface IContainerProviderConfig {
|
|
4213
|
+
/**
|
|
4214
|
+
* Name of the container provider class to instantiate.
|
|
4215
|
+
* Resolved via the resource importer.
|
|
4216
|
+
*
|
|
4217
|
+
* Built-in options: 'DomContainerProvider'
|
|
4218
|
+
*/
|
|
4219
|
+
systemName: string;
|
|
4220
|
+
/** CSS selector for the container element */
|
|
4221
|
+
selector: string;
|
|
4222
|
+
/**
|
|
4223
|
+
* Additional configuration options passed to the container provider constructor.
|
|
4224
|
+
* Use this for custom container provider implementations.
|
|
4225
|
+
*/
|
|
4226
|
+
[key: string]: unknown;
|
|
4227
|
+
}
|
|
4228
|
+
/**
|
|
4229
|
+
* Configuration for a playlist.
|
|
4230
|
+
*
|
|
4231
|
+
* Playlists manage collections of items (e.g., video chapters) that can be
|
|
4232
|
+
* selected and navigated. They are resolved dynamically via the resource
|
|
4233
|
+
* importer using `systemName`.
|
|
4234
|
+
*
|
|
4235
|
+
* Built-in playlists:
|
|
4236
|
+
* - `SimplePlaylist`: Basic playlist with array of items
|
|
4237
|
+
*
|
|
4238
|
+
* @typeParam TItem - The type of items in the playlist
|
|
4239
|
+
*
|
|
4240
|
+
* @example
|
|
4241
|
+
* ```typescript
|
|
4242
|
+
* const config: IPlaylistConfig = {
|
|
4243
|
+
* systemName: 'SimplePlaylist',
|
|
4244
|
+
* items: [{ uri: '/video1.mp4' }, { uri: '/video2.mp4' }],
|
|
4245
|
+
* identifierKey: 'uri',
|
|
4246
|
+
* };
|
|
4247
|
+
* ```
|
|
4248
|
+
*/
|
|
4249
|
+
interface IPlaylistConfig<TItem = unknown> {
|
|
4250
|
+
/**
|
|
4251
|
+
* Name of the playlist class to instantiate.
|
|
4252
|
+
* Resolved via the resource importer.
|
|
4253
|
+
*
|
|
4254
|
+
* Built-in options: 'SimplePlaylist'
|
|
4255
|
+
*/
|
|
4256
|
+
systemName: string;
|
|
4257
|
+
/** The items in the playlist */
|
|
4258
|
+
items: TItem[];
|
|
4259
|
+
/**
|
|
4260
|
+
* Property key used to identify items.
|
|
4261
|
+
* Used when selecting items by identifier (e.g., 'uri', 'id', 'chapterId').
|
|
4262
|
+
*/
|
|
4263
|
+
identifierKey: string;
|
|
4264
|
+
/**
|
|
4265
|
+
* Additional configuration options passed to the playlist constructor.
|
|
4266
|
+
* Use this for custom playlist implementations.
|
|
4267
|
+
*/
|
|
4268
|
+
[key: string]: unknown;
|
|
4269
|
+
}
|
|
4270
|
+
/**
|
|
4271
|
+
* Settings for a timeline provider.
|
|
4272
|
+
*
|
|
4273
|
+
* Timeline providers are assembled from decomposed components:
|
|
4274
|
+
* - Position source: drives timeline position (required)
|
|
4275
|
+
* - Container provider: manages render container (optional)
|
|
4276
|
+
* - Playlist: manages multi-item navigation (optional)
|
|
4277
|
+
*
|
|
4278
|
+
* All components are resolved dynamically via the resource importer using
|
|
4279
|
+
* the `systemName` property, allowing custom implementations.
|
|
4280
|
+
*
|
|
4281
|
+
* @example
|
|
4282
|
+
* ```typescript
|
|
4283
|
+
* const settings: ITimelineProviderSettings = {
|
|
4284
|
+
* positionSource: { systemName: 'RafPositionSource', tickInterval: 1000 },
|
|
4285
|
+
* container: { systemName: 'DomContainerProvider', selector: '#render-area' },
|
|
4286
|
+
* };
|
|
4287
|
+
* ```
|
|
4288
|
+
*/
|
|
4289
|
+
interface ITimelineProviderSettings {
|
|
4290
|
+
/** Configuration for the position source */
|
|
4291
|
+
positionSource: IPositionSourceConfig;
|
|
4292
|
+
/** Optional container provider configuration */
|
|
4293
|
+
container?: IContainerProviderConfig;
|
|
4294
|
+
/** Optional playlist configuration */
|
|
4295
|
+
playlist?: IPlaylistConfig;
|
|
3710
4296
|
}
|
|
3711
4297
|
interface IResolvedTimelineConfiguration {
|
|
3712
4298
|
id: string;
|
|
@@ -3716,6 +4302,11 @@ interface IResolvedTimelineConfiguration {
|
|
|
3716
4302
|
loop: boolean;
|
|
3717
4303
|
selector: string;
|
|
3718
4304
|
timelineActions: ITimelineAction[];
|
|
4305
|
+
/**
|
|
4306
|
+
* Optional container selector for the timeline.
|
|
4307
|
+
* Defaults to the timeline selector if not specified.
|
|
4308
|
+
*/
|
|
4309
|
+
container?: string;
|
|
3719
4310
|
}
|
|
3720
4311
|
interface ITimelineConfiguration {
|
|
3721
4312
|
id: string;
|
|
@@ -3725,11 +4316,17 @@ interface ITimelineConfiguration {
|
|
|
3725
4316
|
loop: boolean;
|
|
3726
4317
|
selector: string;
|
|
3727
4318
|
timelineActions: ITimelineActionConfiguration[];
|
|
4319
|
+
/**
|
|
4320
|
+
* Optional container selector for the timeline.
|
|
4321
|
+
* Defaults to the timeline selector if not specified.
|
|
4322
|
+
* Used by position sources that don't have an intrinsic container.
|
|
4323
|
+
*/
|
|
4324
|
+
container?: string;
|
|
3728
4325
|
}
|
|
3729
|
-
interface IOperationConfiguration<T
|
|
4326
|
+
interface IOperationConfiguration<T extends TOperationData> {
|
|
3730
4327
|
id: string;
|
|
3731
4328
|
systemName: string;
|
|
3732
|
-
operationData?: T
|
|
4329
|
+
operationData?: T;
|
|
3733
4330
|
}
|
|
3734
4331
|
interface IEventActionConfiguration extends IActionConfiguration {
|
|
3735
4332
|
eventName: string;
|
|
@@ -3805,16 +4402,123 @@ declare class TimelineAction extends EndableAction implements ITimelineAction {
|
|
|
3805
4402
|
end(initOperationData: TOperationData): Promise<TOperationData>;
|
|
3806
4403
|
}
|
|
3807
4404
|
//#endregion
|
|
3808
|
-
//#region src/
|
|
4405
|
+
//#region src/adapters/types.d.ts
|
|
3809
4406
|
/**
|
|
3810
|
-
*
|
|
3811
|
-
|
|
4407
|
+
* Adapter interface for connecting components to the eventbus
|
|
4408
|
+
*/
|
|
4409
|
+
interface IAdapter {
|
|
4410
|
+
/** Connect adapter - start listening and forwarding */
|
|
4411
|
+
connect(): void;
|
|
4412
|
+
/** Disconnect adapter - stop all listeners */
|
|
4413
|
+
disconnect(): void;
|
|
4414
|
+
}
|
|
4415
|
+
//#endregion
|
|
4416
|
+
//#region src/adapters/engine-eventbus-adapter.d.ts
|
|
4417
|
+
/**
|
|
4418
|
+
* Bridges EligiusEngine to/from the eventbus.
|
|
4419
|
+
*
|
|
4420
|
+
* This adapter:
|
|
4421
|
+
* - Forwards engine events to eventbus broadcasts
|
|
4422
|
+
* - Forwards eventbus commands to engine methods
|
|
4423
|
+
* - Handles eventbus state queries by reading engine properties
|
|
4424
|
+
*/
|
|
4425
|
+
declare class EngineEventbusAdapter implements IAdapter {
|
|
4426
|
+
private _engine;
|
|
4427
|
+
private _eventbus;
|
|
4428
|
+
private _engineEventRemovers;
|
|
4429
|
+
private _eventbusRemovers;
|
|
4430
|
+
constructor(_engine: IEligiusEngine, _eventbus: IEventbus);
|
|
4431
|
+
/**
|
|
4432
|
+
* Connect adapter - start listening and forwarding
|
|
4433
|
+
*/
|
|
4434
|
+
connect(): void;
|
|
4435
|
+
/**
|
|
4436
|
+
* Disconnect adapter - stop all listeners
|
|
4437
|
+
*/
|
|
4438
|
+
disconnect(): void;
|
|
4439
|
+
private _subscribeToEngineEvents;
|
|
4440
|
+
private _onEngineEvent;
|
|
4441
|
+
private _subscribeToEventbusEvents;
|
|
4442
|
+
private _onEventbusEvent;
|
|
4443
|
+
private _registerRequest;
|
|
4444
|
+
}
|
|
4445
|
+
//#endregion
|
|
4446
|
+
//#region src/adapters/engine-input-adapter.d.ts
|
|
4447
|
+
/**
|
|
4448
|
+
* Handles external input sources (hotkeys, resize).
|
|
4449
|
+
*
|
|
4450
|
+
* This adapter:
|
|
4451
|
+
* - Registers keyboard hotkeys (space for play/pause toggle)
|
|
4452
|
+
* - Handles window resize events with debouncing
|
|
4453
|
+
*/
|
|
4454
|
+
declare class EngineInputAdapter implements IAdapter {
|
|
4455
|
+
private _engine;
|
|
4456
|
+
private _eventbus;
|
|
4457
|
+
private _windowRef;
|
|
4458
|
+
private _removers;
|
|
4459
|
+
private _resizeTimeout;
|
|
4460
|
+
private _resizeHandler;
|
|
4461
|
+
constructor(_engine: IEligiusEngine, _eventbus: IEventbus, _windowRef: Window);
|
|
4462
|
+
/**
|
|
4463
|
+
* Connect adapter - start listening to inputs
|
|
4464
|
+
*/
|
|
4465
|
+
connect(): void;
|
|
4466
|
+
/**
|
|
4467
|
+
* Disconnect adapter - stop all listeners
|
|
4468
|
+
*/
|
|
4469
|
+
disconnect(): void;
|
|
4470
|
+
private _registerHotkeys;
|
|
4471
|
+
private _handleSpacePress;
|
|
4472
|
+
private _registerResizeHandler;
|
|
4473
|
+
private _handleResize;
|
|
4474
|
+
}
|
|
4475
|
+
//#endregion
|
|
4476
|
+
//#region src/adapters/language-eventbus-adapter.d.ts
|
|
4477
|
+
/**
|
|
4478
|
+
* Bridges LanguageManager to/from the eventbus.
|
|
4479
|
+
*
|
|
4480
|
+
* This adapter:
|
|
4481
|
+
* - Forwards language manager events to eventbus broadcasts
|
|
4482
|
+
* - Forwards eventbus language commands to language manager methods
|
|
4483
|
+
* - Handles eventbus state queries by reading language manager properties
|
|
4484
|
+
* - Updates DOM lang attribute when language changes
|
|
4485
|
+
*
|
|
4486
|
+
* Note: Requires engine reference to update DOM lang attribute on language change
|
|
4487
|
+
*/
|
|
4488
|
+
declare class LanguageEventbusAdapter implements IAdapter {
|
|
4489
|
+
private _languageManager;
|
|
4490
|
+
private _eventbus;
|
|
4491
|
+
private _engine;
|
|
4492
|
+
private _languageEventRemovers;
|
|
4493
|
+
private _eventbusRemovers;
|
|
4494
|
+
constructor(_languageManager: ILanguageManager, _eventbus: IEventbus, _engine: IEligiusEngine);
|
|
4495
|
+
/**
|
|
4496
|
+
* Connect adapter - start listening and forwarding
|
|
4497
|
+
*/
|
|
4498
|
+
connect(): void;
|
|
4499
|
+
/**
|
|
4500
|
+
* Disconnect adapter - stop all listeners
|
|
4501
|
+
*/
|
|
4502
|
+
disconnect(): void;
|
|
4503
|
+
private _subscribeToLanguageManagerEvents;
|
|
4504
|
+
private _onLanguageEvent;
|
|
4505
|
+
private _subscribeToEventbusEvents;
|
|
4506
|
+
private _onEventbusEvent;
|
|
4507
|
+
private _registerRequest;
|
|
4508
|
+
private _setRootElementLang;
|
|
4509
|
+
private _extractPrimaryLanguage;
|
|
4510
|
+
}
|
|
4511
|
+
//#endregion
|
|
4512
|
+
//#region src/configuration/api/action-editor.d.ts
|
|
4513
|
+
/**
|
|
4514
|
+
*
|
|
4515
|
+
* A factory that assists in editing an action
|
|
3812
4516
|
*
|
|
3813
4517
|
*/
|
|
3814
|
-
declare class ActionEditor<T
|
|
3815
|
-
protected actionConfig: T
|
|
4518
|
+
declare class ActionEditor<T extends IActionConfiguration = IActionConfiguration> {
|
|
4519
|
+
protected actionConfig: T;
|
|
3816
4520
|
protected readonly configurationFactory: ConfigurationFactory;
|
|
3817
|
-
constructor(actionConfig: T
|
|
4521
|
+
constructor(actionConfig: T, configurationFactory: ConfigurationFactory);
|
|
3818
4522
|
updateConfiguration(): void;
|
|
3819
4523
|
/**
|
|
3820
4524
|
*
|
|
@@ -3823,7 +4527,7 @@ declare class ActionEditor<T$1 extends IActionConfiguration = IActionConfigurati
|
|
|
3823
4527
|
* @param callBack
|
|
3824
4528
|
* @returns
|
|
3825
4529
|
*/
|
|
3826
|
-
getConfiguration(callBack: (config: T
|
|
4530
|
+
getConfiguration(callBack: (config: T) => T | undefined): this;
|
|
3827
4531
|
/**
|
|
3828
4532
|
*
|
|
3829
4533
|
* Sets the action name
|
|
@@ -3847,7 +4551,7 @@ declare class ActionEditor<T$1 extends IActionConfiguration = IActionConfigurati
|
|
|
3847
4551
|
* @param operationData
|
|
3848
4552
|
* @returns
|
|
3849
4553
|
*/
|
|
3850
|
-
addStartOperationByType<T
|
|
4554
|
+
addStartOperationByType<T extends TOperation<TOperationData>>(operationClass: T, operationData: Partial<ExtractOperationDataType<T>>): OperationEditor<this, T>;
|
|
3851
4555
|
/**
|
|
3852
4556
|
*
|
|
3853
4557
|
* Adds the operation data for a start operation specified by the given system name
|
|
@@ -3865,7 +4569,7 @@ declare class ActionEditor<T$1 extends IActionConfiguration = IActionConfigurati
|
|
|
3865
4569
|
* @param id
|
|
3866
4570
|
* @returns
|
|
3867
4571
|
*/
|
|
3868
|
-
editStartOperation(id: string): OperationEditor<ActionEditor<T
|
|
4572
|
+
editStartOperation(id: string): OperationEditor<ActionEditor<T>, TOperation<TOperationData>>;
|
|
3869
4573
|
/**
|
|
3870
4574
|
*
|
|
3871
4575
|
* Removes the start operation associated with the given id
|
|
@@ -3896,7 +4600,7 @@ declare class ActionEditor<T$1 extends IActionConfiguration = IActionConfigurati
|
|
|
3896
4600
|
* A factory that assists in editing an endable action
|
|
3897
4601
|
*
|
|
3898
4602
|
*/
|
|
3899
|
-
declare class EndableActionEditor<T
|
|
4603
|
+
declare class EndableActionEditor<T extends IEndableActionConfiguration = IEndableActionConfiguration> extends ActionEditor<T> {
|
|
3900
4604
|
/**
|
|
3901
4605
|
*
|
|
3902
4606
|
* Adds the operation data for a end operation specified by the given type
|
|
@@ -3905,7 +4609,7 @@ declare class EndableActionEditor<T$1 extends IEndableActionConfiguration = IEnd
|
|
|
3905
4609
|
* @param operationData
|
|
3906
4610
|
* @returns
|
|
3907
4611
|
*/
|
|
3908
|
-
addEndOperationByType<T
|
|
4612
|
+
addEndOperationByType<T extends TOperationType, Dt extends Partial<ExtractOperationDataType<T>>>(operationClass: T, operationData: Dt): OperationEditor<this, TOperationType>;
|
|
3909
4613
|
/**
|
|
3910
4614
|
*
|
|
3911
4615
|
* Adds the operation data for a start operation specified by the given system name
|
|
@@ -3914,7 +4618,7 @@ declare class EndableActionEditor<T$1 extends IEndableActionConfiguration = IEnd
|
|
|
3914
4618
|
* @param operationData
|
|
3915
4619
|
* @returns
|
|
3916
4620
|
*/
|
|
3917
|
-
addEndOperation<T
|
|
4621
|
+
addEndOperation<T extends TOperationName, O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>>(systemName: TOperationName, operationData: O): OperationEditor<this, TOperation<IAddClassOperationData, Omit<IAddClassOperationData, "className">> | TOperation<IAddControllerToElementOperationData<TOperationData>> | TOperation<IAddGlobalsToOperationData, Omit<IAddGlobalsToOperationData, "globalProperties">> | TOperation<IAnimateOperationData, Omit<IAnimateOperationData, "animationEasing" | "animationProperties" | "animationDuration">> | TOperation<IAnimateWithClassOperationData, Promise<IAnimateWithClassOperationData>> | TOperation<IAnnounceToScreenReaderOperationData, Omit<IAnnounceToScreenReaderOperationData, "message" | "priority">> | TOperation<TOperationData> | TOperation<IBroadcastEventOperationData, Omit<IBroadcastEventOperationData, "eventArgs" | "eventTopic" | "eventName">> | TOperation<ICalcOperationData, Omit<ICalcOperationData, "left" | "right" | "operator">> | TOperation<IClearElementOperationData> | TOperation<IClearOperationDataOperationData, Omit<IClearOperationDataOperationData, "properties">> | TOperation<IClearStorageOperationData, Omit<IClearStorageOperationData, "key" | "storageType">> | TOperation<ICompareDateOperationData, Omit<ICompareDateOperationData, "date1" | "date2">> | TOperation<IConcatenateStringsOperationData, Omit<IConcatenateStringsOperationData, "strings" | "separator">> | TOperation<ICreateElementOperationData<keyof HTMLElementTagNameMap>, Omit<RequireKeys<ICreateElementOperationData<keyof HTMLElementTagNameMap>, "template">, "elementName" | "text" | "attributes">> | TOperation<ICustomFunctionOperationData, Omit<ICustomFunctionOperationData, "systemName">> | TOperation<IEndActionOperationData, Omit<IEndActionOperationData, "actionOperationData">> | TOperation<Record<string, unknown>> | TOperation<IExtendControllerOperationData, Omit<IExtendControllerOperationData, "controllerExtension">> | TOperation<IFilterArrayOperationData, Omit<IFilterArrayOperationData, "filterProperty" | "filterValue" | "filterPredicate">> | TOperation<IFindInArrayOperationData, Omit<IFindInArrayOperationData, "findProperty" | "findValue" | "findPredicate">> | TOperation<IForEachOperationData> | TOperation<IFormatDateOperationData, Omit<IFormatDateOperationData, "format">> | TOperation<IFormatTextOperationData, Omit<IFormatTextOperationData, "transformation">> | TOperation<IGetAttributesFromElementOperationData, Omit<IGetAttributesFromElementOperationData, "attributeNames">> | TOperation<IGetControllerFromElementOperationData, Omit<IGetControllerFromElementOperationData, "controllerName">> | TOperation<IGetControllerInstanceOperationData, Omit<IGetControllerInstanceOperationData, "systemName">> | TOperation<IGetCurrentTimeOperationData, IGetCurrentTimeOperationData> | TOperation<IGetElementDimensionsOperationData, Omit<IGetElementDimensionsOperationData, "modifier">> | TOperation<IGetFocusedElementOperationData, IGetFocusedElementOperationData> | TOperation<IGetFormDataOperationData, IGetFormDataOperationData> | TOperation<IGetImportOperationData, Omit<RequireKeys<IGetImportOperationData, "importedInstance">, "systemName">> | TOperation<IGetQueryParamsOperationData, Omit<IGetQueryParamsOperationData, "defaultValues">> | TOperation<IGetScrollPositionOperationData, IGetScrollPositionOperationData> | TOperation<IGetTextContentOperationData, IGetTextContentOperationData> | TOperation<IHttpDeleteOperationData, Omit<IHttpDeleteOperationData, "url" | "headers">> | TOperation<IHttpPostOperationData, Omit<IHttpPostOperationData, "body" | "url" | "headers">> | TOperation<IHttpPutOperationData, Omit<IHttpPutOperationData, "body" | "url" | "headers">> | TOperation<IInvokeObjectMethodOperationData, Omit<IInvokeObjectMethodOperationData, "methodName" | "methodArguments">> | TOperation<IIsElementInViewportOperationData, IIsElementInViewportOperationData> | TOperation<ILoadFromStorageOperationData, Omit<ILoadFromStorageOperationData, "storageType">> | TOperation<ILoadJSONOperationData, Omit<ILoadJSONOperationData, "url" | "cache">> | TOperation<ILogOperationData, Omit<ILogOperationData, "logValue" | "logName">> | TOperation<IMapArrayOperationData, Omit<IMapArrayOperationData, "mapFunction">> | TOperation<IMathOperationData, Omit<IMathOperationData, "args" | "functionName">> | TOperation<IRemoveClassOperationData, Omit<IRemoveClassOperationData, "className">> | TOperation<IRemoveControllerFromElementOperationData, Omit<IRemoveControllerFromElementOperationData, "controllerName">> | TOperation<IRemoveElementOperationData> | TOperation<IRemovePropertiesFromOperationDataOperationData, Omit<IRemovePropertiesFromOperationDataOperationData, "propertyNames">> | TOperation<IReparentElementOperationData, Omit<IReparentElementOperationData, "newParentSelector">> | TOperation<IReplaceStringOperationData, Omit<IReplaceStringOperationData, "pattern" | "replacement">> | TOperation<IReplaceTextOperationData, Omit<IReplaceTextOperationData, "replacement" | "searchPattern">> | TOperation<IRequestActionOperationData, Omit<Required<IRequestActionOperationData>, "systemName">> | TOperation<ISaveToStorageOperationData, Omit<ISaveToStorageOperationData, "storageType" | "value">> | TOperation<IScrollToElementOperationData, Omit<IScrollToElementOperationData, "behavior" | "block" | "inline">> | TOperation<IScrollToPositionOperationData, Omit<IScrollToPositionOperationData, "behavior" | "x" | "y">> | TOperation<ISelectElementOperationData, Omit<ISelectElementOperationData, "selector" | "useSelectedElementAsRoot">> | TOperation<ISetDataOperationData, Omit<ISetDataOperationData, "properties">> | TOperation<ISetElementAttributesOperationData, Omit<ISetElementAttributesOperationData, "attributes">> | TOperation<ISetElementContentOperationData, Omit<ISetElementContentOperationData, "template" | "insertionType">> | TOperation<ISetFocusOperationData, ISetFocusOperationData> | TOperation<ISetFormValueOperationData, Omit<ISetFormValueOperationData, "value">> | TOperation<ISetGlobalDataOperationData, Omit<ISetGlobalDataOperationData, "propertyNames">> | TOperation<ISetOperationData, Omit<ISetOperationData, "properties" | "override">> | TOperation<ISetStyleOperationData, Omit<ISetStyleOperationData, "properties">> | TOperation<ISetVariableOperationData, Omit<ISetVariableOperationData, "value" | "name">> | TOperation<ISortArrayOperationData, Omit<ISortArrayOperationData, "sortProperty" | "sortOrder" | "sortComparator">> | TOperation<ISplitStringOperationData, Omit<ISplitStringOperationData, "delimiter" | "limit">> | TOperation<IStartActionOperationData, Omit<IStartActionOperationData, "actionOperationData">> | TOperation<ISubstringTextOperationData, Omit<ISubstringTextOperationData, "start" | "end">> | TOperation<IToggleClassOperationData, Omit<IToggleClassOperationData, "className">> | TOperation<IToggleElementOperationData> | TOperation<IToggleFormElementOperationData, Omit<IToggleFormElementOperationData, "enabled">> | TOperation<IValidateFormOperationData, Omit<IValidateFormOperationData, "validationRules">> | TOperation<IWaitOperationData, Omit<IWaitOperationData, "milliseconds">> | TOperation<IWhenOperationData, Omit<IWhenOperationData, "expression">>>;
|
|
3918
4622
|
/**
|
|
3919
4623
|
*
|
|
3920
4624
|
* Starts an editor for the end operation associated with the given id
|
|
@@ -3962,10 +4666,10 @@ declare class TimelineActionEditor extends EndableActionEditor<ITimelineActionCo
|
|
|
3962
4666
|
* A factory that assists in editing an operation
|
|
3963
4667
|
*
|
|
3964
4668
|
*/
|
|
3965
|
-
declare class OperationEditor<T
|
|
4669
|
+
declare class OperationEditor<T extends ActionEditor, O extends TOperationType = TOperation<TOperationData>> {
|
|
3966
4670
|
private operationConfig;
|
|
3967
4671
|
private actionEditor;
|
|
3968
|
-
constructor(operationConfig: IOperationConfiguration<ExtractOperationDataType<O>>, actionEditor: T
|
|
4672
|
+
constructor(operationConfig: IOperationConfiguration<ExtractOperationDataType<O>>, actionEditor: T);
|
|
3969
4673
|
/**
|
|
3970
4674
|
*
|
|
3971
4675
|
* Invokes the given callback with a copy of the internal state of the factory
|
|
@@ -4027,7 +4731,7 @@ declare class OperationEditor<T$1 extends ActionEditor, O extends TOperationType
|
|
|
4027
4731
|
*
|
|
4028
4732
|
* @returns
|
|
4029
4733
|
*/
|
|
4030
|
-
next(): T
|
|
4734
|
+
next(): T;
|
|
4031
4735
|
}
|
|
4032
4736
|
//#endregion
|
|
4033
4737
|
//#region src/configuration/api/label-editor.d.ts
|
|
@@ -4070,7 +4774,14 @@ declare class TimelineProvidersSettingsEditor {
|
|
|
4070
4774
|
private providersSettings;
|
|
4071
4775
|
private configurationFactory;
|
|
4072
4776
|
constructor(providersSettings: TTimelineProviderSettings, configurationFactory: ConfigurationFactory);
|
|
4073
|
-
|
|
4777
|
+
/**
|
|
4778
|
+
* Adds a new provider for the specified timeline type.
|
|
4779
|
+
*
|
|
4780
|
+
* @param timelineType - The timeline type (e.g., 'animation', 'mediaplayer')
|
|
4781
|
+
* @param positionSourceSystemName - System name of the position source class (default: 'RafPositionSource')
|
|
4782
|
+
* @returns A TimelineProviderSettingsEditor for further configuration
|
|
4783
|
+
*/
|
|
4784
|
+
addProvider(timelineType: TimelineTypes, positionSourceSystemName?: string): TimelineProviderSettingsEditor;
|
|
4074
4785
|
editProvider(timelineType: TimelineTypes): TimelineProviderSettingsEditor;
|
|
4075
4786
|
next(): ConfigurationFactory;
|
|
4076
4787
|
}
|
|
@@ -4079,9 +4790,67 @@ declare class TimelineProviderSettingsEditor {
|
|
|
4079
4790
|
private providersSettingsEditor;
|
|
4080
4791
|
private configurationFactory;
|
|
4081
4792
|
constructor(providerSettings: ITimelineProviderSettings, providersSettingsEditor: TimelineProvidersSettingsEditor, configurationFactory: ConfigurationFactory);
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4793
|
+
/**
|
|
4794
|
+
* Sets the position source configuration with full config object.
|
|
4795
|
+
* @param config - Position source configuration with systemName and options
|
|
4796
|
+
*/
|
|
4797
|
+
setPositionSource(config: IPositionSourceConfig): this;
|
|
4798
|
+
/**
|
|
4799
|
+
* Sets the position source by system name with optional configuration.
|
|
4800
|
+
* @param systemName - The position source class name (e.g., 'RafPositionSource')
|
|
4801
|
+
* @param options - Additional options passed to the position source constructor
|
|
4802
|
+
*/
|
|
4803
|
+
setPositionSourceByName(systemName: string, options?: Record<string, unknown>): this;
|
|
4804
|
+
/**
|
|
4805
|
+
* Convenience method to set position source using shorthand type names.
|
|
4806
|
+
* @param type - Shorthand type ('raf', 'scroll', 'video')
|
|
4807
|
+
* @param options - Type-specific options
|
|
4808
|
+
* @deprecated Use setPositionSourceByName for explicit control
|
|
4809
|
+
*/
|
|
4810
|
+
setPositionSourceType(type: 'raf' | 'scroll' | 'video', options?: {
|
|
4811
|
+
selector?: string;
|
|
4812
|
+
tickInterval?: number;
|
|
4813
|
+
poster?: string;
|
|
4814
|
+
}): this;
|
|
4815
|
+
/**
|
|
4816
|
+
* Sets the container provider configuration by selector.
|
|
4817
|
+
* Uses DomContainerProvider by default.
|
|
4818
|
+
* @param selector - CSS selector for the container element
|
|
4819
|
+
*/
|
|
4820
|
+
setContainer(selector: string): this;
|
|
4821
|
+
/**
|
|
4822
|
+
* Sets the container provider configuration with full config object.
|
|
4823
|
+
* @param config - Container provider configuration with systemName
|
|
4824
|
+
*/
|
|
4825
|
+
setContainerConfig(config: IContainerProviderConfig): this;
|
|
4826
|
+
/**
|
|
4827
|
+
* Sets the container provider by system name with options.
|
|
4828
|
+
* @param systemName - The container provider class name
|
|
4829
|
+
* @param options - Additional options passed to the container provider constructor
|
|
4830
|
+
*/
|
|
4831
|
+
setContainerByName(systemName: string, options: Record<string, unknown>): this;
|
|
4832
|
+
/**
|
|
4833
|
+
* Sets the playlist configuration.
|
|
4834
|
+
* Uses SimplePlaylist by default.
|
|
4835
|
+
* @param items - Array of playlist items
|
|
4836
|
+
* @param identifierKey - Key used to identify items (default: 'uri')
|
|
4837
|
+
*/
|
|
4838
|
+
setPlaylist<T>(items: readonly T[], identifierKey?: string): this;
|
|
4839
|
+
/**
|
|
4840
|
+
* Sets the playlist configuration with full config object.
|
|
4841
|
+
* @param config - Playlist configuration with systemName
|
|
4842
|
+
*/
|
|
4843
|
+
setPlaylistConfig(config: IPlaylistConfig): this;
|
|
4844
|
+
/**
|
|
4845
|
+
* Sets the playlist by system name with options.
|
|
4846
|
+
* @param systemName - The playlist class name
|
|
4847
|
+
* @param options - Additional options including items and identifierKey
|
|
4848
|
+
*/
|
|
4849
|
+
setPlaylistByName(systemName: string, options: {
|
|
4850
|
+
items: unknown[];
|
|
4851
|
+
identifierKey: string;
|
|
4852
|
+
[key: string]: unknown;
|
|
4853
|
+
}): this;
|
|
4085
4854
|
next(): TimelineProvidersSettingsEditor;
|
|
4086
4855
|
end(): ConfigurationFactory;
|
|
4087
4856
|
}
|
|
@@ -4191,7 +4960,7 @@ declare class ConfigurationFactory {
|
|
|
4191
4960
|
* @param extensionMethod
|
|
4192
4961
|
* @returns
|
|
4193
4962
|
*/
|
|
4194
|
-
static extend<T
|
|
4963
|
+
static extend<T extends ConfigurationFactory, K$1 extends PropertyKey, C extends (this: T & { [P in K$1]: C }, ...args: any[]) => any>(factory: T, extensionMethodName: K$1, extensionMethod: C): T & { [P in K$1]: C };
|
|
4195
4964
|
/**
|
|
4196
4965
|
* Add specialized methods to a factory
|
|
4197
4966
|
*
|
|
@@ -4199,9 +4968,9 @@ declare class ConfigurationFactory {
|
|
|
4199
4968
|
* @param extensions
|
|
4200
4969
|
* @returns
|
|
4201
4970
|
*/
|
|
4202
|
-
static extendMultiple<T
|
|
4971
|
+
static extendMultiple<T extends ConfigurationFactory, C extends ConfigurationFactoryExtension<T>, D extends {
|
|
4203
4972
|
[name: string]: C;
|
|
4204
|
-
}>(factory: T
|
|
4973
|
+
}>(factory: T, extensions: D): T & D;
|
|
4205
4974
|
/**
|
|
4206
4975
|
* Initialize the configuration with a minimal shape.
|
|
4207
4976
|
*
|
|
@@ -4489,9 +5258,9 @@ declare class ActionCreatorFactory {
|
|
|
4489
5258
|
* A factory that assists in creating an action
|
|
4490
5259
|
*
|
|
4491
5260
|
*/
|
|
4492
|
-
declare class ActionCreator<T
|
|
5261
|
+
declare class ActionCreator<T extends IActionConfiguration = IActionConfiguration> {
|
|
4493
5262
|
private readonly factory;
|
|
4494
|
-
actionConfig: T
|
|
5263
|
+
actionConfig: T;
|
|
4495
5264
|
/**
|
|
4496
5265
|
*
|
|
4497
5266
|
* Initializes an action configuration with the given name
|
|
@@ -4522,7 +5291,7 @@ declare class ActionCreator<T$1 extends IActionConfiguration = IActionConfigurat
|
|
|
4522
5291
|
* @param callBack
|
|
4523
5292
|
* @returns
|
|
4524
5293
|
*/
|
|
4525
|
-
getConfiguration(callBack: (config: T
|
|
5294
|
+
getConfiguration(callBack: (config: T) => T): this;
|
|
4526
5295
|
/**
|
|
4527
5296
|
*
|
|
4528
5297
|
* Adds the operation data for a start operation specified by the given type
|
|
@@ -4531,7 +5300,7 @@ declare class ActionCreator<T$1 extends IActionConfiguration = IActionConfigurat
|
|
|
4531
5300
|
* @param operationData
|
|
4532
5301
|
* @returns
|
|
4533
5302
|
*/
|
|
4534
|
-
addStartOperationByType<T
|
|
5303
|
+
addStartOperationByType<T extends TOperationType, Dt extends Partial<ExtractOperationDataType<T>>>(operationClass: T, operationData: Dt): this;
|
|
4535
5304
|
/**
|
|
4536
5305
|
*
|
|
4537
5306
|
* Adds the operation data for a start operation specified by the given system name
|
|
@@ -4540,7 +5309,7 @@ declare class ActionCreator<T$1 extends IActionConfiguration = IActionConfigurat
|
|
|
4540
5309
|
* @param operationData
|
|
4541
5310
|
* @returns
|
|
4542
5311
|
*/
|
|
4543
|
-
addStartOperation<T
|
|
5312
|
+
addStartOperation<T extends TOperationName, O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>>(systemName: T, operationData: O): this;
|
|
4544
5313
|
/**
|
|
4545
5314
|
*
|
|
4546
5315
|
* Returns the fluent scope back to the `ActionCreatorFactory`
|
|
@@ -4554,7 +5323,7 @@ declare class ActionCreator<T$1 extends IActionConfiguration = IActionConfigurat
|
|
|
4554
5323
|
* A factory that assists in creating an endable action
|
|
4555
5324
|
*
|
|
4556
5325
|
*/
|
|
4557
|
-
declare class EndableActionCreator<T
|
|
5326
|
+
declare class EndableActionCreator<T extends IEndableActionConfiguration = IEndableActionConfiguration> extends ActionCreator<T> {
|
|
4558
5327
|
constructor(name: string | undefined, factory: ActionCreatorFactory);
|
|
4559
5328
|
/**
|
|
4560
5329
|
*
|
|
@@ -4564,7 +5333,7 @@ declare class EndableActionCreator<T$1 extends IEndableActionConfiguration = IEn
|
|
|
4564
5333
|
* @param operationData
|
|
4565
5334
|
* @returns
|
|
4566
5335
|
*/
|
|
4567
|
-
addEndOperationByType<T
|
|
5336
|
+
addEndOperationByType<T extends TOperationType, Dt extends Partial<ExtractOperationDataType<T>>>(operationClass: T, operationData: Dt): this;
|
|
4568
5337
|
/**
|
|
4569
5338
|
*
|
|
4570
5339
|
* Adds the operation data for an end operation specified by the given system name
|
|
@@ -4573,7 +5342,7 @@ declare class EndableActionCreator<T$1 extends IEndableActionConfiguration = IEn
|
|
|
4573
5342
|
* @param operationData
|
|
4574
5343
|
* @returns
|
|
4575
5344
|
*/
|
|
4576
|
-
addEndOperation<T
|
|
5345
|
+
addEndOperation<T extends TOperationName, O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>>(systemName: TOperationName, operationData: O): this;
|
|
4577
5346
|
}
|
|
4578
5347
|
/**
|
|
4579
5348
|
*
|
|
@@ -4615,13 +5384,13 @@ type TConstantParametersTypes = {
|
|
|
4615
5384
|
default?: boolean;
|
|
4616
5385
|
} & THasDescription;
|
|
4617
5386
|
type TPropertyMetadata = TComplexPropertyMetadata | TArrayProperyMetadata | TParameterTypes;
|
|
4618
|
-
type TPropertiesMetadata<T
|
|
4619
|
-
interface IOperationMetadata<T
|
|
5387
|
+
type TPropertiesMetadata<T> = { [P in keyof T]?: TPropertyMetadata };
|
|
5388
|
+
interface IOperationMetadata<T> {
|
|
4620
5389
|
category: TOperationCategory;
|
|
4621
5390
|
description: string;
|
|
4622
|
-
dependentProperties?: (keyof T
|
|
4623
|
-
properties?: TPropertiesMetadata<T
|
|
4624
|
-
outputProperties?: TPropertiesMetadata<T
|
|
5391
|
+
dependentProperties?: (keyof T)[];
|
|
5392
|
+
properties?: TPropertiesMetadata<T>;
|
|
5393
|
+
outputProperties?: TPropertiesMetadata<T>;
|
|
4625
5394
|
}
|
|
4626
5395
|
type TParameterTypesDelimited = `${TParameterTypes}` | `${TParameterTypes}|${string}`;
|
|
4627
5396
|
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';
|
|
@@ -4892,14 +5661,6 @@ declare class ControllerNamesProvider {
|
|
|
4892
5661
|
declare class OperationMetadataProvider {
|
|
4893
5662
|
getOperationMetadata(operationName: TOperationName): IOperationMetadata<TOperationData>;
|
|
4894
5663
|
}
|
|
4895
|
-
/**
|
|
4896
|
-
*
|
|
4897
|
-
* Provider for all the available event names
|
|
4898
|
-
*
|
|
4899
|
-
*/
|
|
4900
|
-
declare class TimeLineEventNamesProvider {
|
|
4901
|
-
getEventNames(): EventName[];
|
|
4902
|
-
}
|
|
4903
5664
|
//#endregion
|
|
4904
5665
|
//#region src/configuration/api/subtitle-converter.d.ts
|
|
4905
5666
|
/**
|
|
@@ -4962,10 +5723,10 @@ declare class ConfigurationResolver implements IConfigurationResolver {
|
|
|
4962
5723
|
}
|
|
4963
5724
|
//#endregion
|
|
4964
5725
|
//#region src/controllers/metadata/types.d.ts
|
|
4965
|
-
type IControllerMetadata<T
|
|
5726
|
+
type IControllerMetadata<T> = {
|
|
4966
5727
|
description: string;
|
|
4967
|
-
dependentProperties?: (keyof T
|
|
4968
|
-
properties?: Partial<Record<keyof T
|
|
5728
|
+
dependentProperties?: (keyof T)[];
|
|
5729
|
+
properties?: Partial<Record<keyof T, TPropertyMetadata>>;
|
|
4969
5730
|
};
|
|
4970
5731
|
//#endregion
|
|
4971
5732
|
//#region src/controllers/metadata/dom-event-listener-controller.d.ts
|
|
@@ -4995,52 +5756,6 @@ declare namespace index_d_exports {
|
|
|
4995
5756
|
export { DOMEventListenerController$1 as DOMEventListenerController, IControllerMetadata, LabelController$1 as LabelController, LottieController$1 as LottieController, MutationObserverController$1 as MutationObserverController, NavigationController$1 as NavigationController, ProgressbarController$1 as ProgressbarController, RoutingController$1 as RoutingController, SubtitlesController$1 as SubtitlesController };
|
|
4996
5757
|
}
|
|
4997
5758
|
//#endregion
|
|
4998
|
-
//#region src/diagnostics/types.d.ts
|
|
4999
|
-
type TDevToolsEventSubscriber = (event: TEventData) => void;
|
|
5000
|
-
type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';
|
|
5001
|
-
declare const DEV_TOOLS_KEY = "__ELIGIUS_DEV_TOOLS__";
|
|
5002
|
-
type TWindowWithDevtools = Window & {
|
|
5003
|
-
[DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;
|
|
5004
|
-
};
|
|
5005
|
-
type TDevToolsMessage = {
|
|
5006
|
-
source: 'eligius-inspect-devtools';
|
|
5007
|
-
name: 'event';
|
|
5008
|
-
data: TEventData;
|
|
5009
|
-
};
|
|
5010
|
-
type TEventData = {
|
|
5011
|
-
type: 'playcontrol';
|
|
5012
|
-
data: IPlayControlEvent;
|
|
5013
|
-
};
|
|
5014
|
-
interface IPlayControlEvent {
|
|
5015
|
-
kind: TPlayControlEventKind;
|
|
5016
|
-
args?: any[];
|
|
5017
|
-
}
|
|
5018
|
-
interface IDiagnosticsAgent {
|
|
5019
|
-
postMessage(name: TDiagnosticType, messageData: any): void;
|
|
5020
|
-
subscribe(subscriber: TDevToolsEventSubscriber): () => void;
|
|
5021
|
-
}
|
|
5022
|
-
interface IDiagnosticsInfo {
|
|
5023
|
-
get agent(): IDiagnosticsAgent;
|
|
5024
|
-
}
|
|
5025
|
-
type TDiagnosticType = 'eligius-diagnostics-factory' | 'eligius-diagnostics-engine' | 'eligius-diagnostics-event' | 'eligius-diagnostics-action' | 'eligius-diagnostics-action-error' | 'eligius-diagnostics-operation';
|
|
5026
|
-
type TDiagnosticsMessageSource = 'eligius-inspect-agent' | 'eligius-inspect-devtools';
|
|
5027
|
-
//#endregion
|
|
5028
|
-
//#region src/diagnostics/devtool-event-listener.d.ts
|
|
5029
|
-
declare class DevToolEventListener implements IEventbusListener {
|
|
5030
|
-
private agent;
|
|
5031
|
-
constructor(agent: IDiagnosticsAgent);
|
|
5032
|
-
handleEvent(eventName: string, eventTopic: string | undefined, args: any[]): void;
|
|
5033
|
-
}
|
|
5034
|
-
//#endregion
|
|
5035
|
-
//#region src/diagnostics/diagnostics.d.ts
|
|
5036
|
-
declare function send(_name: TDiagnosticType, _data: any): void;
|
|
5037
|
-
declare function setActive(value: boolean): void;
|
|
5038
|
-
declare function isActive(): boolean;
|
|
5039
|
-
declare const Diagnostics: {
|
|
5040
|
-
send: typeof send;
|
|
5041
|
-
active: boolean;
|
|
5042
|
-
};
|
|
5043
|
-
//#endregion
|
|
5044
5759
|
//#region src/eventbus/events/metadata/before-request-timeline-uri.d.ts
|
|
5045
5760
|
declare function beforeRequestTimelineUri(): IEventMetadata<BeforeRequestTimelineUriEvent['args']>;
|
|
5046
5761
|
//#endregion
|
|
@@ -5183,227 +5898,1137 @@ declare class EligiusResourceImporter implements IResourceImporter {
|
|
|
5183
5898
|
import(name: string): Record<string, any>;
|
|
5184
5899
|
}
|
|
5185
5900
|
//#endregion
|
|
5186
|
-
//#region src/timelineproviders/
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5901
|
+
//#region src/timelineproviders/position-sources/base-position-source.d.ts
|
|
5902
|
+
/**
|
|
5903
|
+
* Abstract base class for position sources.
|
|
5904
|
+
*
|
|
5905
|
+
* Provides shared state management, lifecycle handling, and callback
|
|
5906
|
+
* registration for concrete position source implementations.
|
|
5907
|
+
*
|
|
5908
|
+
* Subclasses must implement:
|
|
5909
|
+
* - `doInit()` - Source-specific initialization
|
|
5910
|
+
* - `doDestroy()` - Source-specific cleanup
|
|
5911
|
+
* - `startTicking()` - Start emitting position updates
|
|
5912
|
+
* - `stopTicking()` - Stop emitting position updates
|
|
5913
|
+
*
|
|
5914
|
+
* @example
|
|
5915
|
+
* ```typescript
|
|
5916
|
+
* class MyPositionSource extends BasePositionSource {
|
|
5917
|
+
* protected doInit(): Promise<void> {
|
|
5918
|
+
* // Initialize resources
|
|
5919
|
+
* return Promise.resolve();
|
|
5920
|
+
* }
|
|
5921
|
+
*
|
|
5922
|
+
* protected doDestroy(): void {
|
|
5923
|
+
* // Clean up resources
|
|
5924
|
+
* }
|
|
5925
|
+
*
|
|
5926
|
+
* protected startTicking(): void {
|
|
5927
|
+
* // Start position updates
|
|
5928
|
+
* }
|
|
5929
|
+
*
|
|
5930
|
+
* protected stopTicking(): void {
|
|
5931
|
+
* // Stop position updates
|
|
5932
|
+
* }
|
|
5933
|
+
* }
|
|
5934
|
+
* ```
|
|
5935
|
+
*/
|
|
5936
|
+
declare abstract class BasePositionSource implements IPositionSource {
|
|
5937
|
+
private _state;
|
|
5938
|
+
private _position;
|
|
5939
|
+
private readonly _duration;
|
|
5940
|
+
private _loop;
|
|
5941
|
+
private readonly _positionCallbacks;
|
|
5942
|
+
private readonly _boundaryCallbacks;
|
|
5943
|
+
private readonly _activatedCallbacks;
|
|
5944
|
+
/**
|
|
5945
|
+
* Create a new position source.
|
|
5946
|
+
*
|
|
5947
|
+
* @param duration - Total duration in seconds (or `Infinity` for unbounded)
|
|
5948
|
+
*/
|
|
5949
|
+
constructor(duration: number);
|
|
5950
|
+
get state(): TSourceState;
|
|
5951
|
+
get loop(): boolean;
|
|
5952
|
+
set loop(value: boolean);
|
|
5216
5953
|
init(): Promise<void>;
|
|
5217
5954
|
destroy(): void;
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
getPosition(): number;
|
|
5222
|
-
getDuration(): number;
|
|
5223
|
-
}
|
|
5224
|
-
//#endregion
|
|
5225
|
-
//#region src/timelineproviders/video-js-timeline-provider.d.ts
|
|
5226
|
-
declare class VideoJsTimelineProvider implements ITimelineProvider {
|
|
5227
|
-
private config;
|
|
5228
|
-
private _videoElementId;
|
|
5229
|
-
private _eventHandlers;
|
|
5230
|
-
private _playState;
|
|
5231
|
-
get playState(): TPlayState;
|
|
5232
|
-
loop: boolean;
|
|
5233
|
-
private _urls;
|
|
5234
|
-
private _onTime;
|
|
5235
|
-
private _onComplete;
|
|
5236
|
-
private _onRestart;
|
|
5237
|
-
private _onFirstFrame;
|
|
5238
|
-
private _player;
|
|
5239
|
-
constructor(config: IResolvedEngineConfiguration);
|
|
5240
|
-
init(): Promise<void>;
|
|
5241
|
-
private _addPlayerListener;
|
|
5242
|
-
private _handleEnded;
|
|
5243
|
-
private _handleTimeUpdate;
|
|
5244
|
-
start(): void;
|
|
5245
|
-
stop(): void;
|
|
5246
|
-
pause(): void;
|
|
5247
|
-
seek(position: number): Promise<number>;
|
|
5248
|
-
playlistItem(uri: string): void;
|
|
5955
|
+
activate(): Promise<void>;
|
|
5956
|
+
suspend(): void;
|
|
5957
|
+
deactivate(): void;
|
|
5249
5958
|
getPosition(): number;
|
|
5250
5959
|
getDuration(): number;
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5960
|
+
onPosition(callback: (position: number) => void): void;
|
|
5961
|
+
onBoundaryReached(callback: (boundary: TBoundary) => void): void;
|
|
5962
|
+
onActivated(callback: () => void): void;
|
|
5963
|
+
/**
|
|
5964
|
+
* Set the current position and emit to callbacks.
|
|
5965
|
+
*
|
|
5966
|
+
* Only emits if the source is active.
|
|
5967
|
+
*
|
|
5968
|
+
* @param position - New position value
|
|
5969
|
+
*/
|
|
5970
|
+
protected setPosition(position: number): void;
|
|
5971
|
+
/**
|
|
5972
|
+
* Emit a boundary event to all registered callbacks.
|
|
5973
|
+
*
|
|
5974
|
+
* @param boundary - The boundary type ('start' or 'end')
|
|
5975
|
+
*/
|
|
5976
|
+
protected emitBoundary(boundary: TBoundary): void;
|
|
5977
|
+
/**
|
|
5978
|
+
* Perform source-specific initialization.
|
|
5979
|
+
*
|
|
5980
|
+
* Called by `init()`. Override to load resources, bind listeners, etc.
|
|
5981
|
+
*/
|
|
5982
|
+
protected abstract doInit(): Promise<void>;
|
|
5983
|
+
/**
|
|
5984
|
+
* Perform source-specific cleanup.
|
|
5985
|
+
*
|
|
5986
|
+
* Called by `destroy()`. Override to release resources, unbind listeners, etc.
|
|
5987
|
+
*/
|
|
5988
|
+
protected abstract doDestroy(): void;
|
|
5989
|
+
/**
|
|
5990
|
+
* Start emitting position updates.
|
|
5991
|
+
*
|
|
5992
|
+
* Called when transitioning to `active` state.
|
|
5993
|
+
* Override to start timers, begin listening to events, etc.
|
|
5994
|
+
*/
|
|
5995
|
+
protected abstract startTicking(): void;
|
|
5996
|
+
/**
|
|
5997
|
+
* Stop emitting position updates.
|
|
5998
|
+
*
|
|
5999
|
+
* Called when transitioning from `active` to `suspended` or `inactive`.
|
|
6000
|
+
* Override to stop timers, pause listening, etc.
|
|
6001
|
+
*/
|
|
6002
|
+
protected abstract stopTicking(): void;
|
|
5260
6003
|
}
|
|
5261
6004
|
//#endregion
|
|
5262
|
-
//#region src/
|
|
6005
|
+
//#region src/timelineproviders/position-sources/keyboard-step-source.d.ts
|
|
5263
6006
|
/**
|
|
5264
|
-
*
|
|
5265
|
-
*
|
|
5266
|
-
* It handles the request-label-collection, request-label-collections, request-current-language and language-change events.
|
|
6007
|
+
* Vertical axis mode for keyboard navigation.
|
|
5267
6008
|
*
|
|
6009
|
+
* - `timeline-switch`: Up/Down arrows emit timeline change requests
|
|
6010
|
+
* - `chapter-navigation`: Up/Down arrows jump between markers
|
|
6011
|
+
* - `disabled`: Up/Down arrows do nothing
|
|
5268
6012
|
*/
|
|
5269
|
-
|
|
5270
|
-
private _currentLanguage;
|
|
5271
|
-
private _eventbus;
|
|
5272
|
-
private _labelLookup;
|
|
5273
|
-
private _eventbusRemovers;
|
|
5274
|
-
constructor(_currentLanguage: TLanguageCode, labels: ILanguageLabel[], _eventbus: IEventbus);
|
|
5275
|
-
destroy(): void;
|
|
5276
|
-
_addEventbusListeners(eventbus: IEventbus): void;
|
|
5277
|
-
_handleRequestCurrentLanguage(resultCallback: TResultCallback<TLanguageCode>): void;
|
|
5278
|
-
_handleRequestLabelCollection(labelId: string, resultCallback: TResultCallback<ILabel[]>): void;
|
|
5279
|
-
_handleRequestLabelCollections(labelIds: string[], resultCallback: TResultCallback<ILabel[][]>): void;
|
|
5280
|
-
_handleLanguageChange(language: TLanguageCode): void;
|
|
5281
|
-
_setRootElementLang(language: TLanguageCode): void;
|
|
5282
|
-
_extractPrimaryLanguage(culture: TLanguageCode): string;
|
|
5283
|
-
_createLabelLookup(labels: ILanguageLabel[]): Record<string, ILabel[]>;
|
|
5284
|
-
}
|
|
5285
|
-
//#endregion
|
|
5286
|
-
//#region src/eligius-engine.d.ts
|
|
5287
|
-
type ActionMethod = (IEndableAction['start'] & ActionMethodMetadata) | (IEndableAction['end'] & ActionMethodMetadata);
|
|
5288
|
-
interface ActionMethodMetadata {
|
|
5289
|
-
id: string;
|
|
5290
|
-
isStart: boolean;
|
|
5291
|
-
startPosition?: number;
|
|
5292
|
-
}
|
|
6013
|
+
type TVerticalMode = 'timeline-switch' | 'chapter-navigation' | 'disabled';
|
|
5293
6014
|
/**
|
|
5294
|
-
*
|
|
5295
|
-
* the given timeline provider and triggering the actions associated with the positions along the timeline.
|
|
6015
|
+
* Configuration for KeyboardStepSource.
|
|
5296
6016
|
*/
|
|
5297
|
-
|
|
5298
|
-
private configuration;
|
|
5299
|
-
private eventbus;
|
|
5300
|
-
private timelineProviders;
|
|
5301
|
-
private languageManager;
|
|
5302
|
-
private _timeLineActionsLookup;
|
|
5303
|
-
private _timelineLookupCache;
|
|
5304
|
-
private _eventbusRemovers;
|
|
5305
|
-
private _currentTimelineUri;
|
|
5306
|
-
private _activeTimelineProvider;
|
|
5307
|
-
private _lastPosition;
|
|
5308
|
-
constructor(configuration: IResolvedEngineConfiguration, eventbus: IEventbus, timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>, languageManager: LanguageManager);
|
|
6017
|
+
interface KeyboardStepSourceConfig {
|
|
5309
6018
|
/**
|
|
5310
|
-
*
|
|
5311
|
-
* by executing its initActions.
|
|
6019
|
+
* Total duration in seconds.
|
|
5312
6020
|
*/
|
|
5313
|
-
|
|
5314
|
-
private _createLayoutTemplate;
|
|
5315
|
-
private _initializeTimelineProvider;
|
|
5316
|
-
private _onCompleteCallback;
|
|
5317
|
-
private _onFirstFrameCallback;
|
|
5318
|
-
private _onRestartCallback;
|
|
5319
|
-
private _cleanUp;
|
|
6021
|
+
duration: number;
|
|
5320
6022
|
/**
|
|
5321
|
-
*
|
|
5322
|
-
* - It ends the currently active operations and the init actions.
|
|
5323
|
-
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
5324
|
-
* - It destroys all of its timeline providers
|
|
5325
|
-
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
5326
|
-
*
|
|
6023
|
+
* Vertical axis behavior.
|
|
5327
6024
|
*/
|
|
5328
|
-
|
|
5329
|
-
private _addEventListener;
|
|
5330
|
-
private _addEventbusListeners;
|
|
5331
|
-
private seekRequest;
|
|
5332
|
-
private durationRequest;
|
|
5333
|
-
private containerRequest;
|
|
5334
|
-
private _pauseRequest;
|
|
5335
|
-
private _stopRequest;
|
|
5336
|
-
private _playRequest;
|
|
5337
|
-
private _toggleplay;
|
|
5338
|
-
private _createTimelineLookup;
|
|
5339
|
-
static sortTimelines(timelines: Record<number, ActionMethod[]>[]): void;
|
|
5340
|
-
static sortActionsPerPosition(actions: ActionMethod[]): ActionMethod[];
|
|
5341
|
-
private _addTimelineActionStart;
|
|
5342
|
-
private _addTimelineActionEnd;
|
|
5343
|
-
private _initializeUriLookup;
|
|
5344
|
-
private _initializeTimelinePosition;
|
|
5345
|
-
private _executeActions;
|
|
5346
|
-
private _handleRequestEngineRoot;
|
|
5347
|
-
private _handleRequestTimelineUri;
|
|
5348
|
-
private _cleanUpTimeline;
|
|
5349
|
-
private _executeStartActions;
|
|
6025
|
+
verticalMode: TVerticalMode;
|
|
5350
6026
|
/**
|
|
5351
|
-
*
|
|
5352
|
-
*
|
|
5353
|
-
* @param position the given position
|
|
5354
|
-
* @param actions all of the relevant actions
|
|
5355
|
-
* @returns
|
|
6027
|
+
* Step size for Left/Right arrows in seconds.
|
|
6028
|
+
* @default 1
|
|
5356
6029
|
*/
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
6030
|
+
stepSize?: number;
|
|
6031
|
+
/**
|
|
6032
|
+
* Large step size for Shift+Left/Right arrows in seconds.
|
|
6033
|
+
* @default 10
|
|
6034
|
+
*/
|
|
6035
|
+
largeStepSize?: number;
|
|
6036
|
+
/**
|
|
6037
|
+
* Marker positions for chapter navigation mode (in seconds).
|
|
6038
|
+
* Will be auto-sorted ascending on init.
|
|
6039
|
+
*/
|
|
6040
|
+
markers?: number[];
|
|
6041
|
+
/**
|
|
6042
|
+
* Target element to scope keyboard bindings.
|
|
6043
|
+
* Can be an HTMLElement or a CSS selector string.
|
|
6044
|
+
* If not provided, bindings are global (document).
|
|
6045
|
+
*/
|
|
6046
|
+
targetElement?: HTMLElement | string;
|
|
6047
|
+
/**
|
|
6048
|
+
* Whether navigation wraps at boundaries.
|
|
6049
|
+
* @default true
|
|
6050
|
+
*/
|
|
6051
|
+
wrapNavigation?: boolean;
|
|
5368
6052
|
}
|
|
5369
|
-
//#endregion
|
|
5370
|
-
//#region src/engine-factory.d.ts
|
|
5371
6053
|
/**
|
|
5372
|
-
*
|
|
6054
|
+
* Keyboard-based position source for stepping through a timeline.
|
|
5373
6055
|
*
|
|
5374
|
-
*
|
|
6056
|
+
* Supports:
|
|
6057
|
+
* - Left/Right arrows: step by `stepSize` (default 1s)
|
|
6058
|
+
* - Shift+Left/Right: large step by `largeStepSize` (default 10s)
|
|
6059
|
+
* - Home/End: jump to start/end
|
|
6060
|
+
* - Up/Down: configurable (timeline switch, chapter navigation, or disabled)
|
|
5375
6061
|
*
|
|
5376
|
-
* @example
|
|
5377
|
-
* ```
|
|
5378
|
-
*
|
|
5379
|
-
*
|
|
6062
|
+
* @example
|
|
6063
|
+
* ```typescript
|
|
6064
|
+
* const source = new KeyboardStepSource({
|
|
6065
|
+
* duration: 60,
|
|
6066
|
+
* verticalMode: 'chapter-navigation',
|
|
6067
|
+
* markers: [0, 10, 20, 30, 40, 50],
|
|
6068
|
+
* });
|
|
5380
6069
|
*
|
|
5381
|
-
*
|
|
6070
|
+
* await source.init();
|
|
5382
6071
|
*
|
|
5383
|
-
*
|
|
6072
|
+
* source.onPosition((position) => {
|
|
6073
|
+
* console.log(`Position: ${position}s`);
|
|
6074
|
+
* });
|
|
5384
6075
|
*
|
|
5385
|
-
*
|
|
6076
|
+
* source.onMarkerJump((index, position) => {
|
|
6077
|
+
* console.log(`Jumped to marker ${index} at ${position}s`);
|
|
6078
|
+
* });
|
|
6079
|
+
*
|
|
6080
|
+
* await source.activate();
|
|
5386
6081
|
* ```
|
|
5387
6082
|
*/
|
|
5388
|
-
declare class
|
|
5389
|
-
private
|
|
5390
|
-
private
|
|
5391
|
-
private
|
|
5392
|
-
private
|
|
5393
|
-
private
|
|
5394
|
-
|
|
5395
|
-
private
|
|
5396
|
-
private
|
|
5397
|
-
|
|
5398
|
-
private
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
6083
|
+
declare class KeyboardStepSource extends BasePositionSource implements ISeekable {
|
|
6084
|
+
private readonly _stepSize;
|
|
6085
|
+
private readonly _largeStepSize;
|
|
6086
|
+
private readonly _verticalMode;
|
|
6087
|
+
private readonly _wrapNavigation;
|
|
6088
|
+
private _markers;
|
|
6089
|
+
private readonly _targetElementConfig?;
|
|
6090
|
+
private _targetElement?;
|
|
6091
|
+
private readonly _scopeId;
|
|
6092
|
+
private readonly _timelineChangeCallbacks;
|
|
6093
|
+
private readonly _markerJumpCallbacks;
|
|
6094
|
+
/**
|
|
6095
|
+
* Create a new keyboard-based position source.
|
|
6096
|
+
*
|
|
6097
|
+
* @param config - Configuration options
|
|
6098
|
+
*/
|
|
6099
|
+
constructor(config: KeyboardStepSourceConfig);
|
|
6100
|
+
protected doInit(): Promise<void>;
|
|
6101
|
+
protected doDestroy(): void;
|
|
6102
|
+
protected startTicking(): void;
|
|
6103
|
+
protected stopTicking(): void;
|
|
6104
|
+
/**
|
|
6105
|
+
* Seek to a specific position.
|
|
6106
|
+
*
|
|
6107
|
+
* Position is clamped to the valid range [0, duration].
|
|
6108
|
+
*
|
|
6109
|
+
* @param position - Target position in seconds
|
|
6110
|
+
* @returns Actual position after seek (may be clamped)
|
|
6111
|
+
*/
|
|
6112
|
+
seek(position: number): Promise<number>;
|
|
6113
|
+
/**
|
|
6114
|
+
* Register callback for timeline change requests (timeline-switch mode).
|
|
6115
|
+
*
|
|
6116
|
+
* @param callback - Called with 'prev' or 'next' when Up/Down is pressed
|
|
6117
|
+
*/
|
|
6118
|
+
onTimelineChangeRequest(callback: (direction: 'prev' | 'next') => void): void;
|
|
6119
|
+
/**
|
|
6120
|
+
* Register callback for marker jumps (chapter-navigation mode).
|
|
6121
|
+
*
|
|
6122
|
+
* @param callback - Called with marker index and position when jumping
|
|
6123
|
+
*/
|
|
6124
|
+
onMarkerJump(callback: (markerIndex: number, position: number) => void): void;
|
|
6125
|
+
/**
|
|
6126
|
+
* Bind all keyboard handlers.
|
|
6127
|
+
*/
|
|
6128
|
+
private _bindKeys;
|
|
6129
|
+
/**
|
|
6130
|
+
* Unbind all keyboard handlers.
|
|
6131
|
+
*/
|
|
6132
|
+
private _unbindKeys;
|
|
6133
|
+
private _handleStepForward;
|
|
6134
|
+
private _handleStepBackward;
|
|
6135
|
+
private _handleLargeStepForward;
|
|
6136
|
+
private _handleLargeStepBackward;
|
|
6137
|
+
private _handleJumpToStart;
|
|
6138
|
+
private _handleJumpToEnd;
|
|
6139
|
+
private _handleVerticalPrev;
|
|
6140
|
+
private _handleVerticalNext;
|
|
6141
|
+
private _emitTimelineChange;
|
|
6142
|
+
private _jumpToPreviousMarker;
|
|
6143
|
+
private _jumpToNextMarker;
|
|
6144
|
+
/**
|
|
6145
|
+
* Find the index of the current or previous marker.
|
|
6146
|
+
*
|
|
6147
|
+
* If position matches a marker exactly, returns that marker's index.
|
|
6148
|
+
* Otherwise, returns the index of the marker before the current position.
|
|
6149
|
+
* Returns 0 if before first marker.
|
|
6150
|
+
*/
|
|
6151
|
+
private _findCurrentMarkerIndex;
|
|
6152
|
+
private _emitMarkerJump;
|
|
6153
|
+
}
|
|
6154
|
+
//#endregion
|
|
6155
|
+
//#region src/timelineproviders/position-sources/raf-position-source.d.ts
|
|
6156
|
+
/**
|
|
6157
|
+
* Configuration for RafPositionSource.
|
|
6158
|
+
*/
|
|
6159
|
+
interface RafPositionSourceConfig {
|
|
6160
|
+
/**
|
|
6161
|
+
* Total duration in seconds.
|
|
6162
|
+
*/
|
|
6163
|
+
duration: number;
|
|
6164
|
+
/**
|
|
6165
|
+
* Interval between position ticks in milliseconds.
|
|
6166
|
+
* @default 1000 (1 second)
|
|
6167
|
+
*/
|
|
6168
|
+
tickInterval?: number;
|
|
6169
|
+
}
|
|
6170
|
+
/**
|
|
6171
|
+
* RequestAnimationFrame-based position source.
|
|
6172
|
+
*
|
|
6173
|
+
* Uses the `animationInterval` utility to emit position updates at a regular
|
|
6174
|
+
* interval (default: 1 second). Position increments by 1 per second, making
|
|
6175
|
+
* position values equivalent to elapsed seconds.
|
|
6176
|
+
*
|
|
6177
|
+
* Implements both `IPositionSource` (via `BasePositionSource`) and `ISeekable`.
|
|
6178
|
+
*
|
|
6179
|
+
* @example
|
|
6180
|
+
* ```typescript
|
|
6181
|
+
* const source = new RafPositionSource({ duration: 60 });
|
|
6182
|
+
* await source.init();
|
|
6183
|
+
*
|
|
6184
|
+
* source.onPosition((position) => {
|
|
6185
|
+
* console.log(`Position: ${position}s`);
|
|
6186
|
+
* });
|
|
6187
|
+
*
|
|
6188
|
+
* source.onBoundaryReached((boundary) => {
|
|
6189
|
+
* if (boundary === 'end') {
|
|
6190
|
+
* console.log('Timeline complete');
|
|
6191
|
+
* }
|
|
6192
|
+
* });
|
|
6193
|
+
*
|
|
6194
|
+
* await source.activate();
|
|
6195
|
+
*
|
|
6196
|
+
* // Seek to 30 seconds
|
|
6197
|
+
* await source.seek(30);
|
|
6198
|
+
* ```
|
|
6199
|
+
*/
|
|
6200
|
+
declare class RafPositionSource extends BasePositionSource implements ISeekable {
|
|
6201
|
+
private readonly _tickInterval;
|
|
6202
|
+
private _abortController;
|
|
6203
|
+
private _startTimeOffset;
|
|
6204
|
+
/**
|
|
6205
|
+
* Create a new RAF-based position source.
|
|
6206
|
+
*
|
|
6207
|
+
* @param config - Configuration options
|
|
6208
|
+
*/
|
|
6209
|
+
constructor(config: RafPositionSourceConfig);
|
|
6210
|
+
protected doInit(): Promise<void>;
|
|
6211
|
+
protected doDestroy(): void;
|
|
6212
|
+
protected startTicking(): void;
|
|
6213
|
+
protected stopTicking(): void;
|
|
6214
|
+
/**
|
|
6215
|
+
* Seek to a specific position.
|
|
6216
|
+
*
|
|
6217
|
+
* Position is clamped to the valid range [0, duration].
|
|
6218
|
+
*
|
|
6219
|
+
* @param position - Target position in seconds
|
|
6220
|
+
* @returns Actual position after seek (may be clamped)
|
|
6221
|
+
*/
|
|
6222
|
+
seek(position: number): Promise<number>;
|
|
6223
|
+
/**
|
|
6224
|
+
* Handle a tick from animationInterval.
|
|
6225
|
+
*
|
|
6226
|
+
* The time parameter represents elapsed milliseconds since the animation
|
|
6227
|
+
* interval started. Position is calculated in seconds, rounded to the
|
|
6228
|
+
* precision determined by tickInterval.
|
|
6229
|
+
*
|
|
6230
|
+
* @param time - Elapsed time in milliseconds from animationInterval
|
|
6231
|
+
*/
|
|
6232
|
+
private _onTick;
|
|
6233
|
+
/**
|
|
6234
|
+
* Abort the current ticking session.
|
|
6235
|
+
*/
|
|
6236
|
+
private _abortTicking;
|
|
6237
|
+
}
|
|
6238
|
+
//#endregion
|
|
6239
|
+
//#region src/timelineproviders/position-sources/scroll-position-source.d.ts
|
|
6240
|
+
/**
|
|
6241
|
+
* Configuration for ScrollPositionSource.
|
|
6242
|
+
*/
|
|
6243
|
+
interface ScrollPositionSourceConfig {
|
|
6244
|
+
/**
|
|
6245
|
+
* CSS selector for the scrollable container element.
|
|
6246
|
+
*/
|
|
6247
|
+
selector: string;
|
|
6248
|
+
/**
|
|
6249
|
+
* Duration in seconds that the scroll represents.
|
|
6250
|
+
* Position is calculated as: (scrollTop / scrollableHeight) * duration
|
|
6251
|
+
*/
|
|
6252
|
+
duration: number;
|
|
6253
|
+
}
|
|
6254
|
+
/**
|
|
6255
|
+
* Scroll-based position source.
|
|
6256
|
+
*
|
|
6257
|
+
* Maps scroll position to a timeline position. The position is calculated
|
|
6258
|
+
* as a percentage of the scroll progress multiplied by the configured duration.
|
|
6259
|
+
*
|
|
6260
|
+
* Implements `IPositionSource` and `ISeekable`.
|
|
6261
|
+
*
|
|
6262
|
+
* @example
|
|
6263
|
+
* ```typescript
|
|
6264
|
+
* const source = new ScrollPositionSource({
|
|
6265
|
+
* selector: '#scroll-container',
|
|
6266
|
+
* duration: 100, // 100 seconds timeline
|
|
6267
|
+
* });
|
|
6268
|
+
*
|
|
6269
|
+
* await source.init();
|
|
6270
|
+
*
|
|
6271
|
+
* source.onPosition((position) => {
|
|
6272
|
+
* console.log(`Scroll at ${position}s of 100s`);
|
|
6273
|
+
* });
|
|
6274
|
+
*
|
|
6275
|
+
* source.onBoundaryReached((boundary) => {
|
|
6276
|
+
* if (boundary === 'end') {
|
|
6277
|
+
* console.log('Scrolled to bottom');
|
|
6278
|
+
* }
|
|
6279
|
+
* });
|
|
6280
|
+
*
|
|
6281
|
+
* await source.activate();
|
|
6282
|
+
* ```
|
|
6283
|
+
*/
|
|
6284
|
+
declare class ScrollPositionSource extends BasePositionSource implements ISeekable {
|
|
6285
|
+
private readonly _config;
|
|
6286
|
+
private _element;
|
|
6287
|
+
private _boundScrollHandler;
|
|
6288
|
+
private _lastPosition;
|
|
6289
|
+
private _wasAtStart;
|
|
6290
|
+
/**
|
|
6291
|
+
* Create a new scroll-based position source.
|
|
6292
|
+
*
|
|
6293
|
+
* @param config - Configuration options
|
|
6294
|
+
*/
|
|
6295
|
+
constructor(config: ScrollPositionSourceConfig);
|
|
6296
|
+
protected doInit(): Promise<void>;
|
|
6297
|
+
protected doDestroy(): void;
|
|
6298
|
+
protected startTicking(): void;
|
|
6299
|
+
protected stopTicking(): void;
|
|
6300
|
+
/**
|
|
6301
|
+
* Seek to a specific position by programmatically scrolling.
|
|
6302
|
+
*
|
|
6303
|
+
* @param position - Target position in seconds (0 to duration)
|
|
6304
|
+
* @returns Actual position after scroll
|
|
6305
|
+
*/
|
|
6306
|
+
seek(position: number): Promise<number>;
|
|
6307
|
+
/**
|
|
6308
|
+
* Handle scroll events and update position.
|
|
6309
|
+
*/
|
|
6310
|
+
private _handleScroll;
|
|
6311
|
+
/**
|
|
6312
|
+
* Calculate position from scroll percentage.
|
|
6313
|
+
*/
|
|
6314
|
+
private _calculatePosition;
|
|
6315
|
+
/**
|
|
6316
|
+
* Get the scrollable height (total scroll distance).
|
|
6317
|
+
*/
|
|
6318
|
+
private _getScrollableHeight;
|
|
6319
|
+
}
|
|
6320
|
+
//#endregion
|
|
6321
|
+
//#region src/timelineproviders/position-sources/video-position-source.d.ts
|
|
6322
|
+
/**
|
|
6323
|
+
* Video source configuration for VideoPositionSource.
|
|
6324
|
+
*/
|
|
6325
|
+
interface VideoSource {
|
|
6326
|
+
/**
|
|
6327
|
+
* URL of the video file.
|
|
6328
|
+
*/
|
|
6329
|
+
src: string;
|
|
6330
|
+
/**
|
|
6331
|
+
* MIME type of the video (e.g., 'video/mp4').
|
|
6332
|
+
*/
|
|
6333
|
+
type: string;
|
|
6334
|
+
}
|
|
6335
|
+
/**
|
|
6336
|
+
* Configuration for VideoPositionSource.
|
|
6337
|
+
*/
|
|
6338
|
+
interface VideoPositionSourceConfig {
|
|
6339
|
+
/**
|
|
6340
|
+
* CSS selector for the container where the video player will be created.
|
|
6341
|
+
*/
|
|
6342
|
+
selector: string;
|
|
6343
|
+
/**
|
|
6344
|
+
* Video sources to load.
|
|
6345
|
+
*/
|
|
6346
|
+
sources: VideoSource[];
|
|
6347
|
+
/**
|
|
6348
|
+
* Optional video.js player options.
|
|
6349
|
+
*/
|
|
6350
|
+
options?: Record<string, unknown>;
|
|
6351
|
+
}
|
|
6352
|
+
/**
|
|
6353
|
+
* Video.js-based position source.
|
|
6354
|
+
*
|
|
6355
|
+
* Wraps a video.js player to provide position updates based on video playback.
|
|
6356
|
+
* Implements `IPositionSource`, `ISeekable`, and `IContainerProvider`.
|
|
6357
|
+
*
|
|
6358
|
+
* @example
|
|
6359
|
+
* ```typescript
|
|
6360
|
+
* const source = new VideoPositionSource({
|
|
6361
|
+
* selector: '#video-container',
|
|
6362
|
+
* sources: [
|
|
6363
|
+
* { src: 'video.mp4', type: 'video/mp4' },
|
|
6364
|
+
* { src: 'video.webm', type: 'video/webm' },
|
|
6365
|
+
* ],
|
|
6366
|
+
* });
|
|
6367
|
+
*
|
|
6368
|
+
* await source.init();
|
|
6369
|
+
*
|
|
6370
|
+
* source.onPosition((position) => {
|
|
6371
|
+
* console.log(`Video at ${position}s`);
|
|
6372
|
+
* });
|
|
6373
|
+
*
|
|
6374
|
+
* source.onContainerReady(() => {
|
|
6375
|
+
* console.log('Video ready for display');
|
|
6376
|
+
* });
|
|
6377
|
+
*
|
|
6378
|
+
* await source.activate();
|
|
6379
|
+
* ```
|
|
6380
|
+
*/
|
|
6381
|
+
declare class VideoPositionSource extends BasePositionSource implements ISeekable, IContainerProvider {
|
|
6382
|
+
private readonly _config;
|
|
6383
|
+
private _player;
|
|
6384
|
+
private _videoElementId;
|
|
6385
|
+
private readonly _containerReadyCallbacks;
|
|
6386
|
+
private readonly _eventHandlers;
|
|
6387
|
+
/**
|
|
6388
|
+
* Create a new video.js-based position source.
|
|
6389
|
+
*
|
|
6390
|
+
* @param config - Configuration options
|
|
6391
|
+
*/
|
|
6392
|
+
constructor(config: VideoPositionSourceConfig);
|
|
6393
|
+
protected doInit(): Promise<void>;
|
|
6394
|
+
protected doDestroy(): void;
|
|
6395
|
+
protected startTicking(): void;
|
|
6396
|
+
protected stopTicking(): void;
|
|
6397
|
+
/**
|
|
6398
|
+
* Seek to a specific position in the video.
|
|
6399
|
+
*
|
|
6400
|
+
* @param position - Target position in seconds
|
|
6401
|
+
* @returns Actual position after seek
|
|
6402
|
+
*/
|
|
6403
|
+
seek(position: number): Promise<number>;
|
|
6404
|
+
/**
|
|
6405
|
+
* Get the container element.
|
|
6406
|
+
*
|
|
6407
|
+
* @returns jQuery-wrapped container element
|
|
6408
|
+
*/
|
|
6409
|
+
getContainer(): JQuery<HTMLElement> | undefined;
|
|
6410
|
+
/**
|
|
6411
|
+
* Register a callback for when the container is ready.
|
|
6412
|
+
*
|
|
6413
|
+
* @param callback - Function called when container is ready
|
|
6414
|
+
*/
|
|
6415
|
+
onContainerReady(callback: () => void): void;
|
|
6416
|
+
/**
|
|
6417
|
+
* Get the video duration.
|
|
6418
|
+
*
|
|
6419
|
+
* @returns Duration in seconds from video.js player
|
|
6420
|
+
*/
|
|
6421
|
+
getDuration(): number;
|
|
6422
|
+
/**
|
|
6423
|
+
* Deactivate the source and reset position.
|
|
6424
|
+
*
|
|
6425
|
+
* Overrides base to also reset video currentTime.
|
|
6426
|
+
*/
|
|
6427
|
+
deactivate(): void;
|
|
6428
|
+
/**
|
|
6429
|
+
* Create the video element in the container.
|
|
6430
|
+
*/
|
|
6431
|
+
private _createVideoElement;
|
|
6432
|
+
/**
|
|
6433
|
+
* Add an event listener to the player and track for cleanup.
|
|
6434
|
+
*
|
|
6435
|
+
* @param event - Event name
|
|
6436
|
+
* @param handler - Event handler
|
|
6437
|
+
*/
|
|
6438
|
+
private _addPlayerListener;
|
|
6439
|
+
/**
|
|
6440
|
+
* Handle timeupdate event from video.js.
|
|
6441
|
+
*/
|
|
6442
|
+
private _handleTimeUpdate;
|
|
6443
|
+
/**
|
|
6444
|
+
* Handle ended event from video.js.
|
|
6445
|
+
*/
|
|
6446
|
+
private _handleEnded;
|
|
6447
|
+
/**
|
|
6448
|
+
* Notify all container ready callbacks.
|
|
6449
|
+
*/
|
|
6450
|
+
private _notifyContainerReady;
|
|
6451
|
+
}
|
|
6452
|
+
//#endregion
|
|
6453
|
+
//#region src/timelineproviders/container-providers/dom-container-provider.d.ts
|
|
6454
|
+
/**
|
|
6455
|
+
* Configuration for DomContainerProvider.
|
|
6456
|
+
*/
|
|
6457
|
+
interface DomContainerProviderConfig {
|
|
6458
|
+
/**
|
|
6459
|
+
* CSS selector for the container element.
|
|
6460
|
+
*/
|
|
6461
|
+
selector: string;
|
|
6462
|
+
}
|
|
6463
|
+
/**
|
|
6464
|
+
* DOM selector-based container provider.
|
|
6465
|
+
*
|
|
6466
|
+
* Provides access to a DOM container element via a CSS selector.
|
|
6467
|
+
* Implements `IContainerProvider` for use with position sources that
|
|
6468
|
+
* don't have an intrinsic container (e.g., RAF-based sources, WebSocket sources).
|
|
6469
|
+
*
|
|
6470
|
+
* @example
|
|
6471
|
+
* ```typescript
|
|
6472
|
+
* const containerProvider = new DomContainerProvider({
|
|
6473
|
+
* selector: '#timeline-container',
|
|
6474
|
+
* });
|
|
6475
|
+
*
|
|
6476
|
+
* containerProvider.onContainerReady(() => {
|
|
6477
|
+
* const $container = containerProvider.getContainer();
|
|
6478
|
+
* $container?.append('<div class="content">Ready!</div>');
|
|
6479
|
+
* });
|
|
6480
|
+
*
|
|
6481
|
+
* await containerProvider.init();
|
|
6482
|
+
* ```
|
|
6483
|
+
*/
|
|
6484
|
+
declare class DomContainerProvider implements IContainerProvider {
|
|
6485
|
+
private readonly _config;
|
|
6486
|
+
private _container;
|
|
6487
|
+
private _isReady;
|
|
6488
|
+
private _isDestroyed;
|
|
6489
|
+
private readonly _readyCallbacks;
|
|
6490
|
+
/**
|
|
6491
|
+
* Create a new DOM container provider.
|
|
6492
|
+
*
|
|
6493
|
+
* @param config - Configuration options
|
|
6494
|
+
*/
|
|
6495
|
+
constructor(config: DomContainerProviderConfig);
|
|
6496
|
+
/**
|
|
6497
|
+
* Initialize the container provider.
|
|
6498
|
+
*
|
|
6499
|
+
* Looks up the container element using the configured selector.
|
|
6500
|
+
*
|
|
6501
|
+
* @throws Error if the element is not found
|
|
6502
|
+
*/
|
|
6503
|
+
init(): Promise<void>;
|
|
6504
|
+
/**
|
|
6505
|
+
* Destroy the container provider and release resources.
|
|
6506
|
+
*/
|
|
6507
|
+
destroy(): void;
|
|
6508
|
+
/**
|
|
6509
|
+
* Get the container element.
|
|
6510
|
+
*
|
|
6511
|
+
* @returns jQuery-wrapped container element, or `undefined` if not initialized
|
|
6512
|
+
*/
|
|
6513
|
+
getContainer(): JQuery<HTMLElement> | undefined;
|
|
6514
|
+
/**
|
|
6515
|
+
* Register a callback for when the container is ready.
|
|
6516
|
+
*
|
|
6517
|
+
* If the container is already ready, the callback is invoked immediately.
|
|
6518
|
+
*
|
|
6519
|
+
* @param callback - Function called when container is ready
|
|
6520
|
+
*/
|
|
6521
|
+
onContainerReady(callback: () => void): void;
|
|
6522
|
+
/**
|
|
6523
|
+
* Notify all registered ready callbacks.
|
|
6524
|
+
*/
|
|
6525
|
+
private _notifyReady;
|
|
6526
|
+
}
|
|
6527
|
+
//#endregion
|
|
6528
|
+
//#region src/timelineproviders/playlist/simple-playlist.d.ts
|
|
6529
|
+
/**
|
|
6530
|
+
* Configuration for SimplePlaylist.
|
|
6531
|
+
*
|
|
6532
|
+
* @typeParam TItem - Type of playlist items
|
|
6533
|
+
*/
|
|
6534
|
+
interface SimplePlaylistConfig<TItem> {
|
|
6535
|
+
/**
|
|
6536
|
+
* Array of items in the playlist.
|
|
6537
|
+
* Must contain at least one item.
|
|
6538
|
+
*/
|
|
6539
|
+
items: TItem[];
|
|
6540
|
+
/**
|
|
6541
|
+
* Key of the item to use as identifier for `selectItem()`.
|
|
6542
|
+
* The value at this key is coerced to a string for comparison.
|
|
6543
|
+
*/
|
|
6544
|
+
identifierKey: keyof TItem;
|
|
6545
|
+
}
|
|
6546
|
+
/**
|
|
6547
|
+
* Simple playlist implementation.
|
|
6548
|
+
*
|
|
6549
|
+
* Manages a collection of timeline items and allows switching between them.
|
|
6550
|
+
* Implements `IPlaylist<TItem>` for use with timeline providers that
|
|
6551
|
+
* support multiple content sources.
|
|
6552
|
+
*
|
|
6553
|
+
* @typeParam TItem - Type of playlist items
|
|
6554
|
+
*
|
|
6555
|
+
* @example
|
|
6556
|
+
* ```typescript
|
|
6557
|
+
* interface VideoItem {
|
|
6558
|
+
* id: string;
|
|
6559
|
+
* uri: string;
|
|
6560
|
+
* title: string;
|
|
6561
|
+
* }
|
|
6562
|
+
*
|
|
6563
|
+
* const playlist = new SimplePlaylist<VideoItem>({
|
|
6564
|
+
* items: [
|
|
6565
|
+
* { id: 'intro', uri: '/videos/intro.mp4', title: 'Introduction' },
|
|
6566
|
+
* { id: 'ch1', uri: '/videos/chapter-1.mp4', title: 'Chapter 1' },
|
|
6567
|
+
* ],
|
|
6568
|
+
* identifierKey: 'id',
|
|
6569
|
+
* });
|
|
6570
|
+
*
|
|
6571
|
+
* playlist.onItemChange((item) => {
|
|
6572
|
+
* console.log(`Now playing: ${item.title}`);
|
|
6573
|
+
* });
|
|
6574
|
+
*
|
|
6575
|
+
* playlist.selectItem('ch1');
|
|
6576
|
+
* ```
|
|
6577
|
+
*/
|
|
6578
|
+
declare class SimplePlaylist<TItem = unknown> implements IPlaylist<TItem> {
|
|
6579
|
+
private readonly _items;
|
|
6580
|
+
private readonly _identifierKey;
|
|
6581
|
+
private _currentIndex;
|
|
6582
|
+
private readonly _changeCallbacks;
|
|
6583
|
+
/**
|
|
6584
|
+
* Create a new simple playlist.
|
|
6585
|
+
*
|
|
6586
|
+
* @param config - Configuration options
|
|
6587
|
+
* @throws Error if items array is empty
|
|
6588
|
+
*/
|
|
6589
|
+
constructor(config: SimplePlaylistConfig<TItem>);
|
|
6590
|
+
/**
|
|
6591
|
+
* Get the currently active item.
|
|
6592
|
+
*/
|
|
6593
|
+
get currentItem(): TItem;
|
|
6594
|
+
/**
|
|
6595
|
+
* Get all items in the playlist.
|
|
6596
|
+
*
|
|
6597
|
+
* Returns a readonly array to prevent external modification.
|
|
6598
|
+
*/
|
|
6599
|
+
get items(): readonly TItem[];
|
|
6600
|
+
/**
|
|
6601
|
+
* Select an item by identifier.
|
|
6602
|
+
*
|
|
6603
|
+
* Looks up the item using the configured identifier key and switches
|
|
6604
|
+
* to it if found. Triggers item change callbacks if the selection changes.
|
|
6605
|
+
*
|
|
6606
|
+
* @param identifier - Unique identifier for the item
|
|
6607
|
+
* @throws Error if no item matches the identifier
|
|
6608
|
+
*/
|
|
6609
|
+
selectItem(identifier: string): void;
|
|
6610
|
+
/**
|
|
6611
|
+
* Register a callback for item changes.
|
|
6612
|
+
*
|
|
6613
|
+
* Called whenever the current item changes via `selectItem()`.
|
|
6614
|
+
*
|
|
6615
|
+
* @param callback - Function receiving the new current item
|
|
6616
|
+
*/
|
|
6617
|
+
onItemChange(callback: (item: TItem) => void): void;
|
|
6618
|
+
/**
|
|
6619
|
+
* Notify all registered change callbacks.
|
|
6620
|
+
*/
|
|
6621
|
+
private _notifyChange;
|
|
6622
|
+
}
|
|
6623
|
+
//#endregion
|
|
6624
|
+
//#region src/util/typed-event-emitter.d.ts
|
|
6625
|
+
/**
|
|
6626
|
+
* Handler function for a specific event
|
|
6627
|
+
*/
|
|
6628
|
+
type EventHandler<T extends unknown[]> = (...args: T) => void;
|
|
6629
|
+
/**
|
|
6630
|
+
* Interface for a type-safe event emitter
|
|
6631
|
+
* @typeParam T - Event map object where keys are event names and values are argument tuples
|
|
6632
|
+
*
|
|
6633
|
+
* Note: Use `type` aliases (not `interface`) for your event maps to avoid
|
|
6634
|
+
* "Index signature is missing" errors. TypeScript treats them differently.
|
|
6635
|
+
*/
|
|
6636
|
+
interface ITypedEventEmitter<T extends Record<keyof T, unknown[]>> {
|
|
6637
|
+
/**
|
|
6638
|
+
* Subscribe to an event
|
|
6639
|
+
* @param event - Event name
|
|
6640
|
+
* @param handler - Event handler
|
|
6641
|
+
* @returns Unsubscribe function
|
|
6642
|
+
*/
|
|
6643
|
+
on<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): () => void;
|
|
6644
|
+
/**
|
|
6645
|
+
* Subscribe to an event for one-time execution
|
|
6646
|
+
* @param event - Event name
|
|
6647
|
+
* @param handler - Event handler
|
|
6648
|
+
* @returns Unsubscribe function
|
|
6649
|
+
*/
|
|
6650
|
+
once<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): () => void;
|
|
6651
|
+
/**
|
|
6652
|
+
* Unsubscribe from an event
|
|
6653
|
+
* @param event - Event name
|
|
6654
|
+
* @param handler - Event handler to remove
|
|
6655
|
+
*/
|
|
6656
|
+
off<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): void;
|
|
6657
|
+
/**
|
|
6658
|
+
* Emit an event to all subscribers
|
|
6659
|
+
* @param event - Event name
|
|
6660
|
+
* @param args - Event arguments
|
|
6661
|
+
*/
|
|
6662
|
+
emit<K$1 extends keyof T>(event: K$1, ...args: T[K$1]): void;
|
|
6663
|
+
/**
|
|
6664
|
+
* Remove all listeners for a specific event or all events
|
|
6665
|
+
* @param event - Optional event name. If not provided, removes all listeners.
|
|
6666
|
+
*/
|
|
6667
|
+
removeAllListeners(event?: keyof T): void;
|
|
6668
|
+
}
|
|
6669
|
+
/**
|
|
6670
|
+
* Type-safe event emitter implementation
|
|
6671
|
+
*
|
|
6672
|
+
* Features:
|
|
6673
|
+
* - Generic type parameter for event map
|
|
6674
|
+
* - Handler execution order preserved (registration order)
|
|
6675
|
+
* - Errors in handlers caught and logged (don't break other handlers)
|
|
6676
|
+
* - Copy handlers array during emit (safe removal during iteration)
|
|
6677
|
+
*
|
|
6678
|
+
* @example
|
|
6679
|
+
* ```typescript
|
|
6680
|
+
* interface MyEvents {
|
|
6681
|
+
* start: [];
|
|
6682
|
+
* data: [value: string];
|
|
6683
|
+
* progress: [current: number, total: number];
|
|
6684
|
+
* }
|
|
6685
|
+
*
|
|
6686
|
+
* const emitter = new TypedEventEmitter<MyEvents>();
|
|
6687
|
+
*
|
|
6688
|
+
* const unsubscribe = emitter.on('data', (value) => {
|
|
6689
|
+
* console.log('Received:', value);
|
|
6690
|
+
* });
|
|
6691
|
+
*
|
|
6692
|
+
* emitter.emit('data', 'hello');
|
|
6693
|
+
* unsubscribe();
|
|
6694
|
+
* ```
|
|
6695
|
+
*/
|
|
6696
|
+
declare class TypedEventEmitter<T extends Record<keyof T, unknown[]>> implements ITypedEventEmitter<T> {
|
|
6697
|
+
private handlers;
|
|
6698
|
+
/**
|
|
6699
|
+
* Subscribe to an event
|
|
6700
|
+
* @param event - Event name
|
|
6701
|
+
* @param handler - Event handler
|
|
6702
|
+
* @returns Unsubscribe function
|
|
6703
|
+
*/
|
|
6704
|
+
on<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): () => void;
|
|
6705
|
+
/**
|
|
6706
|
+
* Subscribe to an event for one-time execution
|
|
6707
|
+
* @param event - Event name
|
|
6708
|
+
* @param handler - Event handler
|
|
6709
|
+
* @returns Unsubscribe function
|
|
6710
|
+
*/
|
|
6711
|
+
once<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): () => void;
|
|
6712
|
+
/**
|
|
6713
|
+
* Unsubscribe from an event
|
|
6714
|
+
* @param event - Event name
|
|
6715
|
+
* @param handler - Event handler to remove
|
|
6716
|
+
*/
|
|
6717
|
+
off<K$1 extends keyof T>(event: K$1, handler: EventHandler<T[K$1]>): void;
|
|
6718
|
+
/**
|
|
6719
|
+
* Emit an event to all subscribers
|
|
6720
|
+
*
|
|
6721
|
+
* Features:
|
|
6722
|
+
* - Copies handlers array to allow safe removal during iteration
|
|
6723
|
+
* - Isolates errors - one failing handler doesn't break others
|
|
6724
|
+
* - Logs errors to console for debugging
|
|
6725
|
+
*
|
|
6726
|
+
* @param event - Event name
|
|
6727
|
+
* @param args - Event arguments
|
|
6728
|
+
*/
|
|
6729
|
+
emit<K$1 extends keyof T>(event: K$1, ...args: T[K$1]): void;
|
|
6730
|
+
/**
|
|
6731
|
+
* Remove all listeners for a specific event or all events
|
|
6732
|
+
* @param event - Optional event name. If not provided, removes all listeners.
|
|
6733
|
+
*/
|
|
6734
|
+
removeAllListeners(event?: keyof T): void;
|
|
6735
|
+
}
|
|
6736
|
+
//#endregion
|
|
6737
|
+
//#region src/language-manager.d.ts
|
|
6738
|
+
/**
|
|
6739
|
+
* Manages multi-language labels with explicit, testable API.
|
|
6740
|
+
*
|
|
6741
|
+
* This class manages the labels for an {@link IEligiusEngine} instance.
|
|
6742
|
+
* It provides a pure API for language management and emits events for language changes.
|
|
6743
|
+
*
|
|
6744
|
+
* Eventbus integration is handled by LanguageEventbusAdapter.
|
|
6745
|
+
*/
|
|
6746
|
+
declare class LanguageManager implements ILanguageManager {
|
|
6747
|
+
private _currentLanguage;
|
|
6748
|
+
private _labelLookup;
|
|
6749
|
+
private _emitter;
|
|
6750
|
+
private _availableLanguages;
|
|
6751
|
+
/** Current language code (e.g., 'en-US', 'nl-NL') */
|
|
6752
|
+
get language(): string;
|
|
6753
|
+
/** List of available language codes, derived from unique languages in label collections */
|
|
6754
|
+
get availableLanguages(): string[];
|
|
6755
|
+
constructor(_currentLanguage: TLanguageCode, labels: ILanguageLabel[]);
|
|
6756
|
+
/**
|
|
6757
|
+
* Subscribe to language manager events
|
|
6758
|
+
* @param event - Event name
|
|
6759
|
+
* @param handler - Event handler
|
|
6760
|
+
* @returns Unsubscribe function
|
|
6761
|
+
*/
|
|
6762
|
+
on<K$1 extends keyof LanguageEvents>(event: K$1, handler: (...args: LanguageEvents[K$1]) => void): () => void;
|
|
6763
|
+
/**
|
|
6764
|
+
* Change the current language
|
|
6765
|
+
* @param language - New language code
|
|
6766
|
+
* @throws If language code is empty or null
|
|
6767
|
+
*/
|
|
6768
|
+
setLanguage(language: TLanguageCode): void;
|
|
6769
|
+
/**
|
|
6770
|
+
* Get a label collection by ID
|
|
6771
|
+
* @param collectionId - Label collection ID
|
|
6772
|
+
* @returns Label array or undefined if not found
|
|
6773
|
+
*/
|
|
6774
|
+
getLabelCollection(collectionId: string): ILabel[] | undefined;
|
|
6775
|
+
/**
|
|
6776
|
+
* Get multiple label collections by IDs
|
|
6777
|
+
* @param collectionIds - Array of label collection IDs
|
|
6778
|
+
* @returns Array of label arrays (undefined for not found collections)
|
|
6779
|
+
*/
|
|
6780
|
+
getLabelCollections(collectionIds: string[]): (ILabel[] | undefined)[];
|
|
6781
|
+
/**
|
|
6782
|
+
* Clean up resources
|
|
6783
|
+
*/
|
|
6784
|
+
destroy(): void;
|
|
6785
|
+
private _createLabelLookup;
|
|
6786
|
+
private _extractAvailableLanguages;
|
|
6787
|
+
}
|
|
6788
|
+
//#endregion
|
|
6789
|
+
//#region src/eligius-engine.d.ts
|
|
6790
|
+
type ActionMethod = (IEndableAction['start'] & ActionMethodMetadata) | (IEndableAction['end'] & ActionMethodMetadata);
|
|
6791
|
+
interface ActionMethodMetadata {
|
|
6792
|
+
id: string;
|
|
6793
|
+
isStart: boolean;
|
|
6794
|
+
startPosition?: number;
|
|
6795
|
+
}
|
|
6796
|
+
/**
|
|
6797
|
+
* The Eligius timeline engine with explicit, testable API.
|
|
6798
|
+
*
|
|
6799
|
+
* This engine is responsible for starting and stopping the given timeline provider
|
|
6800
|
+
* and triggering the actions associated with positions along the timeline.
|
|
6801
|
+
*/
|
|
6802
|
+
declare class EligiusEngine implements IEligiusEngine {
|
|
6803
|
+
private configuration;
|
|
6804
|
+
private eventbus;
|
|
6805
|
+
private timelineProviders;
|
|
6806
|
+
private languageManager;
|
|
6807
|
+
private _timeLineActionsLookup;
|
|
6808
|
+
private _timelineLookupCache;
|
|
6809
|
+
private _eventbusRemovers;
|
|
6810
|
+
private _currentTimelineUri;
|
|
6811
|
+
private _activePositionSource;
|
|
6812
|
+
private _activeContainerProvider;
|
|
6813
|
+
private _activePlaylist;
|
|
6814
|
+
private _lastPosition;
|
|
6815
|
+
private _emitter;
|
|
6816
|
+
/** Current timeline position in seconds (supports fractional values) */
|
|
6817
|
+
get position(): number;
|
|
6818
|
+
/** Timeline duration in seconds, undefined if not yet available */
|
|
6819
|
+
get duration(): number | undefined;
|
|
6820
|
+
/** Current playback state (derived from position source state) */
|
|
6821
|
+
get playState(): 'playing' | 'paused' | 'stopped';
|
|
6822
|
+
/** URI of the currently active timeline */
|
|
6823
|
+
get currentTimelineUri(): string;
|
|
6824
|
+
/** Container element for the active timeline provider */
|
|
6825
|
+
get container(): JQuery<HTMLElement> | undefined;
|
|
6826
|
+
/** Root element of the engine (container selector) */
|
|
6827
|
+
get engineRoot(): JQuery<HTMLElement>;
|
|
6828
|
+
constructor(configuration: IResolvedEngineConfiguration, eventbus: IEventbus, timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>, languageManager: LanguageManager);
|
|
6829
|
+
/**
|
|
6830
|
+
* Subscribe to engine events
|
|
6831
|
+
* @param event - Event name
|
|
6832
|
+
* @param handler - Event handler
|
|
6833
|
+
* @returns Unsubscribe function
|
|
6834
|
+
*/
|
|
6835
|
+
on<K$1 extends keyof EngineEvents>(event: K$1, handler: (...args: EngineEvents[K$1]) => void): () => void;
|
|
6836
|
+
/**
|
|
6837
|
+
* Start playback
|
|
6838
|
+
* @throws If autoplay is blocked (video provider)
|
|
6839
|
+
*/
|
|
6840
|
+
start(): Promise<void>;
|
|
6841
|
+
/**
|
|
6842
|
+
* Pause playback
|
|
6843
|
+
*/
|
|
6844
|
+
pause(): void;
|
|
6845
|
+
/**
|
|
6846
|
+
* Stop playback and reset to beginning
|
|
6847
|
+
*/
|
|
6848
|
+
stop(): void;
|
|
6849
|
+
/**
|
|
6850
|
+
* Seek to a specific position
|
|
6851
|
+
* @param position - Target position in seconds
|
|
6852
|
+
* @returns Actual position after seek
|
|
6853
|
+
*/
|
|
6854
|
+
seek(position: number): Promise<number>;
|
|
6855
|
+
/**
|
|
6856
|
+
* Switch to a different timeline
|
|
6857
|
+
* @param uri - Timeline URI to switch to
|
|
6858
|
+
* @param position - Optional starting position
|
|
6859
|
+
*/
|
|
6860
|
+
switchTimeline(uri: string, position?: number): Promise<void>;
|
|
6861
|
+
/**
|
|
6862
|
+
* Initializes the engine by creating the HTML layout and the first time line
|
|
6863
|
+
* by executing its initActions.
|
|
6864
|
+
*/
|
|
6865
|
+
init(): Promise<IPositionSource>;
|
|
6866
|
+
private _createLayoutTemplate;
|
|
6867
|
+
private _initializeTimelineProvider;
|
|
6868
|
+
private _onCompleteCallback;
|
|
6869
|
+
private _onFirstFrameCallback;
|
|
6870
|
+
private _onRestartCallback;
|
|
6871
|
+
private _cleanUp;
|
|
6872
|
+
/**
|
|
6873
|
+
* Cleans up all the necessary parts that the engine initialized.
|
|
6874
|
+
* - It ends the currently active operations and the init actions.
|
|
6875
|
+
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
6876
|
+
* - It destroys all of its timeline providers
|
|
6877
|
+
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
6878
|
+
*
|
|
6879
|
+
*/
|
|
6880
|
+
destroy(): Promise<void>;
|
|
6881
|
+
private _addEventListener;
|
|
6882
|
+
private _addEventbusListeners;
|
|
6883
|
+
private _seekRequest;
|
|
6884
|
+
private _durationRequest;
|
|
6885
|
+
private _containerRequest;
|
|
6886
|
+
private _pauseRequest;
|
|
6887
|
+
private _stopRequest;
|
|
6888
|
+
private _playRequest;
|
|
6889
|
+
private _toggleplay;
|
|
6890
|
+
private _createTimelineLookup;
|
|
6891
|
+
static sortTimelines(timelines: Record<number, ActionMethod[]>[]): void;
|
|
6892
|
+
static sortActionsPerPosition(actions: ActionMethod[]): ActionMethod[];
|
|
6893
|
+
private _addTimelineActionStart;
|
|
6894
|
+
private _addTimelineActionEnd;
|
|
6895
|
+
private _initializeUriLookup;
|
|
6896
|
+
private _initializeTimelinePosition;
|
|
6897
|
+
private _executeActions;
|
|
6898
|
+
private _handleRequestEngineRoot;
|
|
6899
|
+
private _handleRequestTimelineUri;
|
|
6900
|
+
private _cleanUpTimeline;
|
|
6901
|
+
private _executeStartActions;
|
|
6902
|
+
/**
|
|
6903
|
+
* Gets all of the inactive actions whose duration falls within the given timeline position.
|
|
6904
|
+
*
|
|
6905
|
+
* @param position the given position
|
|
6906
|
+
* @param actions all of the relevant actions
|
|
6907
|
+
* @returns
|
|
6908
|
+
*/
|
|
6909
|
+
private _getActionsForPosition;
|
|
6910
|
+
private _getActiveActions;
|
|
6911
|
+
private _executeRelevantActions;
|
|
6912
|
+
private _handleRequestTimelinePosition;
|
|
6913
|
+
private _handleTimelineComplete;
|
|
6914
|
+
private _getTimelineActionsForCurrentTimeline;
|
|
6915
|
+
private _requestCurrentTimeline;
|
|
6916
|
+
private _getTimelineActionsForUri;
|
|
6917
|
+
private _onTimeHandler;
|
|
6918
|
+
private _executeActionsForPosition;
|
|
6919
|
+
private _executeSeekActions;
|
|
6920
|
+
}
|
|
6921
|
+
//#endregion
|
|
6922
|
+
//#region src/engine-factory.d.ts
|
|
6923
|
+
/**
|
|
6924
|
+
* The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.
|
|
6925
|
+
*
|
|
6926
|
+
* It prepares a resolved configuration and creates the engine based on the class defined in the configuration.
|
|
6927
|
+
*
|
|
6928
|
+
* @example Loading a configuration and creating an IEligiusEngine instance
|
|
6929
|
+
* ```ts
|
|
6930
|
+
* import { IEngineConfiguration, EngineFactory, EligiusResourceImporter } from 'eligius';
|
|
6931
|
+
* import * as engineConfig from './my-eligius-config.json';
|
|
6932
|
+
*
|
|
6933
|
+
* const factory = new EngineFactory(new EligiusResourceImporter(), window);
|
|
6934
|
+
*
|
|
6935
|
+
* const { engine } = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);
|
|
6936
|
+
*
|
|
6937
|
+
* engine.init().then(()=> {console.log('Eligius engine ready for business');});
|
|
6938
|
+
* ```
|
|
6939
|
+
*/
|
|
6940
|
+
declare class EngineFactory implements IEngineFactory {
|
|
6941
|
+
private _actionsLookup;
|
|
6942
|
+
private _eventbus;
|
|
6943
|
+
private _eventRemovers;
|
|
6944
|
+
private _importer;
|
|
6945
|
+
private _windowRef;
|
|
6946
|
+
constructor(importer: ISimpleResourceImporter, windowRef: Window, options?: IEngineFactoryOptions);
|
|
6947
|
+
/**
|
|
6948
|
+
* Destroys the factory and cleans up all registered request handlers.
|
|
6949
|
+
*/
|
|
6950
|
+
destroy(): void;
|
|
6951
|
+
private _importSystemEntryWithEventbusDependency;
|
|
6952
|
+
private _importSystemEntry;
|
|
6953
|
+
private _requestInstanceHandler;
|
|
6954
|
+
private _requestFunctionHandler;
|
|
5403
6955
|
private _requestActionHandler;
|
|
5404
|
-
|
|
6956
|
+
/**
|
|
6957
|
+
* Creates a fully wired engine with adapters and event handlers.
|
|
6958
|
+
*
|
|
6959
|
+
* This method:
|
|
6960
|
+
* - Resolves the configuration
|
|
6961
|
+
* - Creates timeline providers
|
|
6962
|
+
* - Instantiates the engine and language manager
|
|
6963
|
+
* - Creates and connects adapters for eventbus integration
|
|
6964
|
+
*
|
|
6965
|
+
* @param configuration - The engine configuration
|
|
6966
|
+
* @param resolver - Optional custom configuration resolver
|
|
6967
|
+
* @returns Engine result with engine, language manager, eventbus, and destroy function
|
|
6968
|
+
*/
|
|
6969
|
+
createEngine(configuration: IEngineConfiguration, resolver?: IConfigurationResolver): IEngineFactoryResult;
|
|
5405
6970
|
private _createTimelineProviders;
|
|
6971
|
+
/**
|
|
6972
|
+
* Creates a position source for a specific timeline based on configuration.
|
|
6973
|
+
*
|
|
6974
|
+
* The position source class is resolved dynamically via the resource importer
|
|
6975
|
+
* using the `systemName` property from the configuration.
|
|
6976
|
+
*
|
|
6977
|
+
* @param timeline - The resolved timeline configuration
|
|
6978
|
+
* @param settings - The timeline provider settings containing position source config
|
|
6979
|
+
* @returns A configured position source
|
|
6980
|
+
* @throws Error if the position source class cannot be resolved
|
|
6981
|
+
*/
|
|
6982
|
+
createPositionSourceForTimeline(timeline: IResolvedEngineConfiguration['timelines'][number], settings: ITimelineProviderSettings): IPositionSource;
|
|
6983
|
+
/**
|
|
6984
|
+
* Creates a container provider based on timeline provider settings.
|
|
6985
|
+
*
|
|
6986
|
+
* The container provider class is resolved dynamically via the resource importer
|
|
6987
|
+
* using the `systemName` property from the configuration.
|
|
6988
|
+
*
|
|
6989
|
+
* @param settings - The timeline provider settings
|
|
6990
|
+
* @returns A container provider, or undefined if not configured
|
|
6991
|
+
* @throws Error if the container provider class cannot be resolved
|
|
6992
|
+
*/
|
|
6993
|
+
createContainerProviderForTimeline(settings: ITimelineProviderSettings): IContainerProvider | undefined;
|
|
6994
|
+
/**
|
|
6995
|
+
* Creates a playlist based on timeline provider settings.
|
|
6996
|
+
*
|
|
6997
|
+
* The playlist class is resolved dynamically via the resource importer
|
|
6998
|
+
* using the `systemName` property from the configuration.
|
|
6999
|
+
*
|
|
7000
|
+
* @param settings - The timeline provider settings
|
|
7001
|
+
* @returns A playlist, or undefined if not configured
|
|
7002
|
+
* @throws Error if the playlist class cannot be resolved
|
|
7003
|
+
*/
|
|
7004
|
+
createPlaylistForTimeline(settings: ITimelineProviderSettings): IPlaylist | undefined;
|
|
7005
|
+
/**
|
|
7006
|
+
* Assembles a complete ITimelineProviderInfo from timeline and settings.
|
|
7007
|
+
*
|
|
7008
|
+
* This is the main entry point for creating provider info with the new
|
|
7009
|
+
* configuration-driven architecture.
|
|
7010
|
+
*
|
|
7011
|
+
* @param timeline - The resolved timeline configuration
|
|
7012
|
+
* @param settings - The timeline provider settings
|
|
7013
|
+
* @returns A complete timeline provider info with all components
|
|
7014
|
+
*/
|
|
7015
|
+
createTimelineProviderInfo(timeline: IResolvedEngineConfiguration['timelines'][number], settings: ITimelineProviderSettings): ITimelineProviderInfo;
|
|
7016
|
+
/**
|
|
7017
|
+
* Creates timeline providers for all configured timeline types using the new
|
|
7018
|
+
* configuration-driven architecture.
|
|
7019
|
+
*
|
|
7020
|
+
* This method iterates over timelineProviderSettings and creates a
|
|
7021
|
+
* ITimelineProviderInfo for each configured timeline type by:
|
|
7022
|
+
* 1. Finding the first timeline that matches the type
|
|
7023
|
+
* 2. Using the timeline's duration for the position source
|
|
7024
|
+
* 3. Assembling components from the settings
|
|
7025
|
+
*
|
|
7026
|
+
* @param configuration - The resolved engine configuration
|
|
7027
|
+
* @returns A record of timeline types to their provider info
|
|
7028
|
+
* @throws Error if a provider setting has no matching timeline in config
|
|
7029
|
+
*/
|
|
7030
|
+
createTimelineProvidersForConfig(configuration: IResolvedEngineConfiguration): Record<TimelineTypes, ITimelineProviderInfo>;
|
|
5406
7031
|
}
|
|
5407
7032
|
//#endregion
|
|
5408
|
-
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, AllEvents, BeforeRequestTimelineUriEvent, CompleteEvent, ConfigurationFactory, ConfigurationResolver, ContainerRequestEvent, ControllerNamesProvider, Controllers, CurrentTimelineChangeEvent,
|
|
7033
|
+
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, AllEvents, BasePositionSource, BeforeRequestTimelineUriEvent, CompleteEvent, ConfigurationFactory, ConfigurationResolver, ContainerRequestEvent, ControllerNamesProvider, Controllers, CurrentTimelineChangeEvent, DOMEventListenerController, DomContainerProvider, DomContainerProviderConfig, DomMutationEvent, DurationEvent, DurationRequestEvent, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineEventbusAdapter, EngineEvents, EngineFactory, EngineInputAdapter, EventHandler, type EventMap, type EventName, Eventbus, ExtractOperationData, ExtractOperationDataType, ExtractReturnedOperationData, FirstFrameEvent, GetControllerByName, GetOperationByName, IAction, IActionConfiguration, IAdapter, type IAddClassOperationData, type IAddControllerToElementOperationData, type IAnimateOperationData, type IAnimateWithClassOperationData, type IAnnounceToScreenReaderOperationData, type IBroadcastEventOperationData, type ICalcOperationData, type IClearElementOperationData, type IClearOperationDataOperationData, type IClearStorageOperationData, type ICompareDateOperationData, type IConcatenateStringsOperationData, IConfigurationResolver, IContainerProvider, IContainerProviderConfig, IController, IControllerMetadata, type ICreateElementOperationData, type ICustomFunctionOperationData, type IDOMEventListenerControllerOperationData, IDimensions, IDuration, IEligiusEngine, type IEndActionOperationData, IEndableAction, IEndableActionConfiguration, IEngineConfiguration, IEngineFactory, IEngineFactoryOptions, IEngineFactoryResult, IEngineInfo, IEventActionConfiguration, IEventMetadata, IEventbus, IEventbusInterceptor, IEventbusListener, type IExtendControllerOperationData, type IFilterArrayOperationData, type IFindInArrayOperationData, type IForEachOperationData, type IFormatDateOperationData, type IFormatTextOperationData, type IGetAttributesFromElementOperationData, type IGetControllerFromElementOperationData, type IGetControllerInstanceOperationData, type IGetCurrentTimeOperationData, type IGetElementDimensionsOperationData, type IGetFocusedElementOperationData, type IGetFormDataOperationData, type IGetImportOperationData, type IGetQueryParamsOperationData, type IGetScrollPositionOperationData, type IGetTextContentOperationData, type IHttpDeleteOperationData, type IHttpPostOperationData, type IHttpPutOperationData, type IInvokeObjectMethodOperationData, type IIsElementInViewportOperationData, ILabel, type ILabelControllerMetadata, ILanguageLabel, ILanguageManager, type ILoadFromStorageOperationData, type ILoadJSONOperationData, type ILogOperationData, type ILottieControllerMetadata, type IMapArrayOperationData, type IMathOperationData, type IMutationEventPayload, type IMutationObserverControllerMetadata, type INavigationControllerOperationData, IOperationConfiguration, IOperationMetadata, IOperationScope, IPlaylist, IPlaylistConfig, IPositionSource, IPositionSourceConfig, type IProgressbarControllerOperationData, type IRemoveClassOperationData, type IRemoveControllerFromElementOperationData, type IRemoveElementOperationData, type IRemovePropertiesFromOperationDataOperationData, type IReparentElementOperationData, type IReplaceStringOperationData, type IReplaceTextOperationData, type IRequestActionOperationData, IResolvedActionConfiguration, IResolvedEndableActionConfiguration, IResolvedEngineConfiguration, IResolvedOperation, IResolvedTimelineConfiguration, IResourceImporter, type IRoutingControllerOperationData, type ISaveToStorageOperationData, type IScrollToElementOperationData, type IScrollToPositionOperationData, ISeekable, type ISelectElementOperationData, type ISetDataOperationData, type ISetElementAttributesOperationData, type ISetElementContentOperationData, type ISetFocusOperationData, type ISetFormValueOperationData, type ISetGlobalDataOperationData, type ISetOperationData, type ISetStyleOperationData, type ISetVariableOperationData, ISimpleResourceImporter, type ISortArrayOperationData, type ISplitStringOperationData, type IStartActionOperationData, IStrictDuration, type ISubstringTextOperationData, ISubtitle, ISubtitleCollection, type ISubtitlesControllerOperationData, ITimelineAction, ITimelineActionConfiguration, ITimelineConfiguration, ITimelineFlow, ITimelineProviderInfo, ITimelineProviderSettings, type IToggleClassOperationData, type IToggleElementOperationData, type IToggleFormElementOperationData, ITypedEventEmitter, type IValidateFormOperationData, type IWaitOperationData, type IWhenOperationData, KeyboardStepSource, KeyboardStepSourceConfig, KeysOfType, LabelController, LanguageChangeEvent, LanguageEventbusAdapter, LanguageEvents, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, Operations, PauseEvent, PauseRequestEvent, PlayEvent, PlayRequestEvent, PlayToggleRequestEvent, ProgressbarController, RafPositionSource, RafPositionSourceConfig, RequestActionEvent, RequestCurrentLanguageEvent, RequestCurrentTimelineEvent, RequestCurrentTimelinePositionEvent, RequestEngineRootEvent, RequestFunctionEvent, RequestInstanceEvent, RequestLabelCollectionEvent, RequestLabelCollectionsEvent, RequestTimelineCleanupEvent, RequestTimelineUriEvent, RequestVideoUriInterceptor, RequireKeys, ResizeEvent, ResizeRequestEvent, RestartEvent, RoutingController, ScrollPositionSource, ScrollPositionSourceConfig, SeekEvent, SeekRequestEvent, SeekedEvent, SimplePlaylist, SimplePlaylistConfig, StopEvent, StopRequestEvent, type StorageType, SubtitleEditor, SubtitleImporter, SubtitlesController, TArrayProperyMetadata, TBoundary, TComplexPropertyMetadata, TConstantParametersTypes, TControllerName, TControllerType, TEngineConfigurationLists, TEventHandler, TEventbusRemover, THasDescription, THasErased, THasRequired, TLanguageCode, TOperation, TOperationCategory, TOperationData, TOperationName, TOperationResult, TOperationType, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, TRequestResponder, TResultCallback, TSourceState, TTimelineProviderSettings, TVerticalMode, TimeEvent, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, TimelineTypes, TypedEventEmitter, VideoPositionSource, VideoPositionSourceConfig, VideoSource, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, index_d_exports as ctrlmetadata, customFunction, endAction, endForEach, endWhen, index_d_exports$1 as eventmetadata, extendController, filterArray, findInArray, forEach, formatDate, formatText, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isElementInViewport, isSeekable, loadFromStorage, loadJson, log, mapArray, math, index_d_exports$2 as metadata, 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 };
|
|
5409
7034
|
//# sourceMappingURL=index.d.mts.map
|