Skip to content

getDomEventsHandlersConstructor

Extracts the DomEventsHandlersConstructor from Obsidian’s runtime.

Opens a temporary markdown file in preview mode and intercepts the constructor passed to MarkdownPreviewRenderer.registerDomEvents.

Import:

import { getDomEventsHandlersConstructor } from '@mnaoumov/obsidian-lib/constructors/get-dom-events-handlers-constructor';

Signature:

function getDomEventsHandlersConstructor(app: App): Promise<ConstructorBase<[info: DomEventsHandlersInfo], DomEventsHandlers>>

Parameters:

Parameter Type Description
app App The Obsidian app instance.

Returns: Promise<ConstructorBase<[info: DomEventsHandlersInfo], DomEventsHandlers>> — A Promise that resolves to the DomEventsHandlersConstructor.