export interface ISpellcheckerSuggestion { text: string; } export interface ISpellcheckWarning { // zero-based; line breaks are counted as single characters. startOffset: number; // offending text fragment. Can consist of multiple words. Can NOT span multiple paragraphs. text: string; type: 'spelling' | 'grammar'; // list of text fragments suggested to replace offending text fragment. // Can consist of multiple words. Can NOT span multiple paragraphs. // Can be omited if `ISpellchecker['getSuggestions']` method is defined. suggestions?: Array; // Description of the suggestion, to display language style suggestions message?: string; } export interface ISpellcheckerAction { label: string; perform: (warning: ISpellcheckWarning) => Promise; } export interface ISpellchecker { // text - formatting-free text, can be multiline check(text: string): Promise>; // text - formatting-free text, must be single-line // can be ommited if suggestions are provided in `ISpellcheckWarning`s returned from the `check` method. getSuggestions?(text: string): Promise>; actions: {[key: string]: ISpellcheckerAction}; }