import { Extension } from "@tiptap/core"; import { EditorView } from "@tiptap/pm/view"; //#region src/extensions/core/view-event-handlers.d.ts /** * The set of view event handlers that can be provided to the editor. * * If more view handlers are needed, please look into the available event handlers in * [`prosemirror-view`](https://prosemirror.net/docs/ref/#view.Props), and add them below. */ type ViewEventHandlersOptions = { /** * Called when the editor is clicked, after `handleClickOn` handlers have been called. */ onClick?: (event: MouseEvent, view: EditorView, pos: number) => boolean | void; /** * Called when the editor receives a `keydown` event. */ onKeyDown?: (event: KeyboardEvent, view: EditorView) => boolean | void; }; /** * Augment the official `@tiptap/core` module with extra commands, relevant for this extension, so * that the compiler knows about them. */ declare module '@tiptap/core' { interface Commands { viewEventHandlers: { /** * Updates the handlers the plugin invokes. The editor component calls this as its * handler props change, since the editor and its plugins are created only once. */ setViewEventHandlers: (handlers: ViewEventHandlersOptions) => ReturnType; }; } } //#endregion export type { ViewEventHandlersOptions }; //# sourceMappingURL=view-event-handlers.d.ts.map