@kuindji/reactive 1.0.9 → 1.0.11
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/dist/react/useAction.d.ts +2 -18
- package/dist/react/useActionBus.d.ts +2 -34
- package/dist/react/useActionMap.d.ts +3 -20
- package/dist/react/useActionMap.js +1 -1
- package/dist/react/useEvent.d.ts +2 -45
- package/dist/react/useEventBus.d.ts +2 -116
- package/dist/react/useEventBus.js +5 -3
- package/dist/react/useStore.d.ts +2 -45
- package/package.json +1 -1
|
@@ -1,21 +1,5 @@
|
|
|
1
|
+
import { createAction } from "../action";
|
|
1
2
|
import type { ActionResponse, ListenerSignature } from "../action";
|
|
2
3
|
import type { BaseHandler, ErrorListenerSignature, ErrorResponse } from "../lib/types";
|
|
3
4
|
export type { ActionResponse, BaseHandler, ErrorListenerSignature, ErrorResponse, ListenerSignature, };
|
|
4
|
-
export declare function useAction<ActionSignature extends BaseHandler, Listener extends ListenerSignature<ActionSignature>, ErrorListener extends ErrorListenerSignature<Parameters<ActionSignature>>>(actionSignature: ActionSignature, listener?: Listener | null, errorListener?: ErrorListener | null):
|
|
5
|
-
readonly invoke: (...args: Parameters<ActionSignature>) => Promise<ActionResponse<Awaited<ReturnType<ActionSignature>>, Parameters<ActionSignature>>>;
|
|
6
|
-
readonly addListener: (handler: ListenerSignature<ActionSignature>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
7
|
-
readonly on: (handler: ListenerSignature<ActionSignature>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
8
|
-
readonly subscribe: (handler: ListenerSignature<ActionSignature>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
9
|
-
readonly listen: (handler: ListenerSignature<ActionSignature>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
10
|
-
readonly removeAllListeners: (tag?: string) => void;
|
|
11
|
-
readonly removeListener: (handler: ListenerSignature<ActionSignature>, context?: object | null, tag?: string | null) => boolean;
|
|
12
|
-
readonly un: (handler: ListenerSignature<ActionSignature>, context?: object | null, tag?: string | null) => boolean;
|
|
13
|
-
readonly off: (handler: ListenerSignature<ActionSignature>, context?: object | null, tag?: string | null) => boolean;
|
|
14
|
-
readonly remove: (handler: ListenerSignature<ActionSignature>, context?: object | null, tag?: string | null) => boolean;
|
|
15
|
-
readonly unsubscribe: (handler: ListenerSignature<ActionSignature>, context?: object | null, tag?: string | null) => boolean;
|
|
16
|
-
readonly promise: (options?: import("..").ListenerOptions) => Promise<[arg: ActionResponse<Awaited<ReturnType<ActionSignature>>, Parameters<ActionSignature>>]>;
|
|
17
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<Parameters<ActionSignature>>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
18
|
-
readonly removeAllErrorListeners: (tag?: string) => void;
|
|
19
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<Parameters<ActionSignature>>, context?: object | null, tag?: string | null) => boolean;
|
|
20
|
-
readonly errorPromise: (options?: import("..").ListenerOptions) => Promise<[errorResponse: ErrorResponse<Parameters<ActionSignature>>]>;
|
|
21
|
-
}>;
|
|
5
|
+
export declare function useAction<ActionSignature extends BaseHandler, Listener extends ListenerSignature<ActionSignature>, ErrorListener extends ErrorListenerSignature<Parameters<ActionSignature>>>(actionSignature: ActionSignature, listener?: Listener | null, errorListener?: ErrorListener | null): ReturnType<typeof createAction<ActionSignature>>;
|
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
import type { ActionResponse, ListenerSignature } from "../action";
|
|
2
2
|
import type { BaseActionsMap } from "../actionBus";
|
|
3
|
+
import { createActionBus } from "../actionBus";
|
|
3
4
|
import type { ErrorListenerSignature, ErrorResponse } from "../lib/types";
|
|
4
5
|
export type { ActionResponse, BaseActionsMap, ErrorListenerSignature, ErrorResponse, ListenerSignature, };
|
|
5
|
-
export declare function useActionBus<ActionsMap extends BaseActionsMap = BaseActionsMap>(initialActions?: ActionsMap, errorListener?: ErrorListenerSignature<any[]>):
|
|
6
|
-
readonly add: (name: import("../lib/types").MapKey, action: import("../lib/types").BaseHandler) => void;
|
|
7
|
-
readonly get: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K) => { [key_1 in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key_1]] extends [never] ? never : import("../lib/types").ApiType<import("../action").ActionDefinitionHelper<ActionsMap[key_1]>, {
|
|
8
|
-
readonly invoke: (...args: Parameters<ActionsMap[key_1]>) => Promise<ActionResponse<Awaited<ReturnType<ActionsMap[key_1]>>, Parameters<ActionsMap[key_1]>>>;
|
|
9
|
-
readonly addListener: (handler: ListenerSignature<ActionsMap[key_1]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
10
|
-
readonly on: (handler: ListenerSignature<ActionsMap[key_1]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
11
|
-
readonly subscribe: (handler: ListenerSignature<ActionsMap[key_1]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
12
|
-
readonly listen: (handler: ListenerSignature<ActionsMap[key_1]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
13
|
-
readonly removeAllListeners: (tag?: string) => void;
|
|
14
|
-
readonly removeListener: (handler: ListenerSignature<ActionsMap[key_1]>, context?: object | null, tag?: string | null) => boolean;
|
|
15
|
-
readonly un: (handler: ListenerSignature<ActionsMap[key_1]>, context?: object | null, tag?: string | null) => boolean;
|
|
16
|
-
readonly off: (handler: ListenerSignature<ActionsMap[key_1]>, context?: object | null, tag?: string | null) => boolean;
|
|
17
|
-
readonly remove: (handler: ListenerSignature<ActionsMap[key_1]>, context?: object | null, tag?: string | null) => boolean;
|
|
18
|
-
readonly unsubscribe: (handler: ListenerSignature<ActionsMap[key_1]>, context?: object | null, tag?: string | null) => boolean;
|
|
19
|
-
readonly promise: (options?: import("..").ListenerOptions) => Promise<[arg: ActionResponse<Awaited<ReturnType<ActionsMap[key_1]>>, Parameters<ActionsMap[key_1]>>]>;
|
|
20
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<Parameters<ActionsMap[key_1]>>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
21
|
-
readonly removeAllErrorListeners: (tag?: string) => void;
|
|
22
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<Parameters<ActionsMap[key_1]>>, context?: object | null, tag?: string | null) => boolean;
|
|
23
|
-
readonly errorPromise: (options?: import("..").ListenerOptions) => Promise<[errorResponse: ErrorResponse<Parameters<ActionsMap[key_1]>>]>;
|
|
24
|
-
}>; }[K];
|
|
25
|
-
readonly invoke: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, ...args: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["actionArguments"]) => Promise<ActionResponse<Awaited<ReturnType<ActionsMap[K]>>, Parameters<ActionsMap[K]>>>;
|
|
26
|
-
readonly addListener: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], options?: import("..").ListenerOptions) => void;
|
|
27
|
-
readonly on: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], options?: import("..").ListenerOptions) => void;
|
|
28
|
-
readonly subscribe: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], options?: import("..").ListenerOptions) => void;
|
|
29
|
-
readonly listen: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], options?: import("..").ListenerOptions) => void;
|
|
30
|
-
readonly once: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], options?: import("..").ListenerOptions) => void;
|
|
31
|
-
readonly removeListener: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], context?: object | null, tag?: string | null) => boolean;
|
|
32
|
-
readonly off: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], context?: object | null, tag?: string | null) => boolean;
|
|
33
|
-
readonly remove: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], context?: object | null, tag?: string | null) => boolean;
|
|
34
|
-
readonly un: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], context?: object | null, tag?: string | null) => boolean;
|
|
35
|
-
readonly unsubscribe: <K extends import("../lib/types").KeyOf<{ [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }>>(name: K, handler: { [key in import("../lib/types").KeyOf<ActionsMap>]: [ActionsMap[key]] extends [never] ? never : import("../action").ActionDefinitionHelper<ActionsMap[key]>; }[K]["listenerSignature"], context?: object | null, tag?: string | null) => boolean;
|
|
36
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<any[]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
37
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<any[]>, context?: object | null, tag?: string | null) => boolean;
|
|
38
|
-
}>;
|
|
6
|
+
export declare function useActionBus<ActionsMap extends BaseActionsMap = BaseActionsMap>(initialActions?: ActionsMap, errorListener?: ErrorListenerSignature<any[]>): ReturnType<typeof createActionBus<ActionsMap>>;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import type { ActionResponse, ListenerSignature } from "../action";
|
|
2
2
|
import type { BaseActionsMap } from "../actionBus";
|
|
3
|
-
import
|
|
3
|
+
import { createActionMap } from "../actionMap";
|
|
4
|
+
import type { ErrorListenerSignature, ErrorResponse } from "../lib/types";
|
|
4
5
|
export type { ActionResponse, BaseActionsMap, ErrorListenerSignature, ErrorResponse, ListenerSignature, };
|
|
5
|
-
export declare function useActionMap<M extends BaseActionsMap>(actions: M, errorListener?: ErrorListenerSignature<any[]>):
|
|
6
|
-
readonly invoke: (...args: Parameters<M[key]>) => Promise<ActionResponse<Awaited<ReturnType<M[key]>>, Parameters<M[key]>>>;
|
|
7
|
-
readonly addListener: (handler: ListenerSignature<M[key]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
8
|
-
readonly on: (handler: ListenerSignature<M[key]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
9
|
-
readonly subscribe: (handler: ListenerSignature<M[key]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
10
|
-
readonly listen: (handler: ListenerSignature<M[key]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
11
|
-
readonly removeAllListeners: (tag?: string) => void;
|
|
12
|
-
readonly removeListener: (handler: ListenerSignature<M[key]>, context?: object | null, tag?: string | null) => boolean;
|
|
13
|
-
readonly un: (handler: ListenerSignature<M[key]>, context?: object | null, tag?: string | null) => boolean;
|
|
14
|
-
readonly off: (handler: ListenerSignature<M[key]>, context?: object | null, tag?: string | null) => boolean;
|
|
15
|
-
readonly remove: (handler: ListenerSignature<M[key]>, context?: object | null, tag?: string | null) => boolean;
|
|
16
|
-
readonly unsubscribe: (handler: ListenerSignature<M[key]>, context?: object | null, tag?: string | null) => boolean;
|
|
17
|
-
readonly promise: (options?: import("..").ListenerOptions) => Promise<[arg: ActionResponse<Awaited<ReturnType<M[key]>>, Parameters<M[key]>>]>;
|
|
18
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<Parameters<M[key]>>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
19
|
-
readonly removeAllErrorListeners: (tag?: string) => void;
|
|
20
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<Parameters<M[key]>>, context?: object | null, tag?: string | null) => boolean;
|
|
21
|
-
readonly errorPromise: (options?: import("..").ListenerOptions) => Promise<[errorResponse: ErrorResponse<Parameters<M[key]>>]>;
|
|
22
|
-
__type: import("../action").ActionDefinitionHelper<M[key]>;
|
|
23
|
-
}; }>;
|
|
6
|
+
export declare function useActionMap<M extends BaseActionsMap>(actions: M, errorListener?: ErrorListenerSignature<any[]>): ReturnType<typeof createActionMap<M>>;
|
|
@@ -20,6 +20,6 @@ function useActionMap(actions, errorListener) {
|
|
|
20
20
|
throw new Error("useActionMap() does not support changing actions or errorListener");
|
|
21
21
|
}
|
|
22
22
|
changeRef.current++;
|
|
23
|
-
}, [actions, errorListener, boundaryErrorListener]);
|
|
23
|
+
}, [actions, errorListener !== null && errorListener !== void 0 ? errorListener : null, boundaryErrorListener !== null && boundaryErrorListener !== void 0 ? boundaryErrorListener : null]);
|
|
24
24
|
return actionMap;
|
|
25
25
|
}
|
package/dist/react/useEvent.d.ts
CHANGED
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
import { type EventOptions } from "../event";
|
|
1
|
+
import { createEvent, type EventOptions } from "../event";
|
|
2
2
|
import type { BaseHandler, ErrorListenerSignature, ErrorResponse } from "../lib/types";
|
|
3
3
|
export type { BaseHandler, ErrorListenerSignature, ErrorResponse, EventOptions, };
|
|
4
|
-
export declare function useEvent<Listener extends BaseHandler = BaseHandler, ErrorListener extends ErrorListenerSignature<Parameters<Listener>> = ErrorListenerSignature<Parameters<Listener>>>(eventOptions?: EventOptions<Listener>, listener?: Listener | null, errorListener?: ErrorListener | null):
|
|
5
|
-
readonly addListener: (handler: Listener, listenerOptions?: import("../event").ListenerOptions) => void;
|
|
6
|
-
readonly on: (handler: Listener, listenerOptions?: import("../event").ListenerOptions) => void;
|
|
7
|
-
readonly listen: (handler: Listener, listenerOptions?: import("../event").ListenerOptions) => void;
|
|
8
|
-
readonly subscribe: (handler: Listener, listenerOptions?: import("../event").ListenerOptions) => void;
|
|
9
|
-
readonly removeListener: (handler: Listener, context?: object | null, tag?: string | null) => boolean;
|
|
10
|
-
readonly un: (handler: Listener, context?: object | null, tag?: string | null) => boolean;
|
|
11
|
-
readonly off: (handler: Listener, context?: object | null, tag?: string | null) => boolean;
|
|
12
|
-
readonly remove: (handler: Listener, context?: object | null, tag?: string | null) => boolean;
|
|
13
|
-
readonly unsubscribe: (handler: Listener, context?: object | null, tag?: string | null) => boolean;
|
|
14
|
-
readonly trigger: (...args: Parameters<Listener>) => void;
|
|
15
|
-
readonly emit: (...args: Parameters<Listener>) => void;
|
|
16
|
-
readonly dispatch: (...args: Parameters<Listener>) => void;
|
|
17
|
-
readonly hasListener: (handler?: Listener | null | undefined, context?: object | null, tag?: string | null) => boolean;
|
|
18
|
-
readonly has: (handler?: Listener | null | undefined, context?: object | null, tag?: string | null) => boolean;
|
|
19
|
-
readonly removeAllListeners: (tag?: string) => void;
|
|
20
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<Parameters<Listener>>, context?: object | null) => void;
|
|
21
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<Parameters<Listener>>, context?: object | null) => boolean;
|
|
22
|
-
readonly suspend: (withQueue?: boolean) => void;
|
|
23
|
-
readonly resume: () => void;
|
|
24
|
-
readonly setOptions: (eventOptions: Pick<EventOptions<Listener>, "async" | "limit" | "autoTrigger">) => void;
|
|
25
|
-
readonly reset: () => void;
|
|
26
|
-
readonly isSuspended: () => boolean;
|
|
27
|
-
readonly isQueued: () => boolean;
|
|
28
|
-
readonly withTags: <T extends (...args: any[]) => any>(tags: string[], callback: T) => ReturnType<T>;
|
|
29
|
-
readonly promise: (options?: import("../event").ListenerOptions) => Promise<Parameters<Listener>>;
|
|
30
|
-
readonly first: (...args: Parameters<Listener>) => ReturnType<Listener> | undefined;
|
|
31
|
-
readonly resolveFirst: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>> | undefined>;
|
|
32
|
-
readonly all: (...args: Parameters<Listener>) => ReturnType<Listener>[];
|
|
33
|
-
readonly resolveAll: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>>[]>;
|
|
34
|
-
readonly last: (...args: Parameters<Listener>) => ReturnType<Listener> | undefined;
|
|
35
|
-
readonly resolveLast: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>> | undefined>;
|
|
36
|
-
readonly merge: (...args: Parameters<Listener>) => ReturnType<Listener> | undefined;
|
|
37
|
-
readonly resolveMerge: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>> | undefined>;
|
|
38
|
-
readonly concat: (...args: Parameters<Listener>) => (ReturnType<Listener> extends infer T ? T extends ReturnType<Listener> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
39
|
-
readonly resolveConcat: (...args: Parameters<Listener>) => Promise<(Awaited<ReturnType<Listener>> extends infer T ? T extends Awaited<ReturnType<Listener>> ? T extends (infer U)[] ? U : T : never : never)[]>;
|
|
40
|
-
readonly firstNonEmpty: (...args: Parameters<Listener>) => ReturnType<Listener> | undefined;
|
|
41
|
-
readonly resolveFirstNonEmpty: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>> | undefined>;
|
|
42
|
-
readonly untilTrue: (...args: Parameters<Listener>) => void;
|
|
43
|
-
readonly untilFalse: (...args: Parameters<Listener>) => void;
|
|
44
|
-
readonly pipe: (...args: Parameters<Listener>) => ReturnType<Listener> | undefined;
|
|
45
|
-
readonly resolvePipe: (...args: Parameters<Listener>) => Promise<Awaited<ReturnType<Listener>> | undefined>;
|
|
46
|
-
readonly raw: (...args: Parameters<Listener>) => (ReturnType<Listener> extends infer T ? T extends ReturnType<Listener> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
47
|
-
}>;
|
|
4
|
+
export declare function useEvent<Listener extends BaseHandler = BaseHandler, ErrorListener extends ErrorListenerSignature<Parameters<Listener>> = ErrorListenerSignature<Parameters<Listener>>>(eventOptions?: EventOptions<Listener>, listener?: Listener | null, errorListener?: ErrorListener | null): ReturnType<typeof createEvent<Listener>>;
|
|
@@ -1,118 +1,4 @@
|
|
|
1
|
-
import { BaseEventMap, DefaultEventMap, EventBusOptions } from "../eventBus";
|
|
1
|
+
import { BaseEventMap, createEventBus, DefaultEventMap, EventBusOptions } from "../eventBus";
|
|
2
2
|
import type { BaseHandler, ErrorListenerSignature, ErrorResponse } from "../lib/types";
|
|
3
3
|
export type { BaseEventMap, BaseHandler, ErrorListenerSignature, ErrorResponse, EventBusOptions, };
|
|
4
|
-
export declare function useEventBus<EventsMap extends BaseEventMap = DefaultEventMap>(eventBusOptions?: EventBusOptions<EventsMap>, allEventsListener?: BaseHandler, errorListener?: ErrorListenerSignature<any[]>):
|
|
5
|
-
readonly addListener: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
6
|
-
readonly on: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
7
|
-
readonly listen: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
8
|
-
readonly subscribe: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
9
|
-
readonly once: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
10
|
-
readonly promise: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>>(name: K, options?: import("..").ListenerOptions) => Promise<Parameters<EventsMap[K]>>;
|
|
11
|
-
readonly removeListener: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
12
|
-
readonly un: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
13
|
-
readonly off: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
14
|
-
readonly remove: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
15
|
-
readonly unsubscribe: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, H extends import("../eventBus").GetEventsMap<EventsMap>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
16
|
-
readonly trigger: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => void;
|
|
17
|
-
readonly emit: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => void;
|
|
18
|
-
readonly dispatch: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => void;
|
|
19
|
-
readonly get: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>>(name: K) => { [key in import("../lib/types").KeyOf<EventsMap>]: import("../lib/types").ApiType<import("..").EventDefinitionHelper<EventsMap[key]>, {
|
|
20
|
-
readonly addListener: (handler: EventsMap[key], listenerOptions?: import("..").ListenerOptions) => void;
|
|
21
|
-
readonly on: (handler: EventsMap[key], listenerOptions?: import("..").ListenerOptions) => void;
|
|
22
|
-
readonly listen: (handler: EventsMap[key], listenerOptions?: import("..").ListenerOptions) => void;
|
|
23
|
-
readonly subscribe: (handler: EventsMap[key], listenerOptions?: import("..").ListenerOptions) => void;
|
|
24
|
-
readonly removeListener: (handler: EventsMap[key], context?: object | null, tag?: string | null) => boolean;
|
|
25
|
-
readonly un: (handler: EventsMap[key], context?: object | null, tag?: string | null) => boolean;
|
|
26
|
-
readonly off: (handler: EventsMap[key], context?: object | null, tag?: string | null) => boolean;
|
|
27
|
-
readonly remove: (handler: EventsMap[key], context?: object | null, tag?: string | null) => boolean;
|
|
28
|
-
readonly unsubscribe: (handler: EventsMap[key], context?: object | null, tag?: string | null) => boolean;
|
|
29
|
-
readonly trigger: (...args: Parameters<EventsMap[key]>) => void;
|
|
30
|
-
readonly emit: (...args: Parameters<EventsMap[key]>) => void;
|
|
31
|
-
readonly dispatch: (...args: Parameters<EventsMap[key]>) => void;
|
|
32
|
-
readonly hasListener: (handler?: EventsMap[key] | null | undefined, context?: object | null, tag?: string | null) => boolean;
|
|
33
|
-
readonly has: (handler?: EventsMap[key] | null | undefined, context?: object | null, tag?: string | null) => boolean;
|
|
34
|
-
readonly removeAllListeners: (tag?: string) => void;
|
|
35
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<Parameters<EventsMap[key]>>, context?: object | null) => void;
|
|
36
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<Parameters<EventsMap[key]>>, context?: object | null) => boolean;
|
|
37
|
-
readonly suspend: (withQueue?: boolean) => void;
|
|
38
|
-
readonly resume: () => void;
|
|
39
|
-
readonly setOptions: (eventOptions: Pick<import("..").EventOptions<EventsMap[key]>, "async" | "limit" | "autoTrigger">) => void;
|
|
40
|
-
readonly reset: () => void;
|
|
41
|
-
readonly isSuspended: () => boolean;
|
|
42
|
-
readonly isQueued: () => boolean;
|
|
43
|
-
readonly withTags: <T extends (...args: any[]) => any>(tags: string[], callback: T) => ReturnType<T>;
|
|
44
|
-
readonly promise: (options?: import("..").ListenerOptions) => Promise<Parameters<EventsMap[key]>>;
|
|
45
|
-
readonly first: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]> | undefined;
|
|
46
|
-
readonly resolveFirst: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>> | undefined>;
|
|
47
|
-
readonly all: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]>[];
|
|
48
|
-
readonly resolveAll: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>>[]>;
|
|
49
|
-
readonly last: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]> | undefined;
|
|
50
|
-
readonly resolveLast: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>> | undefined>;
|
|
51
|
-
readonly merge: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]> | undefined;
|
|
52
|
-
readonly resolveMerge: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>> | undefined>;
|
|
53
|
-
readonly concat: (...args: Parameters<EventsMap[key]>) => (ReturnType<EventsMap[key]> extends infer T ? T extends ReturnType<EventsMap[key]> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
54
|
-
readonly resolveConcat: (...args: Parameters<EventsMap[key]>) => Promise<(Awaited<ReturnType<EventsMap[key]>> extends infer T ? T extends Awaited<ReturnType<EventsMap[key]>> ? T extends (infer U)[] ? U : T : never : never)[]>;
|
|
55
|
-
readonly firstNonEmpty: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]> | undefined;
|
|
56
|
-
readonly resolveFirstNonEmpty: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>> | undefined>;
|
|
57
|
-
readonly untilTrue: (...args: Parameters<EventsMap[key]>) => void;
|
|
58
|
-
readonly untilFalse: (...args: Parameters<EventsMap[key]>) => void;
|
|
59
|
-
readonly pipe: (...args: Parameters<EventsMap[key]>) => ReturnType<EventsMap[key]> | undefined;
|
|
60
|
-
readonly resolvePipe: (...args: Parameters<EventsMap[key]>) => Promise<Awaited<ReturnType<EventsMap[key]>> | undefined>;
|
|
61
|
-
readonly raw: (...args: Parameters<EventsMap[key]>) => (ReturnType<EventsMap[key]> extends infer T ? T extends ReturnType<EventsMap[key]> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
62
|
-
}>; }[K];
|
|
63
|
-
readonly add: (name: import("../lib/types").MapKey, options?: import("..").EventOptions<BaseHandler>) => void;
|
|
64
|
-
readonly first: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]> | undefined;
|
|
65
|
-
readonly resolveFirst: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>> | undefined>;
|
|
66
|
-
readonly all: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]>[];
|
|
67
|
-
readonly resolveAll: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>>[]>;
|
|
68
|
-
readonly last: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]> | undefined;
|
|
69
|
-
readonly resolveLast: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>> | undefined>;
|
|
70
|
-
readonly merge: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]> | undefined;
|
|
71
|
-
readonly resolveMerge: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>> | undefined>;
|
|
72
|
-
readonly concat: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => (ReturnType<EventsMap[K]> extends infer T ? T extends ReturnType<EventsMap[K]> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
73
|
-
readonly resolveConcat: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<(Awaited<ReturnType<EventsMap[K]>> extends infer T ? T extends Awaited<ReturnType<EventsMap[K]>> ? T extends (infer U)[] ? U : T : never : never)[]>;
|
|
74
|
-
readonly firstNonEmpty: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]> | undefined;
|
|
75
|
-
readonly resolveFirstNonEmpty: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>> | undefined>;
|
|
76
|
-
readonly untilTrue: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<(...args: Parameters<EventsMap[K]>) => void>;
|
|
77
|
-
readonly untilFalse: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<(...args: Parameters<EventsMap[K]>) => void>;
|
|
78
|
-
readonly pipe: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => ReturnType<EventsMap[K]> | undefined;
|
|
79
|
-
readonly resolvePipe: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => Promise<Awaited<ReturnType<EventsMap[K]>> | undefined>;
|
|
80
|
-
readonly raw: <K extends import("../lib/types").KeyOf<import("../eventBus").GetEventsMap<EventsMap>>, A extends import("../eventBus").GetEventsMap<EventsMap>[K]["arguments"]>(name: K, ...args: A) => (ReturnType<EventsMap[K]> extends infer T ? T extends ReturnType<EventsMap[K]> ? T extends (infer U)[] ? U : T : never : never)[];
|
|
81
|
-
readonly withTags: <T extends (...args: any[]) => any>(tags: string[], callback: T) => ReturnType<T>;
|
|
82
|
-
readonly intercept: (fn: (name: import("../lib/types").MapKey, args: any[], tags: string[] | null, returnType: import("../lib/types").TriggerReturnType | null) => boolean) => void;
|
|
83
|
-
readonly stopIntercepting: () => void;
|
|
84
|
-
readonly isIntercepting: () => boolean;
|
|
85
|
-
readonly reset: () => void;
|
|
86
|
-
readonly suspendAll: (withQueue?: boolean) => void;
|
|
87
|
-
readonly resumeAll: () => void;
|
|
88
|
-
readonly relay: ({ eventSource, remoteEventName, localEventName, proxyType, localEventNamePrefix, }: {
|
|
89
|
-
eventSource: {
|
|
90
|
-
on: (name: any, fn: (...args: any[]) => any, options?: import("..").ListenerOptions) => void;
|
|
91
|
-
addAllEventsListener: (fn: (name: any, args: any[]) => any, options?: import("..").ListenerOptions) => void;
|
|
92
|
-
un: (name: any, fn: (...args: any[]) => any, context?: object | null, tag?: string | null) => void;
|
|
93
|
-
removeAllEventsListener: (fn: (name: any, args: any[]) => any, context?: object | null, tag?: string | null) => void;
|
|
94
|
-
};
|
|
95
|
-
remoteEventName: import("../lib/types").MapKey;
|
|
96
|
-
localEventName?: any;
|
|
97
|
-
proxyType?: import("../lib/types").ProxyType;
|
|
98
|
-
localEventNamePrefix?: string | null;
|
|
99
|
-
}) => void;
|
|
100
|
-
readonly unrelay: ({ eventSource, remoteEventName, localEventName, proxyType, localEventNamePrefix, }: {
|
|
101
|
-
eventSource: {
|
|
102
|
-
on: (name: any, fn: (...args: any[]) => any, options?: import("..").ListenerOptions) => void;
|
|
103
|
-
addAllEventsListener: (fn: (name: any, args: any[]) => any, options?: import("..").ListenerOptions) => void;
|
|
104
|
-
un: (name: any, fn: (...args: any[]) => any, context?: object | null, tag?: string | null) => void;
|
|
105
|
-
removeAllEventsListener: (fn: (name: any, args: any[]) => any, context?: object | null, tag?: string | null) => void;
|
|
106
|
-
};
|
|
107
|
-
remoteEventName: import("../lib/types").MapKey;
|
|
108
|
-
localEventName?: any;
|
|
109
|
-
proxyType?: import("../lib/types").ProxyType;
|
|
110
|
-
localEventNamePrefix?: string | null;
|
|
111
|
-
}) => void;
|
|
112
|
-
readonly addEventSource: (eventSource: import("../eventBus").EventSource) => void;
|
|
113
|
-
readonly removeEventSource: (eventSource: import("../eventBus").EventSource | import("../lib/types").MapKey) => void;
|
|
114
|
-
readonly addAllEventsListener: (handler: (name: import("../lib/types").MapKey, args: any[], tags: string[] | null) => void, listenerOptions?: import("..").ListenerOptions) => void;
|
|
115
|
-
readonly removeAllEventsListener: (handler: (name: import("../lib/types").MapKey, args: any[], tags: string[] | null) => void, context?: object | null, tag?: string | null) => boolean;
|
|
116
|
-
readonly addErrorListener: (handler: ErrorListenerSignature<any[]>, listenerOptions?: import("..").ListenerOptions) => void;
|
|
117
|
-
readonly removeErrorListener: (handler: ErrorListenerSignature<any[]>, context?: object | null, tag?: string | null) => boolean;
|
|
118
|
-
}>;
|
|
4
|
+
export declare function useEventBus<EventsMap extends BaseEventMap = DefaultEventMap>(eventBusOptions?: EventBusOptions<EventsMap>, allEventsListener?: BaseHandler, errorListener?: ErrorListenerSignature<any[]>): ReturnType<typeof createEventBus<EventsMap>>;
|
|
@@ -24,10 +24,12 @@ function useEventBus(eventBusOptions, allEventsListener, errorListener) {
|
|
|
24
24
|
return eventBus;
|
|
25
25
|
}, []);
|
|
26
26
|
(0, react_1.useEffect)(() => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
27
|
+
if (eventBusOptions) {
|
|
28
|
+
if (updateRef.current > 0) {
|
|
29
|
+
throw new Error("EventBus options can't be updated");
|
|
30
|
+
}
|
|
31
|
+
updateRef.current++;
|
|
29
32
|
}
|
|
30
|
-
updateRef.current++;
|
|
31
33
|
}, [eventBusOptions]);
|
|
32
34
|
(0, react_1.useEffect)(() => {
|
|
33
35
|
if (allEventsListenerRef.current !== allEventsListener) {
|
package/dist/react/useStore.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createStore } from "../store";
|
|
1
2
|
import type { BasePropMap, BeforeChangeEventName, ChangeEventName, ErrorEventName, ResetEventName, StoreDefinitionHelper } from "../store";
|
|
2
3
|
export type { BasePropMap, BeforeChangeEventName, ChangeEventName, ErrorEventName, ResetEventName, StoreDefinitionHelper, };
|
|
3
4
|
export declare function useStore<PropMap extends BasePropMap, Store extends StoreDefinitionHelper<PropMap> = StoreDefinitionHelper<PropMap>, Config extends {
|
|
@@ -8,48 +9,4 @@ export declare function useStore<PropMap extends BasePropMap, Store extends Stor
|
|
|
8
9
|
onChange?: Partial<Store["changeEvents"]>;
|
|
9
10
|
pipes?: Partial<Store["pipeEvents"]>;
|
|
10
11
|
control?: Partial<Store["controlEvents"]>;
|
|
11
|
-
}>(initialData?: Partial<PropMap>, config?: Config):
|
|
12
|
-
readonly set: {
|
|
13
|
-
<K extends import("..").KeyOf<PropMap>>(key: K, value: PropMap[K] | undefined): void;
|
|
14
|
-
(key: Partial<PropMap>): void;
|
|
15
|
-
};
|
|
16
|
-
readonly get: <K extends import("..").KeyOf<PropMap> | import("..").KeyOf<PropMap>[]>(key: K) => K extends import("..").KeyOf<PropMap> ? PropMap[K] : K extends import("..").KeyOf<PropMap>[] ? { [AK in K[number]]: PropMap[AK]; } : never;
|
|
17
|
-
readonly getData: () => PropMap;
|
|
18
|
-
readonly batch: (fn: () => void) => void;
|
|
19
|
-
readonly asyncSet: {
|
|
20
|
-
<K extends import("..").KeyOf<PropMap>>(key: K, value: PropMap[K] | undefined): void;
|
|
21
|
-
(key: Partial<PropMap>): void;
|
|
22
|
-
};
|
|
23
|
-
readonly isEmpty: () => boolean;
|
|
24
|
-
readonly reset: () => void;
|
|
25
|
-
readonly onChange: <K extends import("..").KeyOf<import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined, previousValue?: PropMap[K_1] | undefined) => void; }>>, H extends import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined, previousValue?: PropMap[K_1] | undefined) => void; }>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
26
|
-
readonly removeOnChange: <K extends import("..").KeyOf<import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined, previousValue?: PropMap[K_1] | undefined) => void; }>>, H extends import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined, previousValue?: PropMap[K_1] | undefined) => void; }>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
27
|
-
readonly control: <K extends import("..").KeyOf<import("..").GetEventsMap<{
|
|
28
|
-
before: <K_1 extends import("..").KeyOf<PropMap>, V extends PropMap[K_1]>(name: K_1, value: V | undefined) => boolean;
|
|
29
|
-
change: (names: import("..").KeyOf<PropMap>[]) => void;
|
|
30
|
-
reset: () => void;
|
|
31
|
-
error: import("..").ErrorListenerSignature<any[]>;
|
|
32
|
-
effect: <K_1 extends import("..").KeyOf<PropMap>, V_1 extends PropMap[K_1]>(name: K_1, value: V_1 | undefined) => void;
|
|
33
|
-
}>>, H extends import("..").GetEventsMap<{
|
|
34
|
-
before: <K_1 extends import("..").KeyOf<PropMap>, V extends PropMap[K_1]>(name: K_1, value: V | undefined) => boolean;
|
|
35
|
-
change: (names: import("..").KeyOf<PropMap>[]) => void;
|
|
36
|
-
reset: () => void;
|
|
37
|
-
error: import("..").ErrorListenerSignature<any[]>;
|
|
38
|
-
effect: <K_1 extends import("..").KeyOf<PropMap>, V_1 extends PropMap[K_1]>(name: K_1, value: V_1 | undefined) => void;
|
|
39
|
-
}>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
40
|
-
readonly removeControl: <K extends import("..").KeyOf<import("..").GetEventsMap<{
|
|
41
|
-
before: <K_1 extends import("..").KeyOf<PropMap>, V extends PropMap[K_1]>(name: K_1, value: V | undefined) => boolean;
|
|
42
|
-
change: (names: import("..").KeyOf<PropMap>[]) => void;
|
|
43
|
-
reset: () => void;
|
|
44
|
-
error: import("..").ErrorListenerSignature<any[]>;
|
|
45
|
-
effect: <K_1 extends import("..").KeyOf<PropMap>, V_1 extends PropMap[K_1]>(name: K_1, value: V_1 | undefined) => void;
|
|
46
|
-
}>>, H extends import("..").GetEventsMap<{
|
|
47
|
-
before: <K_1 extends import("..").KeyOf<PropMap>, V extends PropMap[K_1]>(name: K_1, value: V | undefined) => boolean;
|
|
48
|
-
change: (names: import("..").KeyOf<PropMap>[]) => void;
|
|
49
|
-
reset: () => void;
|
|
50
|
-
error: import("..").ErrorListenerSignature<any[]>;
|
|
51
|
-
effect: <K_1 extends import("..").KeyOf<PropMap>, V_1 extends PropMap[K_1]>(name: K_1, value: V_1 | undefined) => void;
|
|
52
|
-
}>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
53
|
-
readonly pipe: <K extends import("..").KeyOf<import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined) => PropMap[K_1]; }>>, H extends import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined) => PropMap[K_1]; }>[K]["signature"]>(name: K, handler: H, options?: import("..").ListenerOptions) => void;
|
|
54
|
-
readonly removePipe: <K extends import("..").KeyOf<import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined) => PropMap[K_1]; }>>, H extends import("..").GetEventsMap<{ [K_1 in import("..").KeyOf<PropMap>]: (value: PropMap[K_1] | undefined) => PropMap[K_1]; }>[K]["signature"]>(name: K, handler: H, context?: object | null, tag?: string | null) => void;
|
|
55
|
-
}>;
|
|
12
|
+
}>(initialData?: Partial<PropMap>, config?: Config): ReturnType<typeof createStore<PropMap>>;
|
package/package.json
CHANGED