@wooksjs/event-core 0.5.8 → 0.5.10
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 +2 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -289,10 +289,12 @@ declare function useRouteParams<T extends object = Record<string, string | strin
|
|
|
289
289
|
declare class ContextInjector<N> {
|
|
290
290
|
with<T>(name: N, attributes: Record<string, string | number | boolean>, cb: TContextInjectorCallback<T>): T;
|
|
291
291
|
with<T>(name: N, cb: TContextInjectorCallback<T>): T;
|
|
292
|
+
hook(name: 'Handler:not_found' | 'Handler:routed', route?: string): void;
|
|
292
293
|
}
|
|
293
294
|
type TContextInjectorCallback<T> = () => T;
|
|
294
|
-
declare function getContextInjector<N =
|
|
295
|
+
declare function getContextInjector<N = TContextInjectorHooks>(): ContextInjector<N>;
|
|
295
296
|
declare function replaceContextInjector(newCi: ContextInjector<string>): void;
|
|
297
|
+
type TContextInjectorHooks = 'Event:start';
|
|
296
298
|
|
|
297
299
|
declare function attachHook<V = unknown, T extends object | Function = object, P extends PropertyKey = 'value'>(target: T, opts: {
|
|
298
300
|
get: () => V | undefined;
|
|
@@ -302,4 +304,4 @@ type THook<T = string, K extends PropertyKey = 'value'> = {
|
|
|
302
304
|
[key in K]: T;
|
|
303
305
|
};
|
|
304
306
|
|
|
305
|
-
export { ContextInjector, EventLogger, type TEmpty, type TEventLoggerData, type TEventOptions, type TGenericContextStore, type TGenericEvent, type THook, asyncStorage, attachHook, createAsyncEventContext, getContextInjector, replaceContextInjector, useAsyncEventContext, useEventId, useEventLogger, useRouteParams };
|
|
307
|
+
export { ContextInjector, EventLogger, type TContextInjectorHooks, type TEmpty, type TEventLoggerData, type TEventOptions, type TGenericContextStore, type TGenericEvent, type THook, asyncStorage, attachHook, createAsyncEventContext, getContextInjector, replaceContextInjector, useAsyncEventContext, useEventId, useEventLogger, useRouteParams };
|
package/dist/index.mjs
CHANGED