import { Transaction } from "prosemirror-state"; /** * Returns a transaction that inserts a new paragraph if there is no node after the cursor. * This is useful for when inserting block nodes, since the cursor cannot be placed after those blocks at the end of a document. * This makes document navigation much more intuitive for end users. * @param tr The most recent transaction to the document * @param cursorOffset TODO HACK The offset of where the cursor is vs where the inserted node is */ export declare function insertParagraphIfAtDocEnd(tr: Transaction, cursorOffset?: number): Transaction; /** * Attempts to create a TextSelection at `newPos`. If that position does not lie * in an inline (text) context (i.e., if the parent node is not a textblock), * this function falls back to a NodeSelection on the block at `blockStart`. * * This is useful in commands (e.g. toggling a code block) where you might end up * with an empty block or a position outside a valid text context. Using this * helper avoids console warnings and ensures we have a valid selection in the doc. * * @param tr The current Transaction to update. * @param blockStart The start position of the block node (e.g., paragraph/code_block). * @param newPos The desired position for the text cursor. * @returns The updated Transaction with a valid selection set. */ export declare function safeSetSelection(tr: Transaction, blockStart: number, newPos: number): Transaction;