@expressive/mvc 0.15.0 → 0.15.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.
- package/lib/index.d.ts +6 -6
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ declare namespace Model {
|
|
|
64
64
|
/** Any typeof Model, using class constructor as the reference. */
|
|
65
65
|
export type Type<T extends Model = Model> = (new (...args: any[]) => T);
|
|
66
66
|
/** A typeof Model, specifically one which may be created without arguments. */
|
|
67
|
-
export type
|
|
67
|
+
export type New<T extends Model = Model> = (new () => T) & typeof Model;
|
|
68
68
|
export type Effect<T> = (this: T, argument: T) => Callback | Promise<any> | void;
|
|
69
69
|
/** Exotic value, actual value is contained. */
|
|
70
70
|
export type Ref<T = any> = {
|
|
@@ -389,7 +389,7 @@ declare function use<T extends Model>(from: () => T, required: boolean): T;
|
|
|
389
389
|
/**
|
|
390
390
|
* Create a new child instance of model.
|
|
391
391
|
*/
|
|
392
|
-
declare function use<T extends Model>(Type: Model.
|
|
392
|
+
declare function use<T extends Model>(Type: Model.New<T>, callback?: (i: T) => void): T;
|
|
393
393
|
/**
|
|
394
394
|
* Create a managed child from factory function.
|
|
395
395
|
*/
|
|
@@ -496,9 +496,9 @@ declare class MVC extends Model {
|
|
|
496
496
|
declare function useContext<T extends Model>(Type: Model.Type<T>, required: false): T | undefined;
|
|
497
497
|
declare function useContext<T extends Model>(Type: Model.Type<T>, required?: boolean): T;
|
|
498
498
|
|
|
499
|
-
declare function useNew<T extends Model>(source: Model.
|
|
500
|
-
declare function useNew<T extends Model>(source: Model.
|
|
501
|
-
declare function useNew<T extends Model>(source: Model.
|
|
499
|
+
declare function useNew<T extends Model>(source: Model.New<T> | (() => T), callback?: (instance: T) => void): T;
|
|
500
|
+
declare function useNew<T extends Model>(source: Model.New<T> | (() => T), watch: Model.Key<T>[], callback?: (instance: T) => void): T;
|
|
501
|
+
declare function useNew<T extends Model>(source: Model.New<T> | (() => T), apply: Model.Compat<T>, keys?: Model.Event<T>[]): T;
|
|
502
502
|
|
|
503
503
|
declare namespace useTap {
|
|
504
504
|
type Source<T extends Model> = T | Model.Type<T> | (() => T | Model.Type<T>);
|
|
@@ -551,7 +551,7 @@ declare namespace Consumer {
|
|
|
551
551
|
declare function Consumer<T extends Class>(props: Consumer.Props<T>): any;
|
|
552
552
|
|
|
553
553
|
declare namespace Provider {
|
|
554
|
-
type Item = Model | Model.
|
|
554
|
+
type Item = Model | Model.New;
|
|
555
555
|
type Multiple<T extends Item = Item> = T[] | {
|
|
556
556
|
[key: string]: T;
|
|
557
557
|
};
|
package/package.json
CHANGED