@asaidimu/utils-database 3.1.8 → 3.1.9
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/index.d.mts +2 -6
- package/index.d.ts +2 -6
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -821,18 +821,14 @@ interface EventBus<TEventMap extends Record<string, any>> {
|
|
|
821
821
|
* subscription
|
|
822
822
|
* @returns A function to unsubscribe from the event.
|
|
823
823
|
*/
|
|
824
|
-
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
825
|
-
__event__: keyof TEventMap;
|
|
826
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
824
|
+
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
827
825
|
/**
|
|
828
826
|
* Subscribes to an event and automatically unsubscribes after it fires once.
|
|
829
827
|
* @param eventName - The name of the event to subscribe to.
|
|
830
828
|
* @param callback - The function to call when the event is emitted.
|
|
831
829
|
* @returns A function to cancel the one-shot subscription before it fires.
|
|
832
830
|
*/
|
|
833
|
-
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
834
|
-
__event__: keyof TEventMap;
|
|
835
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
831
|
+
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
836
832
|
/**
|
|
837
833
|
* Emits an event with a payload to all subscribed listeners.
|
|
838
834
|
* @param event - An object containing the event name and payload.
|
package/index.d.ts
CHANGED
|
@@ -821,18 +821,14 @@ interface EventBus<TEventMap extends Record<string, any>> {
|
|
|
821
821
|
* subscription
|
|
822
822
|
* @returns A function to unsubscribe from the event.
|
|
823
823
|
*/
|
|
824
|
-
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
825
|
-
__event__: keyof TEventMap;
|
|
826
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
824
|
+
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
827
825
|
/**
|
|
828
826
|
* Subscribes to an event and automatically unsubscribes after it fires once.
|
|
829
827
|
* @param eventName - The name of the event to subscribe to.
|
|
830
828
|
* @param callback - The function to call when the event is emitted.
|
|
831
829
|
* @returns A function to cancel the one-shot subscription before it fires.
|
|
832
830
|
*/
|
|
833
|
-
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
834
|
-
__event__: keyof TEventMap;
|
|
835
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
831
|
+
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
836
832
|
/**
|
|
837
833
|
* Emits an event with a payload to all subscribed listeners.
|
|
838
834
|
* @param event - An object containing the event name and payload.
|