import { ReactNode } from 'react'; import { AnyExtension, DOMOutputSpec, Fragment as ProsemirrorFragment, Mark, MarkExtensionSpec, NodeExtensionSpec, ProsemirrorNode, RemirrorManager } from '@remirror/core'; type NodeToDOM = NodeExtensionSpec['toDOM']; type MarkToDOM = MarkExtensionSpec['toDOM']; /** * Serialize the extension provided schema into a JSX element that can be displayed node and non-dom environments. */ export declare class ReactSerializer { #private; /** * Receives the return value from toDOM defined in the node schema and transforms it * into JSX * * @param structure - The DOMOutput spec for the current node * @param wraps - passed through any elements that this component should be parent of */ static renderSpec(structure: DOMOutputSpec, wraps?: ReactNode): ReactNode; /** * Create a serializer from the extension manager * * @param manager */ static fromManager(manager: RemirrorManager): ReactSerializer; /** * Pluck nodes from the extension manager * * @param manager */ private static nodesFromManager; /** * Pluck marks from the extension manager * * @param manager */ private static marksFromManager; nodes: Record; marks: Record; constructor(nodes: Record, marks: Record, manager: RemirrorManager); /** * The main entry method on this class for traversing through a schema tree and creating JSx. * * ```ts * reactSerializer.serializeFragment(fragment) * ``` * * @param fragment */ serializeFragment(fragment: ProsemirrorFragment): JSX.Element; /** * Transform the passed in node into a JSX Element * * @param node */ serializeNode(node: ProsemirrorNode): ReactNode; /** * Transform the provided mark into a JSX Element that wraps the current node * * @param mark * @param inline * @param wrappedElement */ serializeMark(mark: Mark, inline: boolean, wrappedElement: ReactNode): ReactNode; } export {};