import { ReactNode } from 'react'; import { AnyExtension, Editor } from '@tiptap/core'; import { TiptapPresetConfig } from '../../../shared/src/types'; import { AnyRichTextComponentDefinition, RichTextComponentContext, RichTextComponentHelpers } from '../registry/types'; import { AttributeValues } from '../utils/componentAttrs'; /** The bundled Tiptap primitives handed to escape-hatch extensions. */ export declare const richTextHelpers: RichTextComponentHelpers; /** Builds the Tiptap node for a definition; closures (not `this`) so tests can call the config functions directly. */ export declare function createComponentExtension(definition: AnyRichTextComponentDefinition, ctx: RichTextComponentContext): AnyExtension; /** * Inserts a node at the cursor. `createAndFill` gives a container whatever its content expression * requires (one empty paragraph for `block+`), so the cursor has somewhere to go and the node is valid. */ export declare function insertRichTextComponent(editor: Editor, definition: AnyRichTextComponentDefinition, attrs: AttributeValues): boolean; /** Toolbar menu listing every component the preset enables, plus the insert dialog for the picked one. */ export declare function useRichTextComponents(editor: Editor | null, props: { config: TiptapPresetConfig; disabled?: boolean; }): { componentsMenu: ReactNode; componentDialog: ReactNode; };