import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model'; import type { EditorState } from '@atlaskit/editor-prosemirror/state'; import type { EditorAnalyticsAPI } from '../analytics'; import type { Command } from '../types'; import { filter } from './filter'; export type WalkNode = { $pos: ResolvedPos; foundNode: boolean; }; /** * Walk forwards from a position until we encounter the (inside) start of * the next node, or reach the end of the document. * * @param $startPos Position to start walking from. */ export declare const walkNextNode: ($startPos: ResolvedPos) => WalkNode; /** * Walk backwards from a position until we encounter the (inside) end of * the previous node, or reach the start of the document. * * @param $startPos Position to start walking from. */ export declare const walkPrevNode: ($startPos: ResolvedPos) => WalkNode; export declare const insertNewLineWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command; export declare const createNewParagraphAbove: Command; export declare const createNewParagraphBelow: Command; export declare function createParagraphNear(append?: boolean): Command; /** * If the selection is empty, is inside a paragraph node and `canNextNodeMoveUp` is true then delete current paragraph * and move the node below it up. The selection will be retained, to be placed in the moved node. * * @param canNextNodeMoveUp check if node directly after the selection is able to be brought up to selection * @returns PM Command */ export declare const deleteEmptyParagraphAndMoveBlockUp: (canNextNodeMoveUp: (nextNode: PMNode) => boolean) => Command; /** * Check if the selection is empty and at the start of a task or list item * @param state Editor state * @returns true if selection is empty and at the start of a task or list item */ export declare const isEmptySelectionAtStart: (state: EditorState) => boolean; export declare const isEmptySelectionAtEnd: (state: EditorState) => boolean; export { filter as filterCommand }; export { filter } from './filter'; export { insertNewLine } from './insertNewLine'; export { atTheEndOfDoc } from './atTheEndOfDoc'; export { atTheBeginningOfDoc } from './atTheBeginningOfDoc'; export { insertContentDeleteRange } from './insertContentDeleteRange';