@cydran/testsupport 0.5.0 → 0.5.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.
@@ -73,7 +73,13 @@ export declare function isDefined<T>(value: T): boolean;
73
73
  export declare function merge<T>(sources: unknown[]): T;
74
74
  export declare function overlay<T>(destination: T, sources: unknown[]): T;
75
75
  export declare function requireNotNull<T>(value: T, name: string): T;
76
- export interface ActionContinuation extends Tellable, Messagable, Watchable {
76
+ export interface ActionContinuation extends Tellable, Messagable {
77
+ onExpressionValueChange(expression: string): WatchContinuation;
78
+ /**
79
+ * Evaluates an expression.
80
+ * @param expression Expression to evaluate.
81
+ */
82
+ evaluate<T>(expression: string): T;
77
83
  getParent(): Nestable;
78
84
  getEl(): HTMLElement;
79
85
  getObject<T>(id: string, ...instanceArguments: unknown[]): T;
@@ -182,7 +188,7 @@ export interface FilterBuilder {
182
188
  limited(): LimitOffsetFilter;
183
189
  }
184
190
  export interface ForChannelContinuation {
185
- invoke(callback: (payload: unknown) => void): void;
191
+ invoke(name: string, before?: () => void, after?: () => void): void;
186
192
  }
187
193
  export interface FormOperations {
188
194
  submit(): void;
@@ -190,7 +196,7 @@ export interface FormOperations {
190
196
  reset(): void;
191
197
  }
192
198
  export interface IntervalContinuation {
193
- invoke(callback: () => void): void;
199
+ invoke(name: string): void;
194
200
  }
195
201
  export interface IsLevelType {
196
202
  /**
@@ -381,7 +387,7 @@ export interface Nestable extends Actionable<ActionContinuation> {
381
387
  onRemount(): void;
382
388
  }
383
389
  export interface OnContinuation {
384
- invoke(callback: (payload: unknown) => void): void;
390
+ invoke(name: string, before?: () => void, after?: () => void): void;
385
391
  forChannel(channelName: string): ForChannelContinuation;
386
392
  }
387
393
  export interface Operations {
@@ -416,16 +422,16 @@ export interface PagedFilter extends Filter {
416
422
  export interface Properties {
417
423
  /**
418
424
  * Add an observer for all property changes.
419
- * @param thisObject Object used as this when calling the callback
420
- * @param callback - callback function to be called when any property is changed
425
+ * @param thisObject Object that owns and is used as this when calling the named method
426
+ * @param name - name of the method (on thisObject) to be called when any property is changed
421
427
  */
422
- addObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
428
+ addObserver(thisObject: CallBackThisObject, name: string): void;
423
429
  /**
424
430
  * Remove an observer that listened for all property changes.
425
- * @param thisObject Object used as this when calling the callback
426
- * @param callback callback function to be removed
431
+ * @param thisObject Object that owns the named method
432
+ * @param name name of the previously-registered method to be removed
427
433
  */
428
- removeObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
434
+ removeObserver(thisObject: CallBackThisObject, name: string): void;
429
435
  /**
430
436
  * Add an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
431
437
  * @param thisObject Object used as this when calling the callback
@@ -433,27 +439,27 @@ export interface Properties {
433
439
  * @param preferredKey Preferred property key to observe
434
440
  * @param prefix Property key prefix for keys which should be included for consideration
435
441
  */
436
- addFallbackObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void, preferredKey: string, prefix?: string): void;
442
+ addFallbackObserver(thisObject: CallBackThisObject, name: string, preferredKey: string, prefix?: string): void;
437
443
  /**
438
444
  * Remove an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
439
- * @param thisObject Object used as this when calling the callback
440
- * @param callback callback function to be removed
445
+ * @param thisObject Object that owns the named method
446
+ * @param name name of the previously-registered method to be removed
441
447
  */
442
- removeFallbackObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
448
+ removeFallbackObserver(thisObject: CallBackThisObject, name: string): void;
443
449
  /**
444
450
  * Add an observer for specific property.
445
451
  * @param key Specific property key
446
- * @param thisObject Object used as this when calling the callback
447
- * @param callback callback function to be called when the specific property is changed
452
+ * @param thisObject Object that owns and is used as this when calling the named method
453
+ * @param name name of the method (on thisObject) to be called when the specific property is changed
448
454
  */
449
- addPropertyObserver(key: string, thisObject: CallBackThisObject, callback: (value: unknown) => void): void;
455
+ addPropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
450
456
  /**
451
457
  * Remove an observer for specific property.
452
458
  * @param key Specific property key
453
- * @param thisObject Object used as this when calling the callback
454
- * @param callback callback function to remove
459
+ * @param thisObject Object that owns the named method
460
+ * @param name name of the previously-registered method to remove
455
461
  */
456
- removePropertyObserver(key: string, thisObject: CallBackThisObject, callback: (value: unknown) => void): void;
462
+ removePropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
457
463
  snapshot(): MutableProperties;
458
464
  /**
459
465
  * Get all the keys present in the properties object
@@ -609,14 +615,9 @@ export interface Stage extends Releasable {
609
615
  export interface Tellable {
610
616
  tell(name: string, payload?: unknown): void;
611
617
  }
612
- export interface Watchable {
613
- onExpressionValueChange<T>(expression: string, callback: (previous: T, current: T) => void, reducerFn?: (input: unknown) => T, thisObject?: CallBackThisObject): void;
614
- /**
615
- * Evaluates an expression.
616
- * @param expression Expression to evaluate.
617
- */
618
- evaluate<T>(expression: string): T;
619
- getWatchScope(): unknown;
618
+ export interface WatchContinuation {
619
+ reducedBy<T>(reducerFn: (input: unknown) => T): WatchContinuation;
620
+ invoke(name: string): void;
620
621
  }
621
622
  export type CallBackThisObject = object;
622
623
  export type MessageCallback = (channelName: string, messageName: string, payload: unknown) => void;
@@ -1,5 +1,5 @@
1
1
  /*
2
- 0.5.0
2
+ 0.5.1
3
3
  ---
4
4
  Cydran <http://cydran.io/>
5
5
  Copyright (c) 2018 The Cydran Team and other contributors <http://cydran.io/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydran/testsupport",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Testing support for Cydran",
5
5
  "module": "dist/testsupport.js",
6
6
  "main": "dist/testsupport.js",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "validate": "npx @cydran/build validate",
16
- "build": "npm run clean && npm run transpile && npm run aggregate",
16
+ "build": "npm run clean.dist && npm run clean.tarball && npm run transpile && npm run aggregate",
17
17
  "build.all": "npm run build.release && npm run docs",
18
18
  "clean": "npm run clean.dist && npm run clean.coverage && npm run clean.tarball",
19
19
  "clean.dist": "npx rimraf --glob dist",
@@ -60,7 +60,7 @@
60
60
  "@babel/plugin-transform-modules-umd": "7.24.7",
61
61
  "@babel/preset-env": "7.25.4",
62
62
  "@babel/preset-typescript": "7.24.7",
63
- "@cydran/build": "^0.5.0",
63
+ "@cydran/build": "^0.5.1",
64
64
  "@types/lodash": "4.17.7",
65
65
  "@types/node": "22.5.4",
66
66
  "babel-preset-es2015": "6.24.1",
@@ -79,7 +79,7 @@
79
79
  "typescript": "5.6.2"
80
80
  },
81
81
  "dependencies": {
82
- "@cydran/cydran": "^0.5.0",
82
+ "@cydran/cydran": "^0.5.1",
83
83
  "@jest/globals": "29.7.0",
84
84
  "@testing-library/dom": "10.4.0",
85
85
  "@testing-library/jest-dom": "6.5.0",
@@ -94,5 +94,5 @@
94
94
  "docpress": {
95
95
  "dist": "dist/docs"
96
96
  },
97
- "gitHead": "95ff4d00cde7d665a28a0003f574668902ba14ec"
97
+ "gitHead": "277b108cd51056b41272c5644f0020b9856f266f"
98
98
  }