import { Mark, MarkType, Node, ResolvedPos } from "prosemirror-model"; import { Bias } from "./types"; /** * Find the closest ancestor of a position matching a predicate. */ export declare function closest($pos: ResolvedPos, predicate: (node: Node) => boolean): { node: N; pos: number; start: S; depth: number; } | null; /** * Look for a node matching a predicate, by searching forwards through a * document from a position. */ export declare function findForward($pos: ResolvedPos, predicate: (node: Node, pos: number) => boolean): { $pos: ResolvedPos; node: Node; parent: Node; } | null; /** * Helper for iterating through the nodes in a document that changed compared to * the given previous document. Useful for avoiding duplicate work on each * transaction. */ export declare function changedDescendants(oldNode: Node, newNode: Node, offset: number, f: (node: Node, pos: number) => void): void; /** * Finds the bounds of an adjacent mark of a particular type. */ export declare function adjacentMarkBounds($pos: ResolvedPos, markType: MarkType, bias?: Bias): { mark: Mark; from: number; to: number; } | null; export declare function contiguousTextRange($from: ResolvedPos, $to: ResolvedPos): { from: number; to: number; } | null; export declare function grandParent($pos: ResolvedPos): { node: Node; index: number; };