UNPKG

@atlaskit/editor-plugin-undo-redo

Version:

Undo redo plugin for @atlaskit/editor-core

29 lines (28 loc) 1.29 kB
import type { EditorAnalyticsAPI, ACTION } from '@atlaskit/editor-common/analytics'; import type { HigherOrderCommand, Command } from '@atlaskit/editor-common/types'; import type { Node } from '@atlaskit/editor-prosemirror/model'; import { InputSource } from './enums'; type AttachInputMeta = (inputSource: InputSource) => HigherOrderCommand; export declare const attachInputMeta: AttachInputMeta; type NodeHistory = { after: Node; before: Node; }; type NodeWithDifferingAttributes = { attributes: string[]; type: string; }; /** * Analyzes changes between two ProseMirror document nodes. * * @param params - Object containing before and after node states * @param params.before - The document node before changes * @param params.after - The document node after changes * @returns Object containing change analysis results with hasChanged boolean and affectedNodes array */ export declare function getChanges({ before, after }: NodeHistory): { hasChanged: boolean; affectedNodes: NodeWithDifferingAttributes[] | undefined; }; export declare const attachInputMetaWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputSource: InputSource, action: ACTION.UNDO_PERFORMED | ACTION.REDO_PERFORMED) => (command: Command) => Command; export {};