@expressive/mvc 0.9.1 → 0.9.2

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/lib/index.d.ts CHANGED
@@ -35,7 +35,6 @@ declare namespace Model {
35
35
  /** Including but not limited to T. */
36
36
  type Extends<T> = T | (string & Record<never, never>);
37
37
  export type Type<T extends Model = Model> = typeof Model & (new () => T);
38
- export type OnUpdate<T, P> = (this: T, value: ValueOf<keyof T, P>, changed: P) => void;
39
38
  export type Effect<T> = (this: T, argument: T) => Callback | Promise<any> | void;
40
39
  /** Exotic value, actual value is contained. */
41
40
  export type Ref<T = any> = {
@@ -88,7 +87,8 @@ declare class Model {
88
87
  is: this;
89
88
  constructor();
90
89
  on<P extends Model.Event<this>>(key: P, timeout?: number): Promise<Model.ValueOf<this, P>>;
91
- on<P extends Model.Event<this>>(key: P, listener: Model.OnUpdate<this, P>, once?: boolean): Callback;
90
+ on<P extends Model.Field<this>>(key: P, listener: (this: this, value: this[P], key: P) => void, once?: boolean): Callback;
91
+ on<P extends Model.Event<this>>(key: P, listener: (this: this, value: undefined, key: P) => void, once?: boolean): Callback;
92
92
  on<P extends Model.Event<this>>(keys: P[], timeout?: number): Promise<P[]>;
93
93
  on<P extends Model.Event<this>>(keys: P[], listener: (keys: P[]) => void, once?: boolean): Callback;
94
94
  on(effect: Model.Effect<this>): Callback;