autosuggestion
Version:
  Generates suggestions for text completion.  
45 lines (44 loc) • 1.12 kB
TypeScript
export declare type Word = string;
export declare type Context = string;
export declare type Value = string | null;
export interface Lookup {
[index: string]: Context | Context[];
}
export interface CharMap {
[index: string]: import('./node').Node;
}
export interface LookupMap {
[index: string]: import('./lookup').LookupNode;
}
/**
* maybe _this_ should go in the `node.ts` file.
*
* collection of next nodes by *type*.
*
* ```typescript
* const a = {
* char: {},
* word: {},
* lookup: {},
* }
*
* interface Foo {
* member: boolean
* }
* ```
*/
export interface NextNodes {
char: CharMap;
word: CharMap;
lookup: LookupMap;
}
/**
* Defines a LIFO queue representing the call stack for nodes nested within
* lookup contexts. This is important for matching input to trie nodes and
* then deriving all possible completions at each level of the call stack.
*/
export declare type NodeStack = import('./node').Node[];
export declare type Pattern = (Word | Lookup)[];
export declare type SuggestedPattern = (Word | {
[alias: string]: import('./node').Node[];
})[];