eligius 1.0.81 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) 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 +5 -3
  5. package/dist/action/types.d.ts +1 -1
  6. package/dist/build/generate-importer-source-code.d.ts +1 -1
  7. package/dist/configuration/api/action-creator-factory.d.ts +1 -1
  8. package/dist/configuration/api/configuration-factory.d.ts +104 -8
  9. package/dist/configuration/api/label-editor.d.ts +11 -0
  10. package/dist/configuration/configuration-resolver.d.ts +7 -0
  11. package/dist/configuration/types.d.ts +8 -0
  12. package/dist/controllers/event-listener-controller.d.ts +10 -3
  13. package/dist/controllers/label-controller.d.ts +13 -4
  14. package/dist/controllers/lottie-controller.d.ts +14 -8
  15. package/dist/controllers/navigation-controller.d.ts +13 -14
  16. package/dist/controllers/progressbar-controller.d.ts +9 -6
  17. package/dist/controllers/routing-controller.d.ts +9 -6
  18. package/dist/controllers/subtitles-controller.d.ts +1 -1
  19. package/dist/eligius-engine.d.ts +46 -10
  20. package/dist/eligius.cjs.development.js +5210 -3472
  21. package/dist/eligius.cjs.development.js.map +1 -1
  22. package/dist/eligius.cjs.production.min.js +1 -1
  23. package/dist/eligius.cjs.production.min.js.map +1 -1
  24. package/dist/eligius.esm.js +5186 -3470
  25. package/dist/eligius.esm.js.map +1 -1
  26. package/dist/engine-factory.d.ts +17 -0
  27. package/dist/eventbus/actionregistry-eventbus-listener.d.ts +4 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/language-manager.d.ts +6 -0
  30. package/dist/operation/add-controller-to-element.d.ts +5 -5
  31. package/dist/operation/animate-with-class.d.ts +1 -1
  32. package/dist/operation/animate.d.ts +2 -2
  33. package/dist/operation/calc.d.ts +2 -2
  34. package/dist/operation/clear-element.d.ts +2 -1
  35. package/dist/operation/clear-operation-data.d.ts +1 -0
  36. package/dist/operation/create-element.d.ts +2 -4
  37. package/dist/operation/custom-function.d.ts +1 -1
  38. package/dist/operation/end-action.d.ts +5 -1
  39. package/dist/operation/end-loop.d.ts +1 -2
  40. package/dist/operation/end-when.d.ts +8 -0
  41. package/dist/operation/get-attributes-from-element.d.ts +20 -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 +4 -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 +8 -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-attributes-from-element.d.ts +4 -0
  61. package/dist/operation/metadata/get-query-params.d.ts +4 -0
  62. package/dist/operation/metadata/index.d.ts +8 -0
  63. package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
  64. package/dist/operation/metadata/otherwise.d.ts +3 -0
  65. package/dist/operation/metadata/set-data.d.ts +4 -0
  66. package/dist/operation/metadata/set-global-data.d.ts +4 -0
  67. package/dist/operation/metadata/start-loop.d.ts +2 -2
  68. package/dist/operation/metadata/types.d.ts +1 -1
  69. package/dist/operation/metadata/when.d.ts +4 -0
  70. package/dist/operation/otherwise.d.ts +9 -0
  71. package/dist/operation/remove-class.d.ts +1 -1
  72. package/dist/operation/remove-controller-from-element.d.ts +1 -1
  73. package/dist/operation/remove-element.d.ts +1 -1
  74. package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
  75. package/dist/operation/reparent-element.d.ts +2 -2
  76. package/dist/operation/request-action.d.ts +1 -1
  77. package/dist/operation/select-element.d.ts +3 -4
  78. package/dist/operation/set-data.d.ts +21 -0
  79. package/dist/operation/set-element-attributes.d.ts +1 -1
  80. package/dist/operation/set-element-content.d.ts +4 -4
  81. package/dist/operation/set-global-data.d.ts +11 -0
  82. package/dist/operation/set-operation-data.d.ts +1 -1
  83. package/dist/operation/set-style.d.ts +4 -5
  84. package/dist/operation/start-action.d.ts +3 -3
  85. package/dist/operation/start-loop.d.ts +7 -6
  86. package/dist/operation/toggle-class.d.ts +10 -1
  87. package/dist/operation/toggle-element.d.ts +7 -1
  88. package/dist/operation/types.d.ts +45 -3
  89. package/dist/operation/wait.d.ts +3 -3
  90. package/dist/operation/when.d.ts +18 -0
  91. package/dist/timeline-event-names.d.ts +46 -4
  92. package/dist/timelineproviders/index.d.ts +0 -1
  93. package/dist/timelineproviders/media-element-timeline-provider.d.ts +20 -12
  94. package/dist/timelineproviders/request-animation-frame-timeline-provider.d.ts +19 -20
  95. package/dist/timelineproviders/types.d.ts +10 -2
  96. package/dist/{schema-tools/generate-operation-schemas.d.ts → tools/doc-tools/generate-readmes.d.ts} +0 -0
  97. package/dist/tools/schema-tools/generate-operation-schemas.d.ts +1 -0
  98. package/dist/{schema-tools → tools/schema-tools}/html-tag-names.d.ts +0 -0
  99. package/dist/types.d.ts +42 -3
  100. package/dist/util/guards/is-function.d.ts +1 -0
  101. package/dist/util/guards/is-object.d.ts +1 -0
  102. package/dist/util/guards/is-promise.d.ts +1 -0
  103. package/dist/util/guards/is-string.d.ts +1 -0
  104. package/package.json +19 -13
  105. package/dist/action/is-promise.d.ts +0 -1
  106. package/dist/operation/helper/extract-operation-data-argument-values.d.ts +0 -1
  107. package/dist/operation/helper/get-globals.d.ts +0 -1
  108. package/dist/operation/helper/get-nested-property-value.d.ts +0 -1
  109. package/dist/operation/helper/get-nested-value.d.ts +0 -1
  110. package/dist/timelineproviders/jwplayer-timeline-provider.d.ts +0 -42
@@ -0,0 +1,4 @@
1
+ import { IWhenOperationData } from '../../operation/when';
2
+ import { IOperationMetadata } from './types';
3
+ declare function wait(): IOperationMetadata<IWhenOperationData>;
4
+ export default wait;
@@ -0,0 +1,9 @@
1
+ import { TOperation } from './types';
2
+ /**
3
+ * If the preceeding {@link when} operation evaluates to `true` subsequent operations will
4
+ * be skipped until an {@link endWhen} operation is encountered.
5
+ *
6
+ * @param operationData
7
+ * @returns
8
+ */
9
+ export declare const otherwise: TOperation<{}>;
@@ -5,7 +5,7 @@ export interface IRemoveClassOperationData {
5
5
  className: string;
6
6
  }
7
7
  /**
8
- * This operation removes the spcified class name from the specified selected element.
8
+ * This operation removes the spcified class name from the given selected element.
9
9
  *
10
10
  * @param operationData
11
11
  * @returns
@@ -5,7 +5,7 @@ export interface IRemoveControllerFromElementOperationData {
5
5
  controllerName: string;
6
6
  }
7
7
  /**
8
- * This operation removes the controller with the specified name from the specified selected element.
8
+ * This operation removes the controller with the specified name from the given selected element.
9
9
  *
10
10
  * @param operationData
11
11
  * @returns
@@ -4,7 +4,7 @@ export interface IRemoveElementOperationData {
4
4
  selectedElement: JQuery;
5
5
  }
6
6
  /**
7
- * This operation removes the specified selected element from the DOM.
7
+ * This operation removes the given selected element from the DOM.
8
8
  *
9
9
  * @param operationData
10
10
  * @returns
@@ -4,6 +4,7 @@ export interface IRemovePropertiesFromOperationDataOperationData {
4
4
  }
5
5
  /**
6
6
  * This operation removes the given list of properties from the current operation data.
7
+ * It will also omit the property 'propertyNames' from the result.
7
8
  *
8
9
  * @param operationData
9
10
  * @returns
@@ -5,8 +5,8 @@ export interface IReparentElementOperationData {
5
5
  newParentSelector: string;
6
6
  }
7
7
  /**
8
- * This operation moves the specified selected element to the new parent that is defined
9
- * by the specified selector.
8
+ * This operation moves the given selected element to the new parent that is defined
9
+ * by the specified `newParentSelector`.
10
10
  *
11
11
  * @param operationData
12
12
  * @returns
@@ -6,7 +6,7 @@ export interface IRequestActionOperationData {
6
6
  }
7
7
  /**
8
8
  * This operation requests an action instance with the specified name and assigns it
9
- * to the actionInstance property on the current operation data.
9
+ * to the `actionInstance` property on the current operation data.
10
10
  *
11
11
  * @param operationData
12
12
  * @returns
@@ -2,16 +2,15 @@
2
2
  import { TOperation } from './types';
3
3
  export interface ISelectElementOperationData {
4
4
  selector: string;
5
- propertyName?: string;
6
5
  useSelectedElementAsRoot?: boolean;
7
6
  selectedElement?: JQuery;
8
7
  }
9
8
  /**
10
9
  * This operation selects one or more elements using the specified selector.
11
10
  *
12
- * If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
13
- * to the current operation data defined by the given property name (defaults to 'selectedElement')
14
- * then the element will be looked for only in the child elements of this DOM element.
11
+ * If `useSelectedElementAsRoot` is set to true and a valid DOM element is assigned
12
+ * to the current operation data's `selectedElement` property
13
+ * then the element will be looked for only in the descendant elements of this DOM element.
15
14
  *
16
15
  * @param operationData
17
16
  * @returns
@@ -0,0 +1,21 @@
1
+ import { TOperation } from './types';
2
+ export declare type TDataTarget = `context.${string}` | `operationdata.${string}` | `globaldata.${string}`;
3
+ export interface ISetDataOperationData {
4
+ properties: Record<TDataTarget, any>;
5
+ }
6
+ /**
7
+ * This operation assigns the specified properties to the specified data targets.
8
+ *
9
+ * @example The various ways of assigning data
10
+ * ```ts
11
+ * setData({
12
+ * 'operationdata.foo': 'context.currentItem', // context.currentItem will be assigned to operationdata.foo
13
+ * 'globaldata.foo': 'context.currentItem', // context.currentItem will be assigned to globaldata.foo
14
+ * 'context.newIndex': 100, // The constant 100 will be assigned to context.newIndex
15
+ * })
16
+ * ```
17
+ *
18
+ * @param operationData
19
+ * @returns
20
+ */
21
+ export declare const setData: TOperation<ISetDataOperationData>;
@@ -5,7 +5,7 @@ export interface ISetElementAttributesOperationData {
5
5
  selectedElement: JQuery;
6
6
  }
7
7
  /**
8
- * This operation sets the given set of attributes on the specified selected element.
8
+ * This operation sets the specified set of attributes on the given selected element.
9
9
  *
10
10
  * @param operationData
11
11
  * @returns
@@ -7,12 +7,12 @@ export interface ISetElementContentOperationData {
7
7
  }
8
8
  /**
9
9
  * This operation sets the specified content defined by the value assigned to the template property
10
- * to the specified selected element.
10
+ * to the given selected element.
11
11
  *
12
- * When the insertionType is set to 'overwrite' the contents of the selected element are replaced
12
+ * When the `insertionType` is set to `overwrite` the contents of the selected element are replaced
13
13
  * by the given template.
14
- * When set to 'append' the new content will be inserted after the current content.
15
- * When set to 'prepend' the new content will be inserted before the current content.
14
+ * When set to `append` the new content will be inserted after the current content.
15
+ * When set to `prepend` the new content will be inserted before the current content.
16
16
  *
17
17
  * @param operationData
18
18
  * @returns
@@ -0,0 +1,11 @@
1
+ import { TOperation } from './types';
2
+ export interface ISetGlobalDataOperationData {
3
+ properties: string[];
4
+ }
5
+ /**
6
+ * This operation copies the specified property values from the operationData to the global data.
7
+ *
8
+ * @param operationData
9
+ * @returns
10
+ */
11
+ export declare const setGlobalData: TOperation<ISetGlobalDataOperationData>;
@@ -1,7 +1,7 @@
1
1
  import { TOperation } from './types';
2
2
  export interface ISetOperationData {
3
3
  override?: boolean;
4
- properties: any;
4
+ properties: Record<string, any>;
5
5
  }
6
6
  /**
7
7
  * This operation assigns the specified properties to the current operation data.
@@ -1,13 +1,12 @@
1
+ /// <reference types="jquery" />
1
2
  import { TOperation } from './types';
2
3
  export interface ISetStyleOperationData {
3
- properties: any;
4
- propertyName?: string;
4
+ properties: Record<string, any>;
5
+ selectedElement: JQuery;
5
6
  }
6
7
  /**
7
8
  * This operation assigns the specified CSS style properties to the
8
- * specified selected element. The selected element is assigned to
9
- * the property defined by the propertyName property which defaults
10
- * to 'selectedElement'.
9
+ * given selected element.
11
10
  *
12
11
  * @param operationData
13
12
  * @returns
@@ -1,11 +1,11 @@
1
1
  import { IAction } from '../action/types';
2
- import { TOperation } from './types';
2
+ import { TOperation, TOperationData } from './types';
3
3
  export interface IStartActionOperationData {
4
4
  actionInstance: IAction;
5
- actionOperationData: any;
5
+ actionOperationData: TOperationData;
6
6
  }
7
7
  /**
8
- * This operation starts the specified action instance using the specified action operation data.
8
+ * This operation starts the specified action instance using the given action operation data.
9
9
  *
10
10
  * The action operation data is first merged with the current operation data before it is
11
11
  * passed on to the action. After the action has completed the action operation data properties
@@ -1,16 +1,17 @@
1
1
  import { TOperation } from './types';
2
- export declare type TStartLoopOperationData = {
2
+ export interface IStartLoopOperationData {
3
3
  collection: any[] | string;
4
- propertyName?: string;
5
- };
4
+ }
6
5
  /**
7
6
  * This operation starts a loop using the given collection.
8
7
  *
9
8
  * Each iteration the current item from the specified collection is
10
- * assigned to the property on the current operation data specified
11
- * by the propertyName property which defaults to 'currentItem'.
9
+ * assigned to the {@link IOperationContext.currentItem} property on the operation context.
10
+ *
11
+ * At the start of the loop, the associated {@link endLoop} operation is determined and when
12
+ * the last iteration is completed the flow control is set to the index of that operation.
12
13
  *
13
14
  * @param operationData
14
15
  * @returns
15
16
  */
16
- export declare const startLoop: TOperation<TStartLoopOperationData>;
17
+ export declare const startLoop: TOperation<IStartLoopOperationData>;
@@ -1,11 +1,20 @@
1
1
  /// <reference types="jquery" />
2
2
  import { TOperation } from './types';
3
3
  export interface IToggleClassOperationData {
4
+ /**
5
+ * The element on which the class will be toggled
6
+ */
4
7
  selectedElement: JQuery;
8
+ /**
9
+ * The class that will be toggled
10
+ */
5
11
  className: string;
6
12
  }
7
13
  /**
8
- * This operation toggles the specfied class name on the specified selected element.
14
+ * This operation toggles the specfied class name on the given selected element.
15
+ *
16
+ * Meaning, if the specified class name exists on the given element it will be removed,
17
+ * otherwise it will be added.
9
18
  *
10
19
  * @param operationData
11
20
  * @returns
@@ -1,10 +1,16 @@
1
1
  /// <reference types="jquery" />
2
2
  import { TOperation } from './types';
3
3
  export interface IToggleElementOperationData {
4
+ /**
5
+ * The element whose visibility will be toggled
6
+ */
4
7
  selectedElement: JQuery;
5
8
  }
6
9
  /**
7
- * This operation toggles the visibility of the specified selected element
10
+ * This operation toggles the visibility of the given selected element.
11
+ *
12
+ * Meaning, if the element is hidden, it will be made visible, otherwise
13
+ * it will be hidden.
8
14
  *
9
15
  * @param operationData
10
16
  * @returns
@@ -1,13 +1,55 @@
1
+ import { IResolvedOperation } from '../configuration/types';
1
2
  import { IEventbus } from '../eventbus';
2
- export declare type TOperationData = any;
3
+ export declare type TOperationData = Record<string, any>;
3
4
  export declare type TOperationResult<T = TOperationData> = Promise<T> | T;
4
5
  export interface IOperationContext {
6
+ /**
7
+ * When inside a loop, this is the current iteration of said loop
8
+ */
5
9
  loopIndex?: number;
10
+ /**
11
+ * The number of iterations for the current loop
12
+ */
6
13
  loopLength?: number;
7
- startIndex?: number;
14
+ /**
15
+ * The start index of the loop within the total number of operations
16
+ */
17
+ loopStartIndex?: number;
18
+ /**
19
+ * The end index of the loop within the total number of operations
20
+ */
21
+ loopEndIndex?: number;
22
+ /**
23
+ * Set this index to change the current item in the main operations loop
24
+ */
8
25
  newIndex?: number;
26
+ /**
27
+ * The current index with in the main operations loop
28
+ */
9
29
  currentIndex: number;
10
- skipNextOperation?: boolean;
30
+ /**
31
+ * The eventbus instance shared amongst actions and operations
32
+ */
11
33
  eventbus: IEventbus;
34
+ /**
35
+ * The list of operations that is currently being executed
36
+ */
37
+ operations: IResolvedOperation[];
38
+ /**
39
+ * The result of the last when evaluation, if any
40
+ */
41
+ whenEvaluation?: boolean;
42
+ /**
43
+ *
44
+ */
45
+ owner?: any;
46
+ /**
47
+ *
48
+ */
49
+ currentItem?: any;
50
+ /**
51
+ *
52
+ */
53
+ parent?: IOperationContext;
12
54
  }
13
55
  export declare type TOperation<T = TOperationData> = (this: IOperationContext, operationData: T) => TOperationResult<T>;
@@ -1,8 +1,8 @@
1
1
  import { TOperation } from './types';
2
- /**
3
- *
4
- */
5
2
  export interface IWaitOperationData {
3
+ /**
4
+ * The amount of milliseconds the operation will wait for.
5
+ */
6
6
  milliseconds: number;
7
7
  }
8
8
  /**
@@ -0,0 +1,18 @@
1
+ import { TOperation } from './types';
2
+ declare type TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';
3
+ declare type TValue = `'${string}'` | number | `operationdata.${string}` | `globaldata.${string}` | `context.${string}`;
4
+ declare type TExpression = `${TValue}${TOperator}${TValue}`;
5
+ export interface IWhenOperationData {
6
+ expression: TExpression;
7
+ }
8
+ /**
9
+ * When the given expression evaluates to false, subsequent operations will be skipped
10
+ * until an {@link endWhen} or {@link otherwise} operation is encountered.
11
+ *
12
+ * Practically, this means an `if` or `if`/`else` statement control flow implementation in a list of operations.
13
+ *
14
+ * @param operationData
15
+ * @returns
16
+ */
17
+ export declare const when: TOperation<IWhenOperationData>;
18
+ export {};
@@ -1,16 +1,62 @@
1
+ /**
2
+ * These are the event names that are being braodcast and/or handled by Eligius.
3
+ */
1
4
  export declare class TimelineEventNames {
5
+ /**
6
+ * Broadcasting this event will start the current timeline when it is currently paused, or pauses when it is playing.
7
+ */
2
8
  static PLAY_TOGGLE_REQUEST: string;
9
+ /**
10
+ * Broadcasting this event will start the current timeline.
11
+ */
3
12
  static PLAY_REQUEST: string;
13
+ /**
14
+ * Broadcasting this event will stop the current timeline.
15
+ */
4
16
  static STOP_REQUEST: string;
17
+ /**
18
+ * Broadcasting this event will pause the current timeline.
19
+ */
5
20
  static PAUSE_REQUEST: string;
21
+ /**
22
+ * Broadcasting this event will seek the specified position in the current timeline.
23
+ * This event takes one argument: A numeric value that represents the new position.
24
+ */
6
25
  static SEEK_REQUEST: string;
26
+ /**
27
+ * Broadcasting this event will tell the current {@link ITimelineProvider} to resize.
28
+ */
7
29
  static RESIZE_REQUEST: string;
30
+ /**
31
+ * Broadcasting this event will return the element in which the current timeline is being rendered.
32
+ * This event takes one argument: The callback function that will return the specified element.
33
+ */
8
34
  static CONTAINER_REQUEST: string;
35
+ /**
36
+ * Broadcasting this event will return the duration of the current timeline.
37
+ * This event takes one argument: The callback function that will return the duration.
38
+ */
9
39
  static DURATION_REQUEST: string;
40
+ /**
41
+ * Broadcasting this event will return the uri of the current timeline.
42
+ * This event takes one argument: The callback function that will return the uri.
43
+ */
10
44
  static REQUEST_CURRENT_TIMELINE: string;
45
+ /**
46
+ * This event is broadcast by {@link ITimelineProvider} instances to announce their duration.
47
+ */
11
48
  static DURATION: string;
49
+ /**
50
+ * This event is broadcast by {@link ITimelineProvider} instances to announce the current play position whenever it changes.
51
+ */
12
52
  static TIME: string;
53
+ /**
54
+ * This event is broadcast by {@link ITimelineProvider} instances to announce the new play position and duration after a seek was executed.
55
+ */
13
56
  static SEEKED: string;
57
+ /**
58
+ *
59
+ */
14
60
  static COMPLETE: string;
15
61
  static RESTART: string;
16
62
  static PLAY: string;
@@ -18,8 +64,6 @@ export declare class TimelineEventNames {
18
64
  static PAUSE: string;
19
65
  static SEEK: string;
20
66
  static RESIZE: string;
21
- static POSITION_UPDATE: string;
22
- static TIME_UPDATE: string;
23
67
  static CURRENT_TIMELINE_CHANGE: string;
24
68
  static FIRST_FRAME: string;
25
69
  static REQUEST_INSTANCE: string;
@@ -30,8 +74,6 @@ export declare class TimelineEventNames {
30
74
  static REQUEST_ENGINE_ROOT: string;
31
75
  static REQUEST_CURRENT_TIMELINE_POSITION: string;
32
76
  static REQUEST_TIMELINE_CLEANUP: string;
33
- static EXECUTE_TIMELINEACTION: string;
34
- static RESIZE_TIMELINEACTION: string;
35
77
  static REQUEST_LABEL_COLLECTION: string;
36
78
  static REQUEST_LABEL_COLLECTIONS: string;
37
79
  static REQUEST_CURRENT_LANGUAGE: string;
@@ -1,2 +1 @@
1
- export { JwPlayerTimelineProvider } from './jwplayer-timeline-provider';
2
1
  export { RequestAnimationFrameTimelineProvider } from './request-animation-frame-timeline-provider';
@@ -1,22 +1,32 @@
1
+ /// <reference types="jquery" />
1
2
  import 'mediaelement';
2
3
  import { IResolvedEngineConfiguration } from '../configuration/types';
3
- import { IEventbus } from '../eventbus/types';
4
- import { TResultCallback } from '../types';
5
- import { ITimelineProvider } from './types';
4
+ import { ITimelineProvider, TPlayState } from './types';
6
5
  export declare class MediaElementTimelineProvider implements ITimelineProvider {
7
- private eventbus;
8
6
  private config;
9
7
  private _videoElementId;
10
- private _eventbusListeners;
8
+ private _firstFramePending;
11
9
  private _playlist;
12
10
  private _length;
13
11
  private _urls;
14
- player: mediaelementjs.MediaElementPlayer | undefined;
12
+ private _onTime;
13
+ private _onComplete;
14
+ private _onRestart;
15
+ private _onFirstFrame;
16
+ private _player;
15
17
  loop: boolean;
16
- constructor(eventbus: IEventbus, config: IResolvedEngineConfiguration);
17
- _addEventListeners(): void;
18
+ private _playState;
19
+ get playState(): TPlayState;
20
+ constructor(config: IResolvedEngineConfiguration);
18
21
  _extractUrls(configuration: IResolvedEngineConfiguration): string[];
19
22
  init(): Promise<void>;
23
+ private _endedHandler;
24
+ private _playingHandler;
25
+ private _pauseHandler;
26
+ onTime(callback: (position: number) => void): void;
27
+ onComplete(callback: () => void): void;
28
+ onRestart(callback: () => void): void;
29
+ onFirstFrame(callback: () => void): void;
20
30
  private _timeUpdateHandler;
21
31
  private _addVideoElements;
22
32
  _extractFileType(url: string): string;
@@ -25,10 +35,8 @@ export declare class MediaElementTimelineProvider implements ITimelineProvider {
25
35
  stop(): void;
26
36
  destroy(): void;
27
37
  pause(): void;
28
- seek(position: number): void;
29
- resize(): void;
30
- duration(resultCallback: TResultCallback): void;
38
+ seek(position: number): Promise<number>;
31
39
  getDuration(): number;
32
40
  getPosition(): number;
33
- _container(resultCallback: TResultCallback): void;
41
+ getContainer(): JQuery<HTMLElement> | undefined;
34
42
  }
@@ -1,41 +1,40 @@
1
+ /// <reference types="jquery" />
1
2
  import { IResolvedEngineConfiguration } from '../configuration/types';
2
- import { IEventbus } from '../eventbus/types';
3
- import { TResultCallback } from '../types';
4
- import { ITimelineProvider } from './types';
5
- declare type TPlayState = 'stopped' | 'running' | 'paused';
3
+ import { ITimelineProvider, TPlayState } from './types';
6
4
  export declare class RequestAnimationFrameTimelineProvider implements ITimelineProvider {
7
- private eventbus;
8
- private config;
9
5
  private _currentPosition;
10
6
  private _updateBound;
11
- private _eventbusListeners;
12
- private _firstFrame;
7
+ private _firstFramePending;
13
8
  private _currentPlaylistItem;
14
9
  private _tickInterval;
15
10
  private _playlist;
16
11
  private _containerElement;
17
12
  private _abortController;
18
- playState: TPlayState;
13
+ private _onTime;
14
+ private _onComplete;
15
+ private _onRestart;
16
+ private _onFirstFrame;
19
17
  loop: boolean;
20
- constructor(eventbus: IEventbus, config: IResolvedEngineConfiguration);
18
+ private _playState;
19
+ get playState(): TPlayState;
20
+ constructor(config: IResolvedEngineConfiguration);
21
21
  private _extractPlaylist;
22
+ onTime(callback: (position: number) => void): void;
23
+ onComplete(callback: () => void): void;
24
+ onRestart(callback: () => void): void;
25
+ onFirstFrame(callback: () => void): void;
22
26
  playlistItem(uri: string): void;
23
- private _addEventListeners;
24
27
  private _update;
25
- private _start;
28
+ private _callbackPosition;
29
+ start(): void;
26
30
  private _resetToStartPosition;
27
- private _resize;
28
- private _container;
31
+ getContainer(): JQuery<HTMLElement> | undefined;
29
32
  private _stopAnimationInterval;
30
- init(): Promise<any>;
33
+ init(): Promise<void>;
31
34
  destroy(): void;
32
- toggleplay(): void;
33
- start(): void;
34
35
  stop(): void;
35
36
  pause(): void;
36
- seek(position: number): void;
37
+ seek(position: number): Promise<number>;
37
38
  getPosition(): number;
38
39
  getDuration(): number;
39
- requestDurationHandler(callBack: TResultCallback): void;
40
40
  }
41
- export {};
@@ -1,12 +1,20 @@
1
+ /// <reference types="jquery" />
2
+ export declare type TPlayState = 'stopped' | 'running';
1
3
  export interface ITimelineProvider {
2
4
  loop: boolean;
3
- init(): Promise<any>;
5
+ init(): Promise<void>;
4
6
  start(): void;
5
7
  stop(): void;
6
8
  pause(): void;
7
- seek(position: number): void;
9
+ seek(position: number): Promise<number>;
8
10
  playlistItem(uri: string): void;
9
11
  getPosition(): number;
10
12
  getDuration(): number;
13
+ getContainer(): JQuery<HTMLElement> | undefined;
11
14
  destroy(): void;
15
+ onTime(callback: (position: number) => void): void;
16
+ onComplete(callback: () => void): void;
17
+ onRestart(callback: () => void): void;
18
+ onFirstFrame(callback: () => void): void;
19
+ playState: TPlayState;
12
20
  }