eligius 1.0.81 → 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 (104) 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 +12 -4
  12. package/dist/controllers/lottie-controller.d.ts +14 -8
  13. package/dist/controllers/navigation-controller.d.ts +13 -14
  14. package/dist/controllers/progressbar-controller.d.ts +9 -6
  15. package/dist/controllers/routing-controller.d.ts +9 -6
  16. package/dist/controllers/subtitles-controller.d.ts +1 -1
  17. package/dist/eligius-engine.d.ts +35 -7
  18. package/dist/eligius.cjs.development.js +5095 -3574
  19. package/dist/eligius.cjs.development.js.map +1 -1
  20. package/dist/eligius.cjs.production.min.js +1 -1
  21. package/dist/eligius.cjs.production.min.js.map +1 -1
  22. package/dist/eligius.esm.js +5073 -3572
  23. package/dist/eligius.esm.js.map +1 -1
  24. package/dist/engine-factory.d.ts +17 -0
  25. package/dist/eventbus/actionregistry-eventbus-listener.d.ts +4 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/language-manager.d.ts +6 -0
  28. package/dist/operation/add-controller-to-element.d.ts +5 -5
  29. package/dist/operation/animate-with-class.d.ts +1 -1
  30. package/dist/operation/animate.d.ts +2 -2
  31. package/dist/operation/calc.d.ts +2 -2
  32. package/dist/operation/clear-element.d.ts +2 -1
  33. package/dist/operation/clear-operation-data.d.ts +1 -0
  34. package/dist/operation/create-element.d.ts +2 -4
  35. package/dist/operation/custom-function.d.ts +1 -1
  36. package/dist/operation/end-action.d.ts +5 -1
  37. package/dist/operation/end-loop.d.ts +1 -2
  38. package/dist/operation/end-when.d.ts +8 -0
  39. package/dist/operation/get-controller-from-element.d.ts +1 -1
  40. package/dist/operation/get-controller-instance.d.ts +3 -5
  41. package/dist/operation/get-element-dimensions.d.ts +2 -2
  42. package/dist/operation/get-query-params.d.ts +28 -0
  43. package/dist/operation/helper/find-matching-operation-index.d.ts +35 -0
  44. package/dist/operation/helper/get-property-chain-value.d.ts +24 -0
  45. package/dist/operation/helper/globals.d.ts +3 -0
  46. package/dist/operation/helper/remove-global.d.ts +1 -0
  47. package/dist/operation/helper/resolve-event-arguments.d.ts +2 -2
  48. package/dist/operation/helper/resolve-external-property-chain.d.ts +14 -0
  49. package/dist/operation/helper/resolve-property-chain.d.ts +23 -0
  50. package/dist/operation/helper/resolve-property-values.d.ts +11 -2
  51. package/dist/operation/index.d.ts +6 -0
  52. package/dist/operation/invoke-object-method.d.ts +28 -0
  53. package/dist/operation/load-json.d.ts +11 -3
  54. package/dist/operation/log.d.ts +3 -3
  55. package/dist/operation/math.d.ts +2 -2
  56. package/dist/operation/metadata/end-when.d.ts +3 -0
  57. package/dist/operation/metadata/get-query-params.d.ts +4 -0
  58. package/dist/operation/metadata/index.d.ts +6 -0
  59. package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
  60. package/dist/operation/metadata/otherwise.d.ts +3 -0
  61. package/dist/operation/metadata/set-global-data.d.ts +4 -0
  62. package/dist/operation/metadata/start-loop.d.ts +2 -2
  63. package/dist/operation/metadata/types.d.ts +1 -1
  64. package/dist/operation/metadata/when.d.ts +4 -0
  65. package/dist/operation/otherwise.d.ts +9 -0
  66. package/dist/operation/remove-class.d.ts +1 -1
  67. package/dist/operation/remove-controller-from-element.d.ts +1 -1
  68. package/dist/operation/remove-element.d.ts +1 -1
  69. package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
  70. package/dist/operation/reparent-element.d.ts +2 -2
  71. package/dist/operation/request-action.d.ts +1 -1
  72. package/dist/operation/select-element.d.ts +3 -4
  73. package/dist/operation/set-element-attributes.d.ts +1 -1
  74. package/dist/operation/set-element-content.d.ts +4 -4
  75. package/dist/operation/set-global-data.d.ts +11 -0
  76. package/dist/operation/set-operation-data.d.ts +1 -1
  77. package/dist/operation/set-style.d.ts +4 -5
  78. package/dist/operation/start-action.d.ts +3 -3
  79. package/dist/operation/start-loop.d.ts +7 -6
  80. package/dist/operation/toggle-class.d.ts +10 -1
  81. package/dist/operation/toggle-element.d.ts +7 -1
  82. package/dist/operation/types.d.ts +45 -3
  83. package/dist/operation/wait.d.ts +3 -3
  84. package/dist/operation/when.d.ts +18 -0
  85. package/dist/timeline-event-names.d.ts +46 -2
  86. package/dist/timelineproviders/index.d.ts +0 -1
  87. package/dist/timelineproviders/media-element-timeline-provider.d.ts +20 -12
  88. package/dist/timelineproviders/request-animation-frame-timeline-provider.d.ts +19 -20
  89. package/dist/timelineproviders/types.d.ts +10 -2
  90. package/dist/{schema-tools/generate-operation-schemas.d.ts → tools/doc-tools/generate-readmes.d.ts} +0 -0
  91. package/dist/tools/schema-tools/generate-operation-schemas.d.ts +1 -0
  92. package/dist/{schema-tools → tools/schema-tools}/html-tag-names.d.ts +0 -0
  93. package/dist/types.d.ts +42 -3
  94. package/dist/util/guards/is-function.d.ts +1 -0
  95. package/dist/util/guards/is-object.d.ts +1 -0
  96. package/dist/util/guards/is-promise.d.ts +1 -0
  97. package/dist/util/guards/is-string.d.ts +1 -0
  98. package/package.json +18 -12
  99. package/dist/action/is-promise.d.ts +0 -1
  100. package/dist/operation/helper/extract-operation-data-argument-values.d.ts +0 -1
  101. package/dist/operation/helper/get-globals.d.ts +0 -1
  102. package/dist/operation/helper/get-nested-property-value.d.ts +0 -1
  103. package/dist/operation/helper/get-nested-value.d.ts +0 -1
  104. package/dist/timelineproviders/jwplayer-timeline-provider.d.ts +0 -42
@@ -1,5 +1,22 @@
1
1
  import { IEngineConfiguration } from './configuration/types';
2
2
  import { IConfigurationResolver, IEligiusEngine, IEngineFactory, IEngineFactoryOptions, ISimpleResourceImporter } from './types';
3
+ /**
4
+ * The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.
5
+ *
6
+ * It prepares a resolved configuration and creates the engine based on the class defined in the configuration.
7
+ *
8
+ * @example Loading a configuration and creating an IEligiusEngine instance
9
+ * ```ts
10
+ * import { IEngineConfiguration, EngineFactory, WebpackResourceImporter } from 'eligius';
11
+ * import * as engineConfig from './my-eligius-config.json';
12
+ *
13
+ * const factory = new EngineFactory(new WebpackResourceImporter(), window);
14
+ *
15
+ * const engine = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);
16
+ *
17
+ * engine.init().then(()=> {console.log('Eligius engine ready for business');});
18
+ * ```
19
+ */
3
20
  export declare class EngineFactory implements IEngineFactory {
4
21
  private _actionsLookup;
5
22
  private _eventbus;
@@ -1,5 +1,9 @@
1
1
  import { IAction } from '../action/types';
2
2
  import { IEventbusListener } from './types';
3
+ /**
4
+ * The `IEventbusListener` first registers a number of actions that are then
5
+ * executed when the specified event is broadcast.
6
+ */
3
7
  export declare class ActionRegistryEventbusListener implements IEventbusListener {
4
8
  private _actionRegistry;
5
9
  registerAction(action: IAction, eventName: string, eventTopic?: string): void;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './action';
2
2
  export * from './action/types';
3
3
  export * from './build';
4
+ export * from './configuration/api';
4
5
  export { ConfigurationResolver } from './configuration/configuration-resolver';
5
6
  export * from './configuration/types';
6
7
  export * from './controllers';
@@ -1,5 +1,11 @@
1
1
  import { IEventbus } from './eventbus/types';
2
2
  import { ILabel, ILanguageLabel, TResultCallback } from './types';
3
+ /**
4
+ * This class manages the labels for an {@link IEligiusEngine} instance.
5
+ *
6
+ * It handles the {@link TimelineEventNames.REQUEST_LABEL_COLLECTION}, {@link TimelineEventNames.REQUEST_LABEL_COLLECTIONS}, {@link TimelineEventNames.REQUEST_CURRENT_LANGUAGE} and {@link TimelineEventNames.LANGUAGE_CHANGE} events.
7
+ *
8
+ */
3
9
  export declare class LanguageManager {
4
10
  private _currentLanguage;
5
11
  private _eventbus;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="jquery" />
2
2
  import { IController } from '../controllers/types';
3
- import { TOperation } from './types';
4
- export interface IAddControllerToElementOperationData {
3
+ import { TOperation, TOperationData } from './types';
4
+ export declare type IAddControllerToElementOperationData<T extends TOperationData = TOperationData> = {
5
5
  selectedElement: JQuery;
6
- controllerInstance: IController<any>;
7
- }
6
+ controllerInstance: IController<T>;
7
+ } & T;
8
8
  /**
9
- * This operation adds the specified controller instance to the specified selected element.
9
+ * This operation adds the specified controller instance to the given selected element.
10
10
  *
11
11
  * @param operationData
12
12
  * @returns
@@ -8,7 +8,7 @@ export interface IAnimateWithClassOperationData {
8
8
  /**
9
9
  * This operation adds the specified class name to the specified selected element and assumes that this
10
10
  * class triggers and animation on the selected element. It then waits for this animation to complete
11
- * until it resolves.
11
+ * before it resolves.
12
12
  *
13
13
  * @param operationData
14
14
  * @returns
@@ -4,10 +4,10 @@ export interface IAnimateOperationData {
4
4
  animationEasing?: string;
5
5
  selectedElement: JQuery;
6
6
  animationProperties: any;
7
- animationDuration: number;
7
+ animationDuration: JQuery.Duration;
8
8
  }
9
9
  /**
10
- * This operation animates the specified selected element with the given jQuery animation settings.
10
+ * This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.
11
11
  * It resolves after the animation completes.
12
12
  *
13
13
  * @param operationData
@@ -4,10 +4,10 @@ export interface ICalcOperationData {
4
4
  left: string | number;
5
5
  right: string | number;
6
6
  operator: TCalculationOperator;
7
- propertyName?: string;
7
+ calculationResult?: number;
8
8
  }
9
9
  /**
10
- * This operation calculates the given left and right hand sides using the specified operator.
10
+ * This operation calculates the given left and right hand operands using the specified operator.
11
11
  *
12
12
  * @param operationData
13
13
  */
@@ -4,6 +4,7 @@ export interface IClearElementOperationData {
4
4
  selectedElement: JQuery;
5
5
  }
6
6
  /**
7
- * This operation removes all of the children from the specified selected element.
7
+ * This operation removes all of the children from the given selected element.
8
+ *
8
9
  */
9
10
  export declare const clearElement: TOperation<IClearElementOperationData>;
@@ -5,5 +5,6 @@ export interface IClearOperationDataOperationData {
5
5
  /**
6
6
  * This operation removes all of the properties on the current operation date.
7
7
  * Or, if the properties property is set only removes the properties defined by that list.
8
+ *
8
9
  */
9
10
  export declare const clearOperationData: TOperation<IClearOperationDataOperationData>;
@@ -5,13 +5,11 @@ export interface ICreateElementOperationData<T extends TTagNames> {
5
5
  elementName: T;
6
6
  text?: string;
7
7
  attributes?: Partial<HTMLElementTagNameMap[T]>;
8
- propertyName?: string;
9
8
  template?: JQuery;
10
9
  }
11
10
  /**
12
- * This operation creates the DOM element defined by the given properties and assigns
13
- * the instance to the give property name on the current operation data.
14
- * The property name defaults to 'template'.
11
+ * This operation creates the DOM element described by the given elementName and attributes and assigns
12
+ * the instance to the `template` property on the current operation data.
15
13
  *
16
14
  * @param operationData
17
15
  * @returns
@@ -3,7 +3,7 @@ export interface ICustomFunctionOperationData {
3
3
  systemName: string;
4
4
  }
5
5
  /**
6
- * This operation retrieves a custom function defined by the specified system name
6
+ * This operation retrieves a custom function defined by the given system name
7
7
  * and invokes it with the current operation data and eventbus.
8
8
  *
9
9
  * @param operationData
@@ -5,7 +5,11 @@ export interface IEndActionOperationData {
5
5
  actionOperationData: any;
6
6
  }
7
7
  /**
8
- * This operation invokes the end() method on the specified action instance.
8
+ * This operation invokes the {@link EndableAction.end} method on the specified action instance.
9
+ *
10
+ * The action operation data is first merged with the current operation data before it is
11
+ * passed on to the action. After the action has completed the action operation data properties
12
+ * are removed from the current operation data.
9
13
  *
10
14
  * @param operationData
11
15
  * @returns
@@ -1,5 +1,4 @@
1
- import { TOperationData } from '.';
2
- import { TOperation } from './types';
1
+ import { TOperation, TOperationData } from './types';
3
2
  /**
4
3
  * This operation checks if the current loop should end or start the next iteration.
5
4
  *
@@ -0,0 +1,8 @@
1
+ import { TOperation } from './types';
2
+ /**
3
+ * This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.
4
+ *
5
+ * @param operationData
6
+ * @returns
7
+ */
8
+ export declare const endWhen: TOperation<{}>;
@@ -7,7 +7,7 @@ export interface IGetControllerFromElementOperationData {
7
7
  controllerInstance?: IController<any>;
8
8
  }
9
9
  /**
10
- * This operation retrieves the controller instance with the specified name from the specified selected element.
10
+ * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.
11
11
  *
12
12
  * @param operationData
13
13
  * @returns
@@ -1,16 +1,14 @@
1
1
  import * as controllers from '../controllers';
2
2
  import { IController } from '../controllers/types';
3
- import { TOperation } from './types';
3
+ import { TOperation, TOperationData } from './types';
4
4
  declare type TSystemName = keyof typeof controllers;
5
5
  export interface IGetControllerInstanceOperationData {
6
6
  systemName: TSystemName;
7
- propertyName?: string;
8
- controllerInstance?: IController<unknown>;
7
+ controllerInstance?: IController<TOperationData>;
9
8
  }
10
9
  /**
11
10
  * This operation retrieves an instance of the given controller name.
12
- * It assigns this instance to the property on the current operation data
13
- * defined by the propertyName property which defaults to 'controllerInstance'.
11
+ * It assigns this instance to the `controllerInstance` property on the current operation data
14
12
  *
15
13
  * @param operationData
16
14
  * @returns
@@ -9,9 +9,9 @@ export interface IGetElementDimensionsOperationData {
9
9
  };
10
10
  }
11
11
  /**
12
- * This operation calculates the width and height of the specified selected element.
12
+ * This operation calculates the width and height of the given selected element.
13
13
  * It assigns this struct to the dimensions property on the current operation data.
14
- * Optionally the width and height can be tweaked using the given modifier string.
14
+ * Optionally the width and height can be modified using the given modifier string.
15
15
  *
16
16
  * The modifier string is formatted in the following way:
17
17
  *
@@ -0,0 +1,28 @@
1
+ import { TOperation } from './types';
2
+ export interface IGetQueryParamsOperationData {
3
+ /**
4
+ * The query params will be added as property/values to this object.
5
+ * So, the query string `?foo=bar&bar=foo` will result in:
6
+ * ```json
7
+ * {
8
+ * foo: "bar",
9
+ * bar: "foo"
10
+ * }
11
+ * ```
12
+ * This object will be assigned to the `queryParams` property.
13
+ */
14
+ queryParams?: Record<string, string>;
15
+ /**
16
+ * The properties on this object will be assigned to the queryParams result
17
+ * when the given property name is not part of the query string.
18
+ */
19
+ defaultValues?: Record<string, string>;
20
+ }
21
+ /**
22
+ * This operation retrieves the current query parameters from the browser's address bar and places
23
+ * them on the returned operation data.
24
+ *
25
+ * @param operationData
26
+ * @returns
27
+ */
28
+ export declare const getQueryParams: TOperation<IGetQueryParamsOperationData>;
@@ -0,0 +1,35 @@
1
+ import { IResolvedOperation } from '../../configuration/types';
2
+ /**
3
+ * This function can be used to find the index of a matching operation within a list of operations.
4
+ *
5
+ * Given the array of operations:
6
+ * ```ts
7
+ * [
8
+ * {systemName:'name1'}, // index 0
9
+ * {systemName:'startLoop'}, // index 1
10
+ * {systemName:'name2'}, // index 2
11
+ * {systemName:'startLoop'} // index 3
12
+ * {systemName:'name3'} // index 4
13
+ * {systemName:'endLoop'} // index 5
14
+ * {systemName:'endLoop'} // index 6
15
+ * {systemName:'name3'} // index 7
16
+ * ]
17
+ * ```
18
+ *
19
+ * Given the startLoop instance at index 1, this function will return index 6. Given the startLoop at index 3, it will yield index 5.
20
+ *
21
+ * Returns true when the given operation.systemName equals the specified matchingName and the current counter value is zero.
22
+ *
23
+ * If the matchingName matches operation.systemName but the counter is greater than zero, the counter is decremented.
24
+ *
25
+ * If the operation.systemName equal self (the name of the operation that requires to find its match), then counter is incremented.
26
+ *
27
+ * @param this
28
+ * @param operation
29
+ * @returns
30
+ */
31
+ export declare function findMatchingOperationIndex(this: {
32
+ counter: number;
33
+ self: string;
34
+ matchingName: string;
35
+ }, operation: IResolvedOperation): boolean;
@@ -0,0 +1,24 @@
1
+ /**
2
+ /**
3
+ * Gets the value for the given property chain. A property chain is defined by a string array.
4
+ *
5
+ * For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:
6
+ * ```ts
7
+ * const foo = {
8
+ * mySource: {
9
+ * subSource: {
10
+ * element: {
11
+ * value: 'bar'
12
+ * }
13
+ * }
14
+ * }
15
+ * }
16
+ * ```
17
+ *
18
+ * The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.
19
+ *
20
+ * @param propertyChain
21
+ * @param sourceObject
22
+ * @returns
23
+ */
24
+ export declare function getPropertyChainValue(propertyChain: string[], sourceObject: any): any;
@@ -0,0 +1,3 @@
1
+ export declare const getGlobals: (name?: string) => Record<string, any> | any;
2
+ export declare const setGlobals: (newValues: Record<string, any>) => void;
3
+ export declare const clearGlobals: () => void;
@@ -0,0 +1 @@
1
+ export declare function removeGlobal(name: string): void;
@@ -1,2 +1,2 @@
1
- import { TOperationData } from '../../operation/types';
2
- export declare function resolveEventArguments(operationData: TOperationData, eventArgs?: any[]): any[] | undefined;
1
+ import { IOperationContext, TOperationData } from '../../operation/types';
2
+ export declare function resolveEventArguments(operationData: TOperationData, operationContext: IOperationContext, eventArgs?: any[]): any[] | undefined;
@@ -0,0 +1,14 @@
1
+ import { IOperationContext } from '../types';
2
+ /**
3
+ * Resolves operation and global data property chains.
4
+ *
5
+ * An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.
6
+ * For global data the suffix should be `globaldata.`
7
+ *
8
+ * If the propertyChainOrRegularObject is not a property chain, this value is returned instead.
9
+ *
10
+ * @param sourceObject The object that represents the operation data
11
+ * @param propertyChainOrRegularObject A period delimited string, or just a regular object
12
+ * @returns
13
+ */
14
+ export declare function resolveExternalPropertyChain(sourceObject: any, operationContext: IOperationContext, propertyChainOrRegularObject: any): any;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Gets the value for the given property chain. A property chain is defined by a period delimited string.
3
+ *
4
+ * For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:
5
+ * ```ts
6
+ * const foo = {
7
+ * mySource: {
8
+ * subSource: {
9
+ * element: {
10
+ * value: 'bar'
11
+ * }
12
+ * }
13
+ * }
14
+ * }
15
+ * ```
16
+ *
17
+ * The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.
18
+ *
19
+ * @param propertyChain the specified property chain
20
+ * @param sourceObject the given source object
21
+ * @returns
22
+ */
23
+ export declare function resolvePropertyChain(propertyChain: string, sourceObject: any): any;
@@ -1,2 +1,11 @@
1
- import { TOperationData } from '../../operation/types';
2
- export declare function resolvePropertyValues(operationData: TOperationData, properties: any): any;
1
+ import { IOperationContext, TOperationData } from '../../operation/types';
2
+ /**
3
+ * This takes a `newProperties` instance, resolves all of the properties on this object and then
4
+ * assigns these properties to the given operationData.
5
+ *
6
+ * @param operationData
7
+ * @param operationContext
8
+ * @param newProperties
9
+ * @returns
10
+ */
11
+ export declare function resolvePropertyValues<T extends TOperationData>(operationData: T, operationContext: IOperationContext, newProperties: Record<string, any>): T;
@@ -10,14 +10,18 @@ export { createElement } from './create-element';
10
10
  export { customFunction } from './custom-function';
11
11
  export { endAction } from './end-action';
12
12
  export { endLoop } from './end-loop';
13
+ export { endWhen } from './end-when';
13
14
  export { extendController } from './extend-controller';
14
15
  export { getControllerFromElement } from './get-controller-from-element';
15
16
  export { getControllerInstance } from './get-controller-instance';
16
17
  export { getElementDimensions } from './get-element-dimensions';
17
18
  export { getImport } from './get-import';
19
+ export { getQueryParams } from './get-query-params';
20
+ export { invokeObjectMethod } from './invoke-object-method';
18
21
  export { loadJSON } from './load-json';
19
22
  export { log } from './log';
20
23
  export { math } from './math';
24
+ export { otherwise } from './otherwise';
21
25
  export { removeClass } from './remove-class';
22
26
  export { removeControllerFromElement } from './remove-controller-from-element';
23
27
  export { removeElement } from './remove-element';
@@ -28,6 +32,7 @@ export { resizeAction } from './resize-action';
28
32
  export { selectElement } from './select-element';
29
33
  export { setElementAttributes } from './set-element-attributes';
30
34
  export { setElementContent } from './set-element-content';
35
+ export { setGlobalData } from './set-global-data';
31
36
  export { setOperationData } from './set-operation-data';
32
37
  export { setStyle } from './set-style';
33
38
  export { startAction } from './start-action';
@@ -36,3 +41,4 @@ export { toggleClass } from './toggle-class';
36
41
  export { toggleElement } from './toggle-element';
37
42
  export * from './types';
38
43
  export { wait } from './wait';
44
+ export { when } from './when';
@@ -0,0 +1,28 @@
1
+ import { TOperation } from './types';
2
+ export interface IInvokeObjectMethodOperationData {
3
+ /**
4
+ * The given object instance
5
+ *
6
+ */
7
+ instance: any;
8
+ /**
9
+ * The method name on the given object that will be invoked
10
+ */
11
+ methodName: string;
12
+ /**
13
+ * Arguments that will be passed to the specified method
14
+ */
15
+ methodArguments?: any[];
16
+ /**
17
+ * If any, the results of the method invocation are assigned to the property
18
+ */
19
+ methodResult?: any;
20
+ }
21
+ /**
22
+ * This operation invokes the specified method on the given object with the given optional arguments
23
+ * and assigns the result to the `methodResult` operationdata property.
24
+ *
25
+ * @param operationData
26
+ * @returns
27
+ */
28
+ export declare const invokeObjectMethod: TOperation<IInvokeObjectMethodOperationData>;
@@ -1,15 +1,23 @@
1
1
  import { TOperation } from './types';
2
2
  export interface ILoadJSONOperationData {
3
+ /**
4
+ * The URL where the JSON will be retrieved from
5
+ */
3
6
  url: string;
7
+ /**
8
+ * If true, the results will be added to the cache and any subsequent call will use this cache
9
+ */
4
10
  cache: boolean;
5
- propertyName?: string;
11
+ /**
12
+ * The JSON retrieved from the given URL
13
+ */
6
14
  json?: any;
7
15
  }
8
16
  export declare const clearCache: () => void;
9
17
  export declare const addToCache: (key: string, value: any) => void;
10
18
  /**
11
- * This operation loads a JSON file from the specified url and assigns it to the specified
12
- * property name on the current operation data. The property name defaults to 'json'.
19
+ * This operation loads a JSON file from the specified url and assigns it to the json
20
+ * property on the current operation data.
13
21
  *
14
22
  * If the cache property is set to true and a cached value already exists, this is assigned
15
23
  * instead of re-retrieving it from the url.
@@ -1,8 +1,8 @@
1
- import { TOperation } from './types';
1
+ import { TOperation, TOperationData } from './types';
2
2
  /**
3
- * This operation logs the current operation data and context.
3
+ * This operation logs the current operation data and context to the console.
4
4
  *
5
5
  * @param operationData
6
6
  * @returns
7
7
  */
8
- export declare const log: TOperation;
8
+ export declare const log: TOperation<TOperationData>;
@@ -2,10 +2,10 @@ import { TOperation } from './types';
2
2
  export interface IMathOperationData {
3
3
  args: (number | string | keyof Math)[];
4
4
  functionName: keyof Math;
5
- propertyName?: string;
5
+ mathResult?: number;
6
6
  }
7
7
  /**
8
- * This operation performs the given math function of the specified arguments.
8
+ * This operation performs the given math function with the specified arguments.
9
9
  *
10
10
  * @param operationData
11
11
  */
@@ -0,0 +1,3 @@
1
+ import { IOperationMetadata } from './types';
2
+ declare function endWhen(): IOperationMetadata<never>;
3
+ export default endWhen;
@@ -0,0 +1,4 @@
1
+ import { IGetQueryParamsOperationData } from '../get-query-params';
2
+ import { IOperationMetadata } from './types';
3
+ declare function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData>;
4
+ export default getQueryParams;
@@ -10,14 +10,18 @@ export { default as createElement } from './create-element';
10
10
  export { default as customFunction } from './custom-function';
11
11
  export { default as endAction } from './end-action';
12
12
  export { default as endLoop } from './end-loop';
13
+ export { default as endWhen } from './end-when';
13
14
  export { default as extendController } from './extend-controller';
14
15
  export { default as getControllerFromElement } from './get-controller-from-element';
15
16
  export { default as getControllerInstance } from './get-controller-instance';
16
17
  export { default as getElementDimensions } from './get-element-dimensions';
17
18
  export { default as getImport } from './get-import';
19
+ export { default as getQueryParams } from './get-query-params';
20
+ export { default as invokeObjectMethod } from './invoke-object-method';
18
21
  export { default as loadJSON } from './load-json';
19
22
  export { default as log } from './log';
20
23
  export { default as math } from './math';
24
+ export { default as otherwise } from './otherwise';
21
25
  export { default as removeClass } from './remove-class';
22
26
  export { default as removeControllerFromElement } from './remove-controller-from-element';
23
27
  export { default as removeElement } from './remove-element';
@@ -28,6 +32,7 @@ export { default as resizeAction } from './resize-action';
28
32
  export { default as selectElement } from './select-element';
29
33
  export { default as setElementAttributes } from './set-element-attributes';
30
34
  export { default as setElementContent } from './set-element-content';
35
+ export { default as setGlobalData } from './set-global-data';
31
36
  export { default as setOperationData } from './set-operation-data';
32
37
  export { default as setStyle } from './set-style';
33
38
  export { default as startAction } from './start-action';
@@ -35,3 +40,4 @@ export { default as startLoop } from './start-loop';
35
40
  export { default as toggleClass } from './toggle-class';
36
41
  export { default as toggleElement } from './toggle-element';
37
42
  export { default as wait } from './wait';
43
+ export { default as when } from './when';
@@ -0,0 +1,4 @@
1
+ import { IInvokeObjectMethodOperationData } from '../invoke-object-method';
2
+ import { IOperationMetadata } from './types';
3
+ declare function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData>;
4
+ export default invokeObjectMethod;
@@ -0,0 +1,3 @@
1
+ import { IOperationMetadata } from './types';
2
+ declare function otherwise(): IOperationMetadata<never>;
3
+ export default otherwise;
@@ -0,0 +1,4 @@
1
+ import { ISetGlobalDataOperationData } from '../set-global-data';
2
+ import { IOperationMetadata } from './types';
3
+ declare function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData>;
4
+ export default setGlobalData;
@@ -1,4 +1,4 @@
1
- import { TStartLoopOperationData } from '../../operation/start-loop';
1
+ import { IStartLoopOperationData } from '../../operation/start-loop';
2
2
  import { IOperationMetadata } from './types';
3
- declare function startLoop(): IOperationMetadata<TStartLoopOperationData>;
3
+ declare function startLoop(): IOperationMetadata<IStartLoopOperationData>;
4
4
  export default startLoop;
@@ -26,4 +26,4 @@ export interface IOperationMetadata<T> {
26
26
  properties?: TPropertiesMetadata<T>;
27
27
  outputProperties?: TPropertiesMetadata<T>;
28
28
  }
29
- export declare type TParameterTypes = 'ParameterType:htmlElementName' | 'ParameterType:className' | 'ParameterType:selector' | 'ParameterType:string' | 'ParameterType:integer' | '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';
29
+ export declare 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';
@@ -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