9fd8e8880056e2fc2e57b4eee65063222248a73e74f7832fc6af5a938163c08b4e3258b8539927ebe218366d1a8c5cce0be24ea12aebc130d9d140718db68e 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import { EventEmitter } from 'eventemitter3';
  2. declare 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. }
  32. export type EmitterSource = (typeof Emitter.sources)[keyof typeof Emitter.sources];
  33. export default Emitter;