@firecms/core
Version:
Awesome Firebase/Firestore-based headless open-source CMS
25 lines (24 loc) • 982 B
TypeScript
import { Plugin, PluginKey, Transaction, EditorState } from "prosemirror-state";
import { DecorationSet } from "prosemirror-view";
export interface HighlightRange {
from: number;
to: number;
}
interface AutocompleteHighlightState {
highlight?: HighlightRange;
decorationSet?: DecorationSet;
}
export declare const highlightDecorationKey: PluginKey<AutocompleteHighlightState>;
/**
* Commands to toggle the highlight
*/
export declare const highlightCommands: {
toggleAutocompleteHighlight: (range?: HighlightRange) => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
removeAutocompleteHighlight: () => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
};
/**
* This plugin is used to highlight the current autocomplete suggestion.
* It allows to set a range and remove it.
*/
export declare const highlightDecorationPlugin: (initialHighlight?: HighlightRange) => Plugin<AutocompleteHighlightState>;
export {};