eligius 1.0.71 → 1.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.
Files changed (107) hide show
  1. package/README.md +16 -7
  2. package/dist/action/action.d.ts +5 -1
  3. package/dist/action/endable-action.d.ts +1 -1
  4. package/dist/action/timeline-action.d.ts +1 -1
  5. package/dist/build/generate-importer-source-code.d.ts +1 -1
  6. package/dist/configuration/api/action-creator-factory.d.ts +1 -1
  7. package/dist/configuration/api/configuration-factory.d.ts +96 -3
  8. package/dist/configuration/configuration-resolver.d.ts +7 -0
  9. package/dist/configuration/types.d.ts +8 -0
  10. package/dist/controllers/event-listener-controller.d.ts +10 -3
  11. package/dist/controllers/label-controller.d.ts +14 -6
  12. package/dist/controllers/lottie-controller.d.ts +15 -9
  13. package/dist/controllers/navigation-controller.d.ts +15 -16
  14. package/dist/controllers/progressbar-controller.d.ts +10 -7
  15. package/dist/controllers/routing-controller.d.ts +11 -8
  16. package/dist/controllers/subtitles-controller.d.ts +3 -3
  17. package/dist/diagnostics/types.d.ts +22 -2
  18. package/dist/eligius-engine.d.ts +39 -10
  19. package/dist/eligius.cjs.development.js +5363 -3767
  20. package/dist/eligius.cjs.development.js.map +1 -1
  21. package/dist/eligius.cjs.production.min.js +1 -1
  22. package/dist/eligius.cjs.production.min.js.map +1 -1
  23. package/dist/eligius.esm.js +5341 -3765
  24. package/dist/eligius.esm.js.map +1 -1
  25. package/dist/engine-factory.d.ts +22 -5
  26. package/dist/eventbus/actionregistry-eventbus-listener.d.ts +4 -0
  27. package/dist/eventbus/eventbus.d.ts +5 -5
  28. package/dist/eventbus/types.d.ts +5 -5
  29. package/dist/index.d.ts +1 -0
  30. package/dist/language-manager.d.ts +10 -3
  31. package/dist/operation/add-controller-to-element.d.ts +5 -5
  32. package/dist/operation/animate-with-class.d.ts +1 -1
  33. package/dist/operation/animate.d.ts +2 -2
  34. package/dist/operation/calc.d.ts +2 -2
  35. package/dist/operation/clear-element.d.ts +2 -1
  36. package/dist/operation/clear-operation-data.d.ts +1 -0
  37. package/dist/operation/create-element.d.ts +2 -4
  38. package/dist/operation/custom-function.d.ts +1 -1
  39. package/dist/operation/end-action.d.ts +5 -1
  40. package/dist/operation/end-loop.d.ts +1 -2
  41. package/dist/operation/end-when.d.ts +8 -0
  42. package/dist/operation/get-controller-from-element.d.ts +1 -1
  43. package/dist/operation/get-controller-instance.d.ts +3 -5
  44. package/dist/operation/get-element-dimensions.d.ts +2 -2
  45. package/dist/operation/get-query-params.d.ts +28 -0
  46. package/dist/operation/helper/find-matching-operation-index.d.ts +35 -0
  47. package/dist/operation/helper/get-property-chain-value.d.ts +24 -0
  48. package/dist/operation/helper/globals.d.ts +3 -0
  49. package/dist/operation/helper/remove-global.d.ts +1 -0
  50. package/dist/operation/helper/resolve-event-arguments.d.ts +2 -2
  51. package/dist/operation/helper/resolve-external-property-chain.d.ts +14 -0
  52. package/dist/operation/helper/resolve-property-chain.d.ts +23 -0
  53. package/dist/operation/helper/resolve-property-values.d.ts +11 -2
  54. package/dist/operation/index.d.ts +6 -0
  55. package/dist/operation/invoke-object-method.d.ts +28 -0
  56. package/dist/operation/load-json.d.ts +11 -3
  57. package/dist/operation/log.d.ts +3 -3
  58. package/dist/operation/math.d.ts +2 -2
  59. package/dist/operation/metadata/end-when.d.ts +3 -0
  60. package/dist/operation/metadata/get-query-params.d.ts +4 -0
  61. package/dist/operation/metadata/index.d.ts +6 -0
  62. package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
  63. package/dist/operation/metadata/otherwise.d.ts +3 -0
  64. package/dist/operation/metadata/set-global-data.d.ts +4 -0
  65. package/dist/operation/metadata/start-loop.d.ts +2 -2
  66. package/dist/operation/metadata/types.d.ts +1 -1
  67. package/dist/operation/metadata/when.d.ts +4 -0
  68. package/dist/operation/otherwise.d.ts +9 -0
  69. package/dist/operation/remove-class.d.ts +1 -1
  70. package/dist/operation/remove-controller-from-element.d.ts +1 -1
  71. package/dist/operation/remove-element.d.ts +1 -1
  72. package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
  73. package/dist/operation/reparent-element.d.ts +2 -2
  74. package/dist/operation/request-action.d.ts +1 -1
  75. package/dist/operation/select-element.d.ts +3 -4
  76. package/dist/operation/set-element-attributes.d.ts +1 -1
  77. package/dist/operation/set-element-content.d.ts +4 -4
  78. package/dist/operation/set-global-data.d.ts +11 -0
  79. package/dist/operation/set-operation-data.d.ts +1 -1
  80. package/dist/operation/set-style.d.ts +4 -5
  81. package/dist/operation/start-action.d.ts +3 -3
  82. package/dist/operation/start-loop.d.ts +7 -6
  83. package/dist/operation/toggle-class.d.ts +10 -1
  84. package/dist/operation/toggle-element.d.ts +7 -1
  85. package/dist/operation/types.d.ts +45 -3
  86. package/dist/operation/wait.d.ts +3 -3
  87. package/dist/operation/when.d.ts +18 -0
  88. package/dist/timeline-event-names.d.ts +46 -2
  89. package/dist/timelineproviders/index.d.ts +0 -1
  90. package/dist/timelineproviders/media-element-timeline-provider.d.ts +20 -12
  91. package/dist/timelineproviders/request-animation-frame-timeline-provider.d.ts +19 -20
  92. package/dist/timelineproviders/types.d.ts +10 -2
  93. package/dist/{schema-tools/generate-operation-schemas.d.ts → tools/doc-tools/generate-readmes.d.ts} +0 -0
  94. package/dist/tools/schema-tools/generate-operation-schemas.d.ts +1 -0
  95. package/dist/{schema-tools → tools/schema-tools}/html-tag-names.d.ts +0 -0
  96. package/dist/types.d.ts +42 -3
  97. package/dist/util/guards/is-function.d.ts +1 -0
  98. package/dist/util/guards/is-object.d.ts +1 -0
  99. package/dist/util/guards/is-promise.d.ts +1 -0
  100. package/dist/util/guards/is-string.d.ts +1 -0
  101. package/package.json +20 -13
  102. package/dist/action/is-promise.d.ts +0 -1
  103. package/dist/operation/helper/extract-operation-data-argument-values.d.ts +0 -1
  104. package/dist/operation/helper/get-globals.d.ts +0 -1
  105. package/dist/operation/helper/get-nested-property-value.d.ts +0 -1
  106. package/dist/operation/helper/get-nested-value.d.ts +0 -1
  107. package/dist/timelineproviders/jwplayer-timeline-provider.d.ts +0 -42
package/README.md CHANGED
@@ -4,7 +4,7 @@ A Javascript engine that allows arbitrary functionality to be triggered accordin
4
4
 
5
5
  The engine can be the basis for video annotations, presentation software or interactive infographics, for example.
6
6
 
7
- Eligius is NOT a game or animation engine.
7
+ Eligius is NOT a game or animation engine, instead, it is a Story Telling Engine.
8
8
 
9
9
  ## description
10
10
 
@@ -12,7 +12,7 @@ The main concepts in Eligius are timelines, actions and operations. A timeline c
12
12
 
13
13
  Actions can be called on specified points on such a timeline. An action consists of a list of start and end operations.
14
14
 
15
- An operation is an atomic function. A context, for sharing data, is passed between each successive operation. Examples of operations are `select-element`, `create-element` or `add-class`. [Here is a complete list of all available operations.](https://github.com/rolandzwaga/eligius/tree/dev/src/operation)
15
+ An operation is an atomic function. A context, for sharing data, is passed between each successive operation. Examples of operations are `select-element`, `create-element` or `add-class`. [Here is a complete list of all available operations.](https://github.com/rolandzwaga/eligius/tree/main/src/operation)
16
16
  By composing these atomic operations complex functionality can be achieved.
17
17
 
18
18
  An example of an action is adding an removing an image from the stage at specific times. This action would consist of these start operations: `select-element`(to select the image parent), `create-element`(to create the img element with the required src attribute) and `set-element-contents`(to add the img element to the previously selected parent).
@@ -22,16 +22,16 @@ A more comprehensive example could be, for example, a rich subtitling system for
22
22
 
23
23
  ## configuration
24
24
 
25
- The Eligius engine is populated by a JSON configuration. Think of this JSON as its file format. This configuration contains all of the timelines, actions, operations and other data for the engine to run. A JSON schema for this configuration can be found [here](https://github.com/rolandzwaga/eligius/blob/dev/jsonschema/eligius-configuration.json).
25
+ The Eligius engine is populated by a JSON configuration. Think of this JSON as its file format. This configuration contains all of the timelines, actions, operations and other data for the engine to run. A JSON schema for this configuration can be found [here](https://rolandzwaga.github.io/eligius/jsonschema/eligius-configuration.json).
26
26
 
27
27
  This section describes the different parts of this configuration.
28
28
 
29
29
  ### systemName property
30
30
 
31
31
  In the rest of this section the property name `systemName` will be shown often. The value of this property describes a named import.
32
- Currently one resource importer is supported by default: [`EligiusResourceImporter`](https://github.com/rolandzwaga/eligius/blob/dev/src/importer/eligius-resource-importer.ts).
32
+ Currently one resource importer is supported by default: [`EligiusResourceImporter`](https://rolandzwaga.github.io/eligius/classes/EligiusResourceImporter.html).
33
33
  However, this importer contains all of Eligius classes, function, providers, etc. So, bundling this with a presentation will bloat the bundle.
34
- Eligius offers a generator function for this: [`generateImporterSourceCode`](https://github.com/rolandzwaga/eligius/blob/dev/src/build/generate-importer-source-code.ts). This function is able to generate source code (Typescript) for a custom resource importer based on a given Eligius configuration. This will result in an importer that only includes the code that is referenced in the configuration.
34
+ Eligius offers a generator function for this: [`generateImporterSourceCode`](https://rolandzwaga.github.io/eligius/functions/generateImporterSourceCode.html). This function is able to generate source code (Typescript) for a custom resource importer based on a given Eligius configuration. This will result in an importer that only includes the code that is referenced in the configuration.
35
35
 
36
36
  ### engine
37
37
 
@@ -64,7 +64,8 @@ The engine setting defines the engine for which this configuration is written. C
64
64
 
65
65
  These settings describe the providers that are availab;e for the different kinds of timelines.
66
66
  There are three kinds: `audio`, `video` and `animation`.
67
- For `audio` and `video` either the `JwPlayerTimelineProvider` or `MediaElementTimelineProvider` can be used, for `animation` there is `RequestAnimationFrameTimelineProvider`.
67
+ For `animation` there is `RequestAnimationFrameTimelineProvider`.
68
+ For `audio` and `video` the `MediaElementTimelineProvider` can be used, but unfortunately that class is disabled for now.
68
69
 
69
70
  ### container selector
70
71
 
@@ -234,7 +235,7 @@ This a list of actions that can be triggered by an event broadcast. Since an eve
234
235
  ### labels
235
236
 
236
237
  A list of label information that describes all of the textual content for the presentation.
237
- Labels can be rendered by the [`LabelController`](https://github.com/rolandzwaga/eligius/blob/dev/src/controllers/label-controller.ts). This controller listens for the appropriate language change events as well, and will change the contents of the element it controls accordingly.
238
+ Labels can be rendered by the [`LabelController`](https://rolandzwaga.github.io/eligius/classes/LabelController.html). This controller listens for the appropriate language change events as well, and will change the contents of the element it controls accordingly.
238
239
 
239
240
  ```json
240
241
  {
@@ -271,6 +272,14 @@ const engine = factory.createEngine((engineConfig as unknown) as IEngineConfigur
271
272
  engine.init().then(()=> {console.log('Eligius engine ready for business');});
272
273
  ```
273
274
 
275
+ ## Configuration API
276
+
277
+ Obviously having to type all of that JSON by hand can be a tad overwhelming and time consuming. Check out the [ConfigurationFactory](https://rolandzwaga.github.io/eligius/classes/ConfigurationFactory.html) for a strongly typed, fluent API to construct a configuration programmatically.
278
+
279
+ ## Source documentation
280
+
281
+ [Check out this link for the full type docs](https://rolandzwaga.github.io/eligius/)
282
+
274
283
  ## installation
275
284
 
276
285
  ```sh
@@ -7,7 +7,11 @@ export declare class Action implements IAction {
7
7
  startOperations: IResolvedOperation[];
8
8
  protected eventbus: IEventbus;
9
9
  id: string;
10
+ protected _contextStack: IOperationContext[];
10
11
  constructor(name: string, startOperations: IResolvedOperation[], eventbus: IEventbus);
11
12
  start(initOperationData?: TOperationData): Promise<TOperationData>;
12
- executeOperation(operations: IResolvedOperation[], idx: number, resolve: (value?: any | PromiseLike<any>) => void, reject: (reason?: any) => void, previousOperationData: any, context: IOperationContext): void;
13
+ protected _initializeContextStack(): void;
14
+ private _pushContext;
15
+ private _popContext;
16
+ executeOperation(operations: IResolvedOperation[], operationIndex: number, resolve: (value?: any | PromiseLike<any>) => void, reject: (reason?: any) => void, previousOperationData?: TOperationData | undefined): void;
13
17
  }
@@ -5,5 +5,5 @@ import { Action } from './action';
5
5
  export declare class EndableAction extends Action {
6
6
  endOperations: IResolvedOperation[];
7
7
  constructor(name: string, startOperations: IResolvedOperation[], endOperations: IResolvedOperation[], eventBus: IEventbus);
8
- end(initOperationData?: TOperationData): Promise<TOperationData | undefined>;
8
+ end(initOperationData?: TOperationData): Promise<TOperationData>;
9
9
  }
@@ -7,6 +7,6 @@ export declare class TimelineAction extends EndableAction {
7
7
  duration: IStrictDuration;
8
8
  active: boolean;
9
9
  constructor(name: string, startOperations: IResolvedOperation[], endOperations: IResolvedOperation[], duration: IStrictDuration, eventBus: IEventbus);
10
- start(initOperationData: TOperationData): Promise<TOperationData>;
10
+ start(initOperationData?: TOperationData): Promise<TOperationData>;
11
11
  end(initOperationData: TOperationData): Promise<TOperationData>;
12
12
  }
@@ -4,7 +4,7 @@ export interface IAssetInfo {
4
4
  extension: string;
5
5
  }
6
6
  /**
7
- * This function takes an Eligius engine configuration, a root path for the config and an arbitrary list of asset info.
7
+ * This function takes an Eligius engine configuration, a root path for the configuration file and an arbitrary list of asset info.
8
8
  * The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.
9
9
  * I.e. html, json, etc.
10
10
  *
@@ -4,7 +4,7 @@ import { ConfigurationFactory } from './configuration-factory';
4
4
  export declare class ActionCreatorFactory {
5
5
  private readonly configurationfactory;
6
6
  constructor(configurationfactory: ConfigurationFactory);
7
- createAction(name: string): ActionCreator;
7
+ createAction(name: string): EndableActionCreator;
8
8
  createInitAction(name: string): EndableActionCreator;
9
9
  createEventAction(name: string): ActionCreator;
10
10
  createTimelineAction(uri: string, name: string): TimelineActionCreator;
@@ -4,16 +4,107 @@ import { ActionCreatorFactory } from './action-creator-factory';
4
4
  import { ActionEditor, EndableActionEditor, TimelineActionEditor } from './action-editor';
5
5
  import { TimelineProvidersSettingsEditor } from './timeline-provider-settings-editor';
6
6
  export declare type TEngineConfigurationLists = Pick<IEngineConfiguration, 'availableLanguages' | 'initActions' | 'actions' | 'eventActions' | 'timelines' | 'labels'>;
7
+ declare type ConfigurationFactoryExtension = (this: ConfigurationFactory, ...rest: any[]) => void;
8
+ /**
9
+ * This class offers a fluent and strongly typed DSL for creating Eligius configurations.
10
+ *
11
+ * @example Building a configuration using the factory
12
+ * To initialize a basic configuration to start off of:
13
+ * ```ts
14
+ * const factory = new ConfigurationFactory()
15
+ * .init("en-US") // Define the default language
16
+ * .addLanguage("en-US", "English") // Add English as a supported language
17
+ * .addLanguage("nl-NL", "Nederlands") // Add Dutch as a supported language
18
+ * .setLayoutTemplate("<div class=\"main.container\"></div>") // Add the main container for the presentation
19
+ * .setContainerSelector("#ct-container") // Selector for the element in the body that will contain the presentation
20
+ * .addTimeline( // Add a first timeline
21
+ * 'timeline-1', // Give it a name
22
+ * "animation", // This is RAF based timeline
23
+ * 200, // The duration of the timeline in seconds
24
+ * false, // The presentation does NOT play in a loop
25
+ * ".timeline-container" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered
26
+ * )
27
+ * .editTimelineProviderSettings() // Add a timeline provider
28
+ * .addProvider("animation") // One that provides timelines for type 'animation'
29
+ * .setSystemName("RequestAnimationFrameTimelineProvider") // The system name of the provider
30
+ * .setVendor("eligius") // Eligius is the vendor in this case
31
+ * .end(); // This finally returns the ConfigurationFactory instance
32
+ * ```
33
+ *
34
+ * Then to add an init action:
35
+ * ```ts
36
+ * factory
37
+ * .createInitAction("GetUserName")
38
+ * .addStartOperationByType(getQueryParams, {
39
+ * defaultValues: { username: "guest" },
40
+ * })
41
+ * .addStartOperationByType(setGlobalData, { properties: ["queryParams"] });
42
+ * ```
43
+ *
44
+ * After that, add a timeline action:
45
+ * ```ts
46
+ * factory.createTimelineAction("timeline-1", "AddIntroContainer")
47
+ * .addDuration(0, 10)
48
+ * .addStartOperationByType(selectElement, { selector: ".timeline-container" })
49
+ * .addStartOperationByType(setElementContent, {
50
+ * template: '<div class="intro-text"></div>',
51
+ * })
52
+ * .addEndOperationByType(selectElement, { selector: ".intro-text" })
53
+ * .addEndOperationByType(removeElement, {});
54
+ * ```
55
+ *
56
+ * It also possible to extend the factory with specialized creation methods for the particular
57
+ * configuration you are building:
58
+ * ```ts
59
+ * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {
60
+ * this.createInitAction(actionName)
61
+ * .addStartOperationByType(selectElement, { selector: ".timeline-container" })
62
+ * .addStartOperationByType(createElement, { element: 'img', attributes: {src: imageSrc, imageId} })
63
+ * .addStartOperationByType(setElementContent, { insertionType: "append" })
64
+ * .addEndOperationByType(selectElement, { selector: `#${imageId}` })
65
+ * .addEndOperationByType(removeElement, {});
66
+ * }
67
+ *
68
+ * const customFactory = ConfigurationFactory.extend(factory, "addImage", addImage);
69
+ *
70
+ * customFactory.addImage("MyImageActionName", "my-image.png", "my-image-id");
71
+ * ```
72
+ *
73
+ * Finally, retrieve the configuration and save it:
74
+ * ```ts
75
+ * import fs from "fs";
76
+ *
77
+ * const configuration = customFactory.getConfiguration();
78
+ *
79
+ * fs.writeFileSync("/my/path/configuration.json", JSON.stringify(configuration), {encoding:'utf-8'})
80
+ * ```
81
+ *
82
+ * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply
83
+ * pass the JSON configuration to the `ConfigurationFactory`'s constructor:
84
+ * ```ts
85
+ * import myConfiguration from './my-configuration.json';
86
+ *
87
+ * const factory = new ConfigurationFactory(myConfiguration);
88
+ *
89
+ * factory.editInitAction("existingActionName")
90
+ * .removeEndOperation("475fd0ab-5755-4e60-8f7c-e1988a109678");
91
+ * ```
92
+ *
93
+ */
7
94
  export declare class ConfigurationFactory {
8
95
  actionCreatorFactory: ActionCreatorFactory;
9
96
  configuration: IEngineConfiguration;
10
97
  constructor(config?: IEngineConfiguration);
98
+ static extend<T extends ConfigurationFactory, K extends string | number | symbol, C extends ConfigurationFactoryExtension>(factory: T, extensionMethodName: K, extensionMethod: C): T & { [k in K]: C; };
99
+ static extendMultiple<T extends ConfigurationFactory, C extends ConfigurationFactoryExtension, D extends {
100
+ [name: string]: C;
101
+ }>(factory: T, extensions: D): T & D;
11
102
  init(defaultLanguage: string): this;
12
103
  setLayoutTemplate(layoutTemplate: string): this;
13
104
  setDefaultLanguage(defaultLanguage: string): this;
14
105
  setContainerSelector(selector: string): this;
15
106
  editTimelineProviderSettings(): TimelineProvidersSettingsEditor;
16
- getConfiguration(callBack: (copy: IEngineConfiguration) => IEngineConfiguration | undefined): this;
107
+ getConfiguration(callBack?: (copy: IEngineConfiguration) => IEngineConfiguration | undefined): IEngineConfiguration;
17
108
  addLanguage(languageCode: string, languageLabel: string): this;
18
109
  _internalAddAction(collectionName: keyof TEngineConfigurationLists, action: IActionConfiguration): void;
19
110
  _initializeCollection<T, K extends keyof T>(parent: T, name: K): T[K];
@@ -21,7 +112,7 @@ export declare class ConfigurationFactory {
21
112
  addInitAction(action: IActionConfiguration): void;
22
113
  addEventAction(action: IActionConfiguration): void;
23
114
  addTimelineAction(uri: string, action: ITimelineActionConfiguration): void;
24
- createAction(name: string): import("./action-creator-factory").ActionCreator<IActionConfiguration>;
115
+ createAction(name: string): import("./action-creator-factory").EndableActionCreator<import("../types").IEndableActionConfiguration>;
25
116
  createInitAction(name: string): import("./action-creator-factory").EndableActionCreator<import("../types").IEndableActionConfiguration>;
26
117
  createEventAction(name: string): import("./action-creator-factory").ActionCreator<IActionConfiguration>;
27
118
  createTimelineAction(uri: string, name: string): import("./action-creator-factory").TimelineActionCreator;
@@ -31,8 +122,10 @@ export declare class ConfigurationFactory {
31
122
  _initializeLabel(id: string, labels: ILanguageLabel[]): ILanguageLabel;
32
123
  _getLabelTranslation(labelTranslations: ILabel[], languageCode: string): ILabel;
33
124
  addLabel(id: string, code: string, translation: string): this;
34
- editAction(id: string): ActionEditor<import("../types").IEndableActionConfiguration>;
125
+ removeLabel(id: string): this;
126
+ editAction(id: string): EndableActionEditor<import("../types").IEndableActionConfiguration>;
35
127
  editEventAction(id: string): ActionEditor<import("../types").IEventActionConfiguration>;
36
128
  editInitAction(id: string): EndableActionEditor<import("../types").IEndableActionConfiguration>;
37
129
  editTimelineAction(uri: string, id: string): TimelineActionEditor;
38
130
  }
131
+ export {};
@@ -3,6 +3,13 @@ import { ActionRegistryEventbusListener } from '../eventbus';
3
3
  import { IEventbus } from '../eventbus/types';
4
4
  import { IConfigurationResolver, ISimpleResourceImporter } from '../types';
5
5
  import { IEngineConfiguration, IResolvedEngineConfiguration } from './types';
6
+ /**
7
+ * Takes an `IEngineConfiguration` instance and return an `IResolvedEngineConfiguration`.
8
+ * This means all system names within the configuration will be resolved to their associated instances.
9
+ *
10
+ * If the given configuration includes event actions, then those will be registered in the given `ActionRegistryEventbusListener`.
11
+ *
12
+ */
6
13
  export declare class ConfigurationResolver implements IConfigurationResolver {
7
14
  private importer;
8
15
  private eventbus;
@@ -35,6 +35,14 @@ export interface IResolvedEngineConfiguration {
35
35
  timelineFlow?: ITimelineFlow;
36
36
  labels: ILanguageLabel[];
37
37
  }
38
+ export interface IResolvedActionConfiguration {
39
+ id: string;
40
+ name: string;
41
+ startOperations: IResolvedOperation[];
42
+ }
43
+ export interface IResolvedEndableActionConfiguration extends IResolvedActionConfiguration {
44
+ endOperations: IResolvedOperation[];
45
+ }
38
46
  export interface ITimelineFlow {
39
47
  }
40
48
  export interface ITimelineProviderSettings {
@@ -13,6 +13,13 @@ export interface IEventListenerControllerOperationData {
13
13
  actions: string[];
14
14
  actionOperationData?: TOperationData;
15
15
  }
16
+ /**
17
+ * This controller attaches to the given selected element and adds an event listener for the specified event name that
18
+ * executes the given actions with the given operation data.
19
+ *
20
+ * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,
21
+ * prefix the action name with `end:`.
22
+ */
16
23
  export declare class EventListenerController implements IController<IEventListenerControllerOperationData> {
17
24
  operationData?: IEventListenerControllerOperationData;
18
25
  actionInstanceInfos?: IActionInstanceInfo[];
@@ -20,9 +27,9 @@ export declare class EventListenerController implements IController<IEventListen
20
27
  constructor();
21
28
  init(operationData: IEventListenerControllerOperationData): void;
22
29
  attach(eventbus: IEventbus): void;
23
- _isStartAction(actionName: string): [boolean, string];
24
- _eventHandler(event: any): void;
25
- _executeAction(actions: IActionInstanceInfo[], operationData: TOperationData, idx: number): Promise<void>;
30
+ private _isStartAction;
31
+ private _eventHandler;
32
+ private _executeAction;
26
33
  detach(_eventbus: IEventbus): void;
27
34
  }
28
35
  export {};
@@ -1,21 +1,29 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
3
- import { ILabel } from '../types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
4
3
  import { IController } from './types';
5
4
  export interface ILabelControllerMetadata {
6
5
  selectedElement: JQuery;
7
6
  labelId: string;
8
7
  }
8
+ /**
9
+ * This controller attaches to the given selected element and renders the text associated with the given label id in it.
10
+ *
11
+ * The controller also listen for the `LANGUAGE_CHANGE` event and re-renders the text with the new language after such an event.
12
+ *
13
+ */
9
14
  export declare class LabelController implements IController<ILabelControllerMetadata> {
10
- listeners: TEventHandlerRemover[];
15
+ listeners: TEventbusRemover[];
11
16
  currentLanguage: string | null;
12
17
  operationData: ILabelControllerMetadata | null;
13
18
  labelData: Record<string, string>;
14
19
  name: string;
20
+ requestLabelDataBound?: (labelId: string) => void;
15
21
  init(operationData: ILabelControllerMetadata): void;
22
+ setLabelId(newLabelId: string): void;
16
23
  attach(eventbus: IEventbus): void;
17
- setLabel(): void;
24
+ private _requestLabelData;
25
+ private _setLabel;
18
26
  detach(_eventbus: IEventbus): void;
19
- handleLanguageChange(code: string): void;
20
- createTextDataLookup(data: ILabel[]): void;
27
+ private _handleLanguageChange;
28
+ private _createTextDataLookup;
21
29
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jquery" />
2
2
  import { AnimationItem, CanvasRendererConfig, HTMLRendererConfig, SVGRendererConfig } from 'lottie-web';
3
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
3
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
4
4
  import { IController } from './types';
5
5
  export interface IInnerMetadata {
6
6
  selectedElement: JQuery;
@@ -16,11 +16,17 @@ export interface IInnerMetadata {
16
16
  export interface ILottieControllerMetadata extends IInnerMetadata {
17
17
  url: string;
18
18
  }
19
+ /**
20
+ * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.
21
+ *
22
+ * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json
23
+ *
24
+ */
19
25
  export declare class LottieController implements IController<ILottieControllerMetadata> {
20
26
  name: string;
21
- currentLanguage: string | null;
27
+ currentLanguage: string;
22
28
  labelData: Record<string, Record<string, string>>;
23
- listeners: TEventHandlerRemover[];
29
+ eventbusRemovers: TEventbusRemover[];
24
30
  animationItem: AnimationItem | null;
25
31
  operationData: IInnerMetadata | null;
26
32
  serializedData: string | null;
@@ -29,12 +35,12 @@ export declare class LottieController implements IController<ILottieControllerMe
29
35
  endPosition: number;
30
36
  constructor();
31
37
  init(operationData: ILottieControllerMetadata): void;
32
- parseFilename(name: string): void;
38
+ private _parseFilename;
33
39
  attach(eventbus: IEventbus): void;
34
40
  detach(_eventbus: IEventbus): void;
35
- destroy(): void;
36
- createAnimation(): void;
37
- createTextDataLookup(data: any[]): void;
38
- handleLanguageChange(code: string): void;
39
- isIE(): boolean;
41
+ private _destroy;
42
+ private _createAnimation;
43
+ private _createTextDataLookup;
44
+ private _handleLanguageChange;
45
+ private _isIE;
40
46
  }
@@ -1,7 +1,6 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
- import { TResultCallback } from '../types';
5
4
  import { LabelController } from './label-controller';
6
5
  import { IController } from './types';
7
6
  export interface INavigationControllerOperationData {
@@ -16,24 +15,24 @@ export declare class NavigationController implements IController<INavigationCont
16
15
  ctrlLookup: Record<string, LabelController>;
17
16
  activeNavigationPoint: any | null;
18
17
  labelControllers: LabelController[];
19
- eventhandlers: TEventHandlerRemover[];
18
+ eventhandlers: TEventbusRemover[];
20
19
  eventbus: IEventbus | null;
21
20
  container: JQuery | null;
22
21
  constructor();
23
22
  init(operationData: TOperationData): void;
24
23
  attach(eventbus: IEventbus): void;
25
- initHistory(): void;
26
- getQueryVariable(variableIdx: number): string | null;
27
- handleRequestCurrentNavigation(resultCallback: TResultCallback): void;
24
+ private _initHistory;
25
+ private _getQueryVariable;
26
+ private _handleRequestCurrentNavigation;
28
27
  detach(eventbus: IEventbus): void;
29
- pushCurrentState(position?: number): void;
30
- buildHtml(parentElm: JQuery, data: any): void;
31
- addNavElement(parentElm: JQuery, data: any): void;
32
- addClickHandler(parentElm: JQuery, videoIndex: number): void;
33
- menuMouseupHandler(videoIndex: number): void;
34
- handleNavigateVideoUrl(index: number, requestedVideoPosition?: number): void;
35
- highlightMenu(index: number): void;
36
- handleVideoComplete(index: number): void;
37
- addLabel(parentElm: JQuery, labelId: string): void;
38
- buildNavigationData(data: any): any[];
28
+ private _pushCurrentState;
29
+ private _buildHtml;
30
+ private _addNavElement;
31
+ private _addClickHandler;
32
+ private _menuMouseupHandler;
33
+ private _handleNavigateVideoUrl;
34
+ private _highlightMenu;
35
+ private _handleVideoComplete;
36
+ private _addLabel;
37
+ private _buildNavigationData;
39
38
  }
@@ -1,22 +1,25 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { IController } from './types';
5
5
  export interface IProgressbarControllerOperationData {
6
6
  selectedElement: JQuery;
7
7
  textElement: JQuery;
8
8
  }
9
+ /**
10
+ * This controller renders a progressbar that displays the progress of the current timeline in the given selected element.
11
+ *
12
+ * The current progress as a percentage is rendered in the given text element.
13
+ */
9
14
  export declare class ProgressbarController implements IController<IProgressbarControllerOperationData> {
10
15
  name: string;
11
16
  selectedElement: JQuery | null;
12
17
  textElement: JQuery | null;
13
- detachers: TEventHandlerRemover[];
18
+ eventbusRemovers: TEventbusRemover[];
19
+ duration: number;
14
20
  init(operationData: TOperationData): void;
15
21
  attach(eventbus: IEventbus): void;
16
22
  detach(_eventbus: IEventbus): void;
17
- positionUpdateHandler({ position, duration, }: {
18
- position: number;
19
- duration: number;
20
- }): void;
21
- clickHandler(): void;
23
+ private _positionUpdateHandler;
24
+ private _clickHandler;
22
25
  }
@@ -1,24 +1,27 @@
1
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
1
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
2
2
  import { TOperationData } from '../operation/types';
3
3
  import { IController } from './types';
4
4
  export interface IRoutingControllerOperationData {
5
5
  json: any;
6
6
  }
7
+ /**
8
+ * This is a work in progress, do not use this yet please....
9
+ */
7
10
  export declare class RoutingController implements IController<IRoutingControllerOperationData> {
8
11
  name: string;
9
12
  navLookup: Record<string, any>;
10
13
  navVidIdLookup: Record<string, any>;
11
14
  navigation: any;
12
- eventhandlers: TEventHandlerRemover[];
15
+ eventhandlers: TEventbusRemover[];
13
16
  eventbus: IEventbus | null;
14
17
  constructor();
15
18
  init(operationData: TOperationData): void;
16
19
  attach(eventbus: IEventbus): void;
17
- handlePopstate(event: any): void;
20
+ private _handlePopstate;
18
21
  detach(_eventbus: IEventbus): void;
19
- handleBeforeRequestVideoUrl(_index: number, _requestedVideoPosition?: number, isHistoryRequest?: boolean): void;
20
- getQueryVariable(variableIdx: number): string;
21
- handlePushHistoryState(state: any): void;
22
- pushState(state: any): void;
23
- buildNavigationData(data: any): any[];
22
+ private _handleBeforeRequestVideoUrl;
23
+ private _getQueryVariable;
24
+ private _handlePushHistoryState;
25
+ private _pushState;
26
+ private _buildNavigationData;
24
27
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { IController } from './types';
5
5
  export interface ISubtitlesControllerOperationData {
@@ -14,10 +14,10 @@ export declare class SubtitlesController implements IController<ISubtitlesContro
14
14
  name: string;
15
15
  attach(eventbus: IEventbus): void;
16
16
  detach(_eventbus: IEventbus): void;
17
- internalDetach(detachMethods?: TEventHandlerRemover[]): void;
17
+ internalDetach(detachMethods?: TEventbusRemover[]): void;
18
18
  languageChangeHandler(newLanguage: string): void;
19
19
  removeTitle(container?: JQuery): void;
20
- onTimeHandler(arg: any): void;
20
+ onTimeHandler(position: number): void;
21
21
  onSeekedHandler(arg: any): void;
22
22
  setTitle(container: JQuery, titleLanguageLookup: Record<string, string>): void;
23
23
  createActionLookup(operationData: TOperationData, container: JQuery): Record<number, () => void>;
@@ -1,8 +1,28 @@
1
+ export declare type TDevToolsEventSubscriber = (event: TEventData) => void;
2
+ export declare type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';
3
+ export declare const DEV_TOOLS_KEY = "__ELIGIUS_DEV_TOOLS__";
4
+ export declare type TWindowWithDevtools = Window & {
5
+ [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;
6
+ };
7
+ export declare type TDevToolsMessage = {
8
+ source: 'eligius-inspect-devtools';
9
+ name: 'event';
10
+ data: TEventData;
11
+ };
12
+ export declare type TEventData = {
13
+ type: 'playcontrol';
14
+ data: IPlayControlEvent;
15
+ };
16
+ export interface IPlayControlEvent {
17
+ kind: TPlayControlEventKind;
18
+ args?: any[];
19
+ }
1
20
  export interface IDiagnosticsAgent {
2
- postMessage(name: TDiagnosticType, data: any): void;
21
+ postMessage(name: TDiagnosticType, messageData: any): void;
22
+ subscribe(subscriber: TDevToolsEventSubscriber): () => void;
3
23
  }
4
24
  export interface IDiagnosticsInfo {
5
25
  get agent(): IDiagnosticsAgent;
6
26
  }
7
27
  export declare type TDiagnosticType = 'eligius-diagnostics-factory' | 'eligius-diagnostics-engine' | 'eligius-diagnostics-event' | 'eligius-diagnostics-action' | 'eligius-diagnostics-action-error' | 'eligius-diagnostics-operation';
8
- export declare const DEV_TOOLS_KEY = "__ELIGIUS_DEV_TOOLS__";
28
+ export declare type TDiagnosticsMessageSource = 'eligius-inspect-agent' | 'eligius-inspect-devtools';