import type { LinkStepMetadata } from '@atlaskit/adf-schema/steps';
import type { EditorState, ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
/**
 * Records metadata about the user action and input method relating to a transaction
 * as a custom LinkStepMetadata prosemirror step so that it is preserved in
 * the history for undo/redo.
 */
export declare function addLinkMetadata(initialSelection: Selection, tr: Transaction, metadata: LinkStepMetadata): Transaction;
export declare function getLinkMetadataFromTransaction(tr: Transaction | ReadonlyTransaction): LinkStepMetadata;
export type CommandDispatch = (tr: Transaction) => void;
export type Command = (state: EditorState, dispatch?: CommandDispatch, view?: EditorView) => boolean;
/**
 * Adds metadata to the transaction created from a command
 * The metadata describes the user intent and input method
 * for executing the command
 */
export declare const commandWithMetadata: (command: Command, metadata: LinkStepMetadata) => Command;
