UNPKG

autosuggestion

Version:

  Generates suggestions for text completion.  

19 lines (18 loc) 891 B
import { Word } from './types'; import { Node, Match } from './node'; export declare class LookupNode extends Node { readonly contexts: Node[]; constructor(alias: string, contexts: Node[]); /** * Given a sequence of tokens, returns a list of the greatest common nodes in a pattern * and their corresponding remainders (see [[Node.matchPattern]] and [[Match]] for details). * * However, unlike [[Node.matchPattern]], this method attempts to resolve any results with * remainders at this contextual-level. That is, if a result from a `matchPattern` call on * a sub-context has remainders, this method will attempt to extend the match by trying to * match the remainder token sequence with the subsequent words in the pattern. * * @param tokens input tokens we wish to pattern match. */ matchPattern(tokens: Word[]): Match[]; }