@wooksjs/event-core 0.4.29 → 0.4.31
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/index.cjs +4 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface TEventOptions {
|
|
|
21
21
|
interface TGenericContextStore<CustomEventType = TEmpty> {
|
|
22
22
|
event: CustomEventType & TGenericEvent;
|
|
23
23
|
options: TEventOptions;
|
|
24
|
+
parentCtx?: TGenericContextStore;
|
|
24
25
|
routeParams?: Record<string, string | string[]>;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -49,6 +50,8 @@ declare function createEventContext<S = TEmpty, EventTypeToCreate = TEmpty>(data
|
|
|
49
50
|
};
|
|
50
51
|
getStore: <K_1 extends keyof S | keyof TGenericContextStore<EventTypeToCreate>>(key: K_1) => (S & TGenericContextStore<EventTypeToCreate>)[K_1];
|
|
51
52
|
setStore: <K_2 extends keyof S | keyof TGenericContextStore<EventTypeToCreate>>(key: K_2, v: (S & TGenericContextStore<EventTypeToCreate>)[K_2]) => void;
|
|
53
|
+
setParentCtx: (parentCtx: unknown) => void;
|
|
54
|
+
restoreParentCtx: () => TGenericContextStore<TEmpty> | null;
|
|
52
55
|
};
|
|
53
56
|
/**
|
|
54
57
|
* Use existing event context
|
|
@@ -77,6 +80,8 @@ declare function useEventContext<S = TEmpty, EventType = TEmpty>(expectedTypes?:
|
|
|
77
80
|
};
|
|
78
81
|
getStore: <K_1 extends keyof S | keyof TGenericContextStore<EventType>>(key: K_1) => (S & TGenericContextStore<EventType>)[K_1];
|
|
79
82
|
setStore: <K_2 extends keyof S | keyof TGenericContextStore<EventType>>(key: K_2, v: (S & TGenericContextStore<EventType>)[K_2]) => void;
|
|
83
|
+
setParentCtx: (parentCtx: unknown) => void;
|
|
84
|
+
restoreParentCtx: () => TGenericContextStore<TEmpty> | null;
|
|
80
85
|
};
|
|
81
86
|
|
|
82
87
|
interface TEventLoggerData {
|
package/dist/index.mjs
CHANGED