@expressive/mvc 1.0.0-beta.29 → 1.0.0-beta.32

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.
package/types/model.d.ts CHANGED
@@ -292,8 +292,8 @@ export abstract class Model {
292
292
  tap <K extends Model.Fields<this>> (key: K, expect?: boolean): this[K];
293
293
  tap <K extends Model.Fields<this>> (key: K, expect: true): Exclude<this[K], undefined>;
294
294
 
295
- tap <K extends Model.SelectField<this>> (key: K, expect?: boolean): ReturnType<K>;
296
- tap <K extends Model.SelectField<this>> (key: K, expect: true): Exclude<ReturnType<K>, undefined>;
295
+ tap <T> (from: (this: this, state: this) => T, expect?: boolean): T;
296
+ tap <T> (from: (this: this, state: this) => T, expect: true): Exclude<T, undefined>;
297
297
 
298
298
  // Keyed
299
299
  on <S extends Model.SelectEvents<this>> (via: S, cb: Selector.Callback<S, this>, squash?: false, once?: boolean): Callback;
@@ -452,7 +452,7 @@ export abstract class Model {
452
452
  * **React Hook** - Fetch and subscribe to a value on applicable instance within ambient component.
453
453
  */
454
454
  static tap <T extends Class, I extends InstanceOf<T>, K extends Model.Fields<I>> (this: T, key: K, expect?: boolean): I[K];
455
- static tap <T extends Class, I extends InstanceOf<T>, K extends Model.SelectField<I>> (this: T, key?: K, expect?: boolean): ReturnType<K>;
455
+ static tap <T, M extends Class, I extends InstanceOf<M>> (this: M, from: (this: I, state: I) => T, expect?: boolean): T;
456
456
 
457
457
  /**
458
458
  * **React Hook** - Fetch and subscribe to a value on applicable instance within ambient component.
@@ -461,7 +461,7 @@ export abstract class Model {
461
461
  * This makes return type non-nullable and convenient to use without optional chaining.
462
462
  */
463
463
  static tap <T extends Class, I extends InstanceOf<T>, K extends Model.Fields<I>> (this: T, key: K, expect: true): Exclude<I[K], undefined>;
464
- static tap <T extends Class, I extends InstanceOf<T>, K extends Model.SelectField<I>> (this: T, key: K, expect: true): Exclude<ReturnType<K>, undefined>;
464
+ static tap <T, M extends Class, I extends InstanceOf<M>> (this: M, from: (this: I, state: I) => T, expect: true): Exclude<T, undefined>;
465
465
 
466
466
  /**
467
467
  * **React Hook** - Attach to instance of this controller within ambient component.