@palmares/events
Version:
This is the events framework for palmares, it's responsible for handling everything that is Pub/Sub like websockets, pub/sub like redis, and other types of asynchronous background tasks
24 lines • 873 B
TypeScript
import type { EventsDomainInterface } from '../interfaces';
import type { EventsServer } from '../server';
/**
* This is used for loading the events on the server.
* The events will be loaded asynchronously. To append an event without worrying about the result you should send an object for each key of the event handler
* like:
*
* ```
* class MyDomain extends Domain implements EventsDomainInterface {
* async getEvents() {
* return {
* 'hello': {
* handler: () => console.log('hello'),
* withResult: false,
* },
* };
* }
* }
* ```
*
* @param domains - The domains filtered out with only the domains that complies to EventDomainInterface interface.
*/
export declare function loadEvents(server: EventsServer<any>, domains: EventsDomainInterface[]): Promise<void>;
//# sourceMappingURL=utils.d.ts.map