eligius 1.0.15 → 1.0.17

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.
@@ -1,10 +1,10 @@
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
9
  * This operation adds the specified controller instance to the specified selected element.
10
10
  *
@@ -0,0 +1,2 @@
1
+ import { TOperation } from './types';
2
+ export declare const endWhen: TOperation<{}>;
@@ -10,4 +10,4 @@
10
10
  * @param propertyChainOrRegularObject A period delimited string, or just a regular object
11
11
  * @returns
12
12
  */
13
- export declare function resolveOperationOrGlobalDataPropertyChain(sourceObject: any, propertyChainOrRegularObject: string | any): any;
13
+ export declare function resolveOperationOrGlobalDataPropertyChain(sourceObject: any, propertyChainOrRegularObject: any): any;
@@ -10,6 +10,7 @@ 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';
@@ -20,6 +21,7 @@ export { invokeObjectMethod } from './invoke-object-method';
20
21
  export { loadJSON } from './load-json';
21
22
  export { log } from './log';
22
23
  export { math } from './math';
24
+ export { otherwise } from './otherwise';
23
25
  export { removeClass } from './remove-class';
24
26
  export { removeControllerFromElement } from './remove-controller-from-element';
25
27
  export { removeElement } from './remove-element';
@@ -39,3 +41,4 @@ export { toggleClass } from './toggle-class';
39
41
  export { toggleElement } from './toggle-element';
40
42
  export * from './types';
41
43
  export { wait } from './wait';
44
+ export { when } from './when';
@@ -0,0 +1,3 @@
1
+ import { IOperationMetadata } from './types';
2
+ declare function endWhen(): IOperationMetadata<never>;
3
+ export default endWhen;
@@ -10,6 +10,7 @@ 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';
@@ -20,6 +21,7 @@ export { default as invokeObjectMethod } from './invoke-object-method';
20
21
  export { default as loadJSON } from './load-json';
21
22
  export { default as log } from './log';
22
23
  export { default as math } from './math';
24
+ export { default as otherwise } from './otherwise';
23
25
  export { default as removeClass } from './remove-class';
24
26
  export { default as removeControllerFromElement } from './remove-controller-from-element';
25
27
  export { default as removeElement } from './remove-element';
@@ -38,3 +40,4 @@ export { default as startLoop } from './start-loop';
38
40
  export { default as toggleClass } from './toggle-class';
39
41
  export { default as toggleElement } from './toggle-element';
40
42
  export { default as wait } from './wait';
43
+ export { default as when } from './when';
@@ -0,0 +1,3 @@
1
+ import { IOperationMetadata } from './types';
2
+ declare function otherwise(): IOperationMetadata<never>;
3
+ export default otherwise;
@@ -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: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';
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,2 @@
1
+ import { TOperation } from './types';
2
+ export declare const otherwise: TOperation<{}>;
@@ -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,17 @@
1
+ import { TOperation } from './types';
2
+ declare type TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';
3
+ declare type TValue = `'${string}'` | number | `operationdata.${string}` | `globaldata.${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 `endWhen` operation is encountered.
11
+ * Practically, this mean an `if` statement control flow implementation in a list of operations.
12
+ *
13
+ * @param operationData
14
+ * @returns
15
+ */
16
+ export declare const when: TOperation<IWhenOperationData>;
17
+ export {};
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.15",
2
+ "version": "1.0.17",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "homepage": "https://rolandzwaga.github.io/eligius/",
@@ -16,6 +16,7 @@
16
16
  "dev": "dts watch",
17
17
  "build": "dts build",
18
18
  "test": "cross-env TS_NODE_PROJECT=tsconfig.test.json uvu -r ts-node/register -r jsdom-global/register src/test",
19
+ "test:watch": "watchlist src test -- yarn test",
19
20
  "check": "tsc --pretty --noEmit",
20
21
  "lint": "dts lint",
21
22
  "prepare": "dts build",
@@ -50,7 +51,7 @@
50
51
  "@types/jasmine": "4.3.0",
51
52
  "@types/jquery": "3.5.14",
52
53
  "@types/jsdom": "^20.0.0",
53
- "@types/node": "18.11.7",
54
+ "@types/node": "18.11.9",
54
55
  "@types/sinon": "10.0.13",
55
56
  "@types/uuid": "8.3.4",
56
57
  "acorn": "8.8.1",
@@ -64,7 +65,7 @@
64
65
  "fs-extra": "10.1.0",
65
66
  "husky": "8.0.1",
66
67
  "jquery": "3.6.1",
67
- "jsdom": "20.0.1",
68
+ "jsdom": "20.0.2",
68
69
  "jsdom-global": "3.0.2",
69
70
  "lottie-web": "5.9.6",
70
71
  "mediaelement": "5.1.0",
@@ -73,11 +74,12 @@
73
74
  "ts-morph": "16.0.0",
74
75
  "ts-node": "10.9.1",
75
76
  "tsconfig-paths": "4.1.0",
76
- "tslib": "2.4.0",
77
+ "tslib": "2.4.1",
77
78
  "typedoc": "0.23.19",
78
79
  "typedoc-plugin-missing-exports": "1.0.0",
79
80
  "typescript": "4.8.4",
80
- "uvu": "0.5.6"
81
+ "uvu": "0.5.6",
82
+ "watchlist": "0.3.1"
81
83
  },
82
84
  "peerDependencies": {
83
85
  "jquery": "3.6.1",