f
split(line: string): Typed | null
Where a completion would go in line, or null where none could.
f
suggest(): string
line: string,
sources: Sources
The rest of what is being typed, drawn after the cursor — zsh's autosuggestion.
I
Sources
What a suggestion can be drawn from. Both are optional: either alone still answers.
-
history: readonly string[]
Lines already entered, newest first — readline's own record.
-
names: readonly string[]
Identifiers the page has on Typed.base, in any order.
I
Typed
A name and a path: document.qu is qu hanging off document, doc is doc off nothing.
-
base: string
The expression whose properties could finish the token, or
''for a bare name. -
token: string
The partial identifier under the cursor, empty directly after a dot.
Usage
import * as mod from "lib/repl/suggest.ts";