import * as _tiptap_core from '@tiptap/core'; import { Node, Attrs } from '@tiptap/pm/model'; import { Selection } from '@tiptap/pm/state'; import { Editor } from '@tiptap/react'; export { useIsEditorEmpty } from './hooks/use-is-editor-empty.mjs'; export { useTiptapEditor } from './hooks/use-tiptap-editor.mjs'; export { getSelectedBlockNodes, getSelectedNodesOfType, selectionWithinConvertibleTypes } from './selection.mjs'; export { updateNodesAttr } from './update-node-attrs.mjs'; type OverflowPosition = "none" | "top" | "bottom" | "both"; declare function findParentNodeOfType(selection: Selection, typeName: string): { node: Node; pos: number; } | null; /** * Checks if a value is a valid number (not null, undefined, or NaN) * @param value - The value to check * @returns boolean indicating if the value is a valid number */ declare function isValidPosition(pos: number | null | undefined): pos is number; /** * Determines how a target element overflows relative to a container element */ declare function getElementOverflowPosition(targetElement: Element, containerElement: HTMLElement): OverflowPosition; /** * Checks if a mark exists in the editor schema * @param markName - The name of the mark to check * @param editor - The editor instance * @returns boolean indicating if the mark exists in the schema */ declare const isMarkInSchema: (markName: string, editor: Editor | null) => boolean; /** * Checks if a node exists in the editor schema * @param nodeName - The name of the node to check * @param editor - The editor instance * @returns boolean indicating if the node exists in the schema */ declare const isNodeInSchema: (nodeName: string, editor: Editor | null) => boolean; /** * Gets the active attributes of a specific mark in the current editor selection. * * @param editor - The Tiptap editor instance. * @param markName - The name of the mark to look for (e.g., "highlight", "link"). * @returns The attributes of the active mark, or `null` if the mark is not active. */ declare function getActiveMarkAttrs(editor: Editor | null, markName: string): Attrs | null; /** * Checks if a node is empty */ declare function isEmptyNode(node?: Node | null): boolean; /** * Checks if an editor is effectively empty (empty or contains only whitespace). * This considers documents with only spaces, tabs, or newlines as empty. */ declare function isEditorEffectivelyEmpty(editor: Editor | null): boolean; /** * Finds the position and instance of a node in the document * @param props Object containing editor, node (optional), and nodePos (optional) * @param props.editor The TipTap editor instance * @param props.node The node to find (optional if nodePos is provided) * @param props.nodePos The position of the node to find (optional if node is provided) * @returns An object with the position and node, or null if not found */ declare function findNodePosition(props: { editor: Editor | null; node?: Node | null; nodePos?: number | null; }): { pos: number; node: Node; } | null; /** * Checks if the current selection in the editor is a node selection of specified types * @param editor The Tiptap editor instance * @param types An array of node type names to check against * @returns boolean indicating if the selected node matches any of the specified types */ declare function isNodeTypeSelected(editor: Editor | null, types?: string[]): boolean; /** * Checks if one or more extensions are registered in the Tiptap editor. * @param editor - The Tiptap editor instance * @param extensionNames - A single extension name or an array of names to check * @returns True if at least one of the extensions is available, false otherwise */ declare function isExtensionAvailable(editor: Editor | null, extensionNames: string | string[]): boolean; /** * Retrieves a specific extension by name from the Tiptap editor. * @param editor - The Tiptap editor instance * @param extensionName - The name of the extension to retrieve * @returns The extension instance if found, otherwise null */ declare function getEditorExtension(editor: Editor | null, extensionName: string): _tiptap_core.AnyExtension | null; /** * Helper function to check if there's content above the current position */ declare function hasContentAbove(editor: Editor | null): { hasContent: boolean; content: string; }; /** * Finds the position of a node in the editor selection * @param params Object containing editor, node (optional), and nodePos (optional) * @returns The position of the node in the selection or null if not found */ declare function findSelectionPosition(params: { editor: Editor; node?: Node | null; nodePos?: number | null; }): number | null; export { findNodePosition, findParentNodeOfType, findSelectionPosition, getActiveMarkAttrs, getEditorExtension, getElementOverflowPosition, hasContentAbove, isEditorEffectivelyEmpty, isEmptyNode, isExtensionAvailable, isMarkInSchema, isNodeInSchema, isNodeTypeSelected, isValidPosition }; export type { OverflowPosition };