@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
27 lines (26 loc) • 1.21 kB
TypeScript
import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
import type { 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, options, }: {
dom: HTMLElement;
nodeOrMark: PMNode | PMMark;
options?: {
anchrorId?: string;
};
}) => void;
export declare class SafePlugin<T = any> extends Plugin<T> {
_isATypeSafePlugin: never;
constructor(spec: SafePluginSpec<T>);
}