UNPKG

1.39 kBTypeScriptView Raw
1import { EventEmitter } from 'eventemitter3';
2declare class Emitter extends EventEmitter<string> {
3 static events: {
4 readonly EDITOR_CHANGE: "editor-change";
5 readonly SCROLL_BEFORE_UPDATE: "scroll-before-update";
6 readonly SCROLL_BLOT_MOUNT: "scroll-blot-mount";
7 readonly SCROLL_BLOT_UNMOUNT: "scroll-blot-unmount";
8 readonly SCROLL_OPTIMIZE: "scroll-optimize";
9 readonly SCROLL_UPDATE: "scroll-update";
10 readonly SCROLL_EMBED_UPDATE: "scroll-embed-update";
11 readonly SELECTION_CHANGE: "selection-change";
12 readonly TEXT_CHANGE: "text-change";
13 readonly COMPOSITION_BEFORE_START: "composition-before-start";
14 readonly COMPOSITION_START: "composition-start";
15 readonly COMPOSITION_BEFORE_END: "composition-before-end";
16 readonly COMPOSITION_END: "composition-end";
17 };
18 static sources: {
19 readonly API: "api";
20 readonly SILENT: "silent";
21 readonly USER: "user";
22 };
23 protected domListeners: Record<string, {
24 node: Node;
25 handler: Function;
26 }[]>;
27 constructor();
28 emit(...args: unknown[]): boolean;
29 handleDOM(event: Event, ...args: unknown[]): void;
30 listenDOM(eventName: string, node: Node, handler: EventListener): void;
31}
32export type EmitterSource = (typeof Emitter.sources)[keyof typeof Emitter.sources];
33export default Emitter;