import { NodeWithAttributes } from '@remirror/core-types'; import { Decoration, EditorView, NodeView, ProsemirrorNode } from '@remirror/pm'; import type { ViewMutationRecord } from '@remirror/pm/view'; import type { CreateNodeViewProps, GetPosition } from './node-view-types'; /** * This is the node view rapper that makes */ export declare class ReactNodeView implements NodeView { #private; /** * A shorthand method for creating the `ReactNodeView`. */ static create(props: CreateNodeViewProps): (node: NodeWithAttributes, view: EditorView, getPosition: GetPosition) => NodeView; /** * Whether or not the node is currently selected. */ get selected(): boolean; /** * The DOM node that should hold the node's content. * * This is only meaningful if the NodeView is not a leaf type and it can * accept content. When these criteria are met, `ProseMirror` will take care of * rendering the node's children into it. * * In order to make use of this in a */ get contentDOM(): HTMLElement | undefined; /** * Provides readonly access to the dom element. The dom is automatically for * react components. */ get dom(): HTMLElement; /** * Create the node view for a react component and render it into the dom. */ private constructor(); /** * Render the react component into the dom. */ private renderComponent; /** * Create the dom element which will hold the react component. */ private createDom; /** * The element that will contain the content for this element. */ private createContentDom; /** * Render the provided component. * * This method is passed into the HTML element. */ private readonly Component; /** * Passed to the Component to enable updating the attributes from within the component. */ private readonly updateAttributes; /** * This is called whenever the node is called. */ update(node: ProsemirrorNode, decorations: readonly Decoration[]): boolean; /** * Copies the attributes from a ProseMirror Node to the parent DOM node. * * @param node The Prosemirror Node from which to source the attributes */ setDomAttributes(node: ProsemirrorNode, element: HTMLElement): void; /** * Marks the node as being selected. */ selectNode(): void; /** * Remove the selected node markings from this component. */ deselectNode(): void; /** * This is called whenever the node is being destroyed. */ destroy(): void; /** * The handler which decides when mutations should be ignored. */ ignoreMutation(mutation: ViewMutationRecord): boolean; stopEvent(event: Event): boolean; }