UNPKG

autosuggestion

Version:

  Generates suggestions for text completion.  

22 lines (21 loc) 981 B
import { Word, SuggestedPattern } from './types'; export declare class Suggestion { tokens: SuggestedPattern; rank: number; private _simplified; constructor(tokens: SuggestedPattern); get simplified(): Word[]; get length(): number; concat(suggestion: Suggestion): Suggestion; splice(offset: number, tokens: Word[]): Suggestion; /** * Given a sequence of offset tokens and a range, `n`, to resolve, this method * will resolve the next `n` contiguous lookups which occur after the provided * offset tokens. If the last token in the offset tokens is a substring of the * token at that offset in this suggestion, then no further resolution will occur. * This is mean to only resolve sequences of contiguous lookups occuring directly * after the final offset token if the final offset token completes a word suggestion. */ resolveLookups(offsetTokens: Word[], n: number): Suggestion[]; private _simplify; }