@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 CHANGED
@@ -9,6 +9,8 @@ class ContextInjector {
9
9
  const fn = typeof attributes === 'function' ? attributes : cb;
10
10
  return fn();
11
11
  }
12
+ hook(name, route) {
13
+ }
12
14
  }
13
15
  let ci = new ContextInjector();
14
16
  function getContextInjector() {
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 = 'Event:start'>(): ContextInjector<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
@@ -7,6 +7,8 @@ class ContextInjector {
7
7
  const fn = typeof attributes === 'function' ? attributes : cb;
8
8
  return fn();
9
9
  }
10
+ hook(name, route) {
11
+ }
10
12
  }
11
13
  let ci = new ContextInjector();
12
14
  function getContextInjector() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/event-core",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "@wooksjs/event-core",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",