/** * Contract for effects that own timers, animation frames, or DOM resources. */ interface Disposable { dispose(): void; } declare const LasciiEvent: { readonly Start: "start"; readonly Progress: "progress"; readonly Complete: "complete"; readonly Error: "error"; }; type LasciiEventName = (typeof LasciiEvent)[keyof typeof LasciiEvent]; interface LasciiStartDetail { text: string; } interface LasciiProgressDetail { progress: number; } interface LasciiCompleteDetail { text: string; } interface LasciiErrorDetail { error: Error; } interface LasciiEventDetailMap { start: LasciiStartDetail; progress: LasciiProgressDetail; complete: LasciiCompleteDetail; error: LasciiErrorDetail; } type LasciiListener = (event: CustomEvent) => void; /** * Typed EventTarget used by lascii effects. * Listeners can be attached after construction; the first animation * frame is scheduled on a microtask. */ declare class LasciiEmitter extends EventTarget { addEventListener(type: K, listener: LasciiListener, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: LasciiListener, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void; protected emit(type: K, detail: LasciiEventDetailMap[K]): void; } export { type Disposable as D, type LasciiCompleteDetail as L, type LasciiErrorDetail as a, LasciiEvent as b, type LasciiEventName as c, type LasciiProgressDetail as d, type LasciiStartDetail as e, LasciiEmitter as f };