UNPKG

@web-atoms/core

Version:
29 lines 1.08 kB
import { IDisposable } from "./types"; import type { AtomControl } from "../web/controls/AtomControl"; export default class EventScope<T = any> { readonly eventType: string; static create<T1 = any>(): EventScope<T1>; bindEvent(fx: (x: CustomEvent<T>) => any): { [x: string]: (x: CustomEvent<T>) => any; }; /** * This eventName contains `event-` prefix, use * eventType or toString for direct event binding. */ readonly eventName: string; private constructor(); subscribe(control: AtomControl, handler: (ce: CustomEvent<T>) => any): IDisposable; listen(fx: (ce: CustomEvent<T>) => any): { dispose: () => void; }; listenOn(target: EventTarget, fx: (ce: CustomEvent<T>) => any): { dispose: () => void; }; dispatch(target: EventTarget, detail: T, { cancelable, bubbles }?: { cancelable?: boolean; bubbles?: boolean; }): CustomEvent<T>; dispatchEvent(detail: T, cancelable?: boolean): CustomEvent<T>; toString(): string; } //# sourceMappingURL=EventScope.d.ts.map