@chasemoskal/magical
Version:
web toolkit for lit apps
13 lines (12 loc) • 595 B
TypeScript
import { MagicEventBase } from "./base.js";
import { GetDetail } from "./types/get-detail.js";
import { Constructor } from "../toolbox/handy-types.js";
import { DispatchOptions } from "./types/dispatch-options.js";
export declare const ev: <E extends Constructor<MagicEventBase<any>> & {
readonly type: string;
}>(Event: E) => {
target: (target: EventTarget) => {
dispatch(detail: GetDetail<InstanceType<E>>, options?: Partial<DispatchOptions>): void;
listen(listener: (event: InstanceType<E>) => void, options?: boolean | AddEventListenerOptions): () => void;
};
};