@grafana/ui
Version:
Grafana Components Library
13 lines (12 loc) • 771 B
TypeScript
import { type Plugin as SlatePlugin } from 'slate-react';
import { type SuggestionsState, type TypeaheadInput, type TypeaheadOutput } from '../types/completion';
export declare function SuggestionsPlugin({ onTypeahead, cleanText, onWillApplySuggestion, portalOrigin, }: {
onTypeahead?: (typeahead: TypeaheadInput) => Promise<TypeaheadOutput>;
cleanText?: (text: string) => string;
onWillApplySuggestion?: (suggestion: string, state: SuggestionsState) => string;
portalOrigin: string;
}): SlatePlugin;
export declare function getNumCharsToDelete(suggestionText: string, typeaheadPrefix: string, typeaheadText: string, preserveSuffix: boolean, deleteBackwards?: number, cleanText?: (text: string) => string): {
forward: number;
backward: number;
};