/**
 * Utility functions for inspecting ProseMirror editor state.
 *
 * Provides helpers to check whether specific marks or nodes are active in the
 * current selection and to create reactive signals that track mark/node
 * activity as the user navigates the document.
 *
 * @module
 */
import { Signal } from '@tempots/dom';
import { Mark, MarkType, NodeType } from 'prosemirror-model';
import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
/**
 * Checks whether a mark of the given type is active in the current editor
 * selection.
 *
 * Works for both empty (collapsed) and non-empty selections. For empty
 * selections it also inspects `storedMarks` and adjacent nodes.
 *
 * @param state - The current ProseMirror editor state.
 * @param markType - The mark type to look for.
 * @returns `true` if the mark type is present in the selection.
 *
 * @example
 * ```ts
 * const bold = editorView.state.schema.marks.strong
 * if (isMarkActive(editorView.state, bold)) {
 *   console.log('Bold is active')
 * }
 * ```
 */
export declare function isMarkActive(state: EditorState, markType: MarkType): boolean;
/**
 * Returns the first `Mark` instance of the given type found in the current
 * selection, or `null` if no such mark is present.
 *
 * For empty (collapsed) selections the function checks, in order:
 * 1. `storedMarks` (marks queued for the next typed character)
 * 2. Marks at the resolved cursor position
 * 3. Marks on the node immediately after the cursor
 *
 * For non-empty selections the function iterates over all nodes in the range.
 *
 * Comparisons are done by mark-type name to avoid object-identity issues
 * that can occur with ProseMirror schemas.
 *
 * @param state - The current ProseMirror editor state.
 * @param markType - The mark type to retrieve.
 * @returns The found `Mark` instance, or `null`.
 *
 * @example
 * ```ts
 * const linkMark = getMarkByType(editorView.state, editorView.state.schema.marks.link)
 * if (linkMark) {
 *   console.log('Link href:', linkMark.attrs.href)
 * }
 * ```
 */
export declare function getMarkByType(state: EditorState, markType: MarkType): Mark | null;
/**
 * Creates a reactive `Signal<boolean>` that tracks whether a mark of the
 * given type is active in the current ProseMirror selection.
 *
 * The signal recomputes whenever the `state` ticker updates (which is
 * triggered on every editor transaction).
 *
 * @param state - A ticker signal that increments on every editor state change.
 * @param view - A signal holding the current `EditorView`.
 * @param markType - The name of the mark type to track (e.g. `'strong'`, `'em'`, `'link'`).
 * @returns A derived `Signal<boolean>` that is `true` when the mark is active.
 *
 * @example
 * ```ts
 * const isBold = makeActiveMarkSignal(stateUpdate, editorView, 'strong')
 * isBold.on(active => {
 *   console.log('Bold active:', active)
 * })
 * ```
 */
export declare function makeActiveMarkSignal(state: Signal<number>, view: Signal<EditorView>, markType: string): import("@tempots/dom").Computed<boolean>;
/**
 * Checks whether a node of the given type is active at the current selection
 * position.
 *
 * Walks up the document tree from the resolved cursor position and also
 * checks the node at the exact position. If `attrs` are provided, the
 * function additionally verifies that the node's attributes match.
 *
 * @param state - The current ProseMirror editor state.
 * @param nodeType - The node type to look for.
 * @param attrs - Optional attribute constraints to match against the node's attributes.
 * @returns `true` if a matching node is found in the current selection.
 *
 * @example
 * ```ts
 * const heading = editorView.state.schema.nodes.heading
 * if (isNodeActive(editorView.state, heading, { level: 2 })) {
 *   console.log('Currently inside an H2')
 * }
 * ```
 */
export declare function isNodeActive(state: EditorState, nodeType: NodeType, attrs?: Record<string, unknown>): boolean;
/**
 * Creates a reactive `Signal<boolean>` that tracks whether a node of the
 * given type (and optional attributes) is active at the current selection.
 *
 * The signal recomputes whenever the `state` ticker updates.
 *
 * @param state - A ticker signal that increments on every editor state change.
 * @param view - A signal holding the current `EditorView`.
 * @param nodeTypeName - The name of the node type to track (e.g. `'heading'`, `'bullet_list'`).
 * @param attrs - Optional attribute constraints (e.g. `{ level: 2 }` for H2 headings).
 * @returns A derived `Signal<boolean>` that is `true` when the node is active.
 *
 * @example
 * ```ts
 * const isH2 = makeActiveNodeSignal(stateUpdate, editorView, 'heading', { level: 2 })
 * isH2.on(active => {
 *   console.log('Inside H2:', active)
 * })
 * ```
 */
export declare function makeActiveNodeSignal(state: Signal<number>, view: Signal<EditorView>, nodeTypeName: string, attrs?: Record<string, unknown>): import("@tempots/dom").Computed<boolean>;
