@atlaskit/editor-plugin-mentions
Version:
Mentions plugin for @atlaskit/editor-core
13 lines (12 loc) • 856 B
TypeScript
import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
import type { AgentRunStateByLocalId } from '../types';
/**
* Build the node-decoration set that styles agent mentions by their run-state.
*/
export declare const buildAgentRunStateDecorations: (state: EditorState, runStateByLocalId: AgentRunStateByLocalId | undefined) => DecorationSet;
/**
* Computes the next cached run-state `DecorationSet` for a plugin's `apply`, so that
* `props.decorations` can return a stored set instead of walking the doc on every transaction:
*/
export declare const nextRunStateDecorations: (previous: DecorationSet | undefined, tr: ReadonlyTransaction, newState: EditorState, runStateByLocalId: AgentRunStateByLocalId | undefined) => DecorationSet | undefined;