UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

24 lines (23 loc) 1.14 kB
import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model'; import { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import { Plugin } from '@atlaskit/editor-prosemirror/state'; import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state'; /** * 🧱 Internal Helper Function: Editor FE Platform * * Attaches generic ProseMirror metadata attributes to a given DOM element based on the properties of a ProseMirror node. * This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node. * * * @param {Object} params - The parameters for the function. * @param {PMNode} params.node - The ProseMirror node from which to derive metadata. * @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached. */ export declare const attachGenericProseMirrorMetadata: ({ nodeOrMark, dom, }: { nodeOrMark: PMNode | PMMark; dom: HTMLElement; }) => void; export declare class SafePlugin<T = any> extends Plugin<T> { _isATypeSafePlugin: never; constructor(spec: SafePluginSpec<T>); }