import { type Reference } from "@knyt/artisan"; import type { BasicEvent } from "./BasicEvent.ts"; import type { SyncEventListener } from "./types.ts"; /** * @public */ export type PropertyChangePayload
= { currentValue: T; previousValue: T; propertyName: P; }; /** * @public */ export type PropertyChangeHandler
= (args: PropertyChangePayload
) => void;
/**
* @public
*/
export type InferPropertyChangePayload ;
/**
* @public
*/
export type InferPropertyChangeHandler ;
/**
* An event emitter that facilitates dispatching events asynchronously.
*
* @remarks
*
* This class partially implements the interface of native event emitters
* to dispatch events on both a given event emitter, which is typically a DOM element,
* and an internal event station asynchronously.
*
* The goal is to provide a way to dispatch native-like events asynchronously in a similar manner
* to the native interfaces facilitating better interoperability.
*/
export declare class BasicEmitter implements BasicEvent.Emitter {
#private;
/**
* @param pairedDispatcher - Another event emitter or a target element to dispatch events on.
*/
constructor(pairedDispatcher: BasicEmitter.Input);
/**
* Dispatch the event on the target element and the event station.
*
* If the target element is not set, the event will only be dispatched on the event station.
*
* @remarks
*
* The event should be defined on `HTMLElementEventMap`.
*
* ```ts
* define global {
* interface HTMLElementEventMap {
* "custom-event": CustomEvent;
* }
* }
* ```
*
* @see HTMLElementEventMap
*/
dispatchEvent