/** * Types for listening to and dispatching events * based on the `EventTarget` interface, but allows for * asynchronous event handling and custom event types. * * @internal scope: package */ export declare namespace BasicEvent { /** * A handler that is awaited when an event is dispatched. * * @remarks * * This type has a similar usage as `Observable.Subscriber` in that * it allows you to define a function that will be called when an event is dispatched. * * @public */ type Listener = (event: T) => Promise | unknown; /** * An object that can be listened to for events. * * @remarks * * This type has a similar usage as `Observable` in that it allows you to listen for events * using the `addEventListener` and `removeEventListener` methods. * * @public */ type Listenable = Pick; /** * An object that can dispatch events. * * @public */ type Dispatcher = { dispatchEvent(event: Event): Promise | boolean; }; /** * An object that can be listened to for events and can dispatch events. * * @public */ type Emitter = Listenable & Dispatcher; } //# sourceMappingURL=BasicEvent.d.ts.map