UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

24 lines (23 loc) 1.15 kB
import type { IntlShape } from 'react-intl-next'; import { SafePlugin } from '@atlaskit/editor-common/safe-plugin'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import { PluginKey } from '@atlaskit/editor-prosemirror/state'; import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform'; import { DecorationSet } from '@atlaskit/editor-prosemirror/view'; import { type DiffParams, type DiffType, type ShowDiffPlugin } from '../showDiffPluginType'; export declare const showDiffPluginKey: PluginKey<ShowDiffPluginState>; export type ShowDiffPluginState = { activeIndex?: number; activeIndexPos?: { from: number; to: number; }; decorations: DecorationSet; diffType?: DiffType; isDisplayingChanges: boolean; isInverted?: boolean; originalDoc: PMNode | undefined; steps: ProseMirrorStep[]; }; export declare const createPlugin: (config: DiffParams | undefined, getIntl: () => IntlShape, api: ExtractInjectionAPI<ShowDiffPlugin> | undefined) => SafePlugin<ShowDiffPluginState>;