The expressions to try for one line of input, in order.
What a line declares, or null where it declares nothing.
An import declaration, read into what it binds — or null for anything else.
Whether a SyntaxError means the input is unfinished rather than wrong.
What one name in an import statement binds, and where in the module it comes from.
-
from: string | null
The export it takes,
'default'for a default import, ornullfor the module itself. -
name: string
The name it puts in scope.
A declaration made at a breakpoint: what it binds, to what, and how long it should last.
-
blockScoped: boolean
Whether it belongs to the block it was written in —
let,constandclassdo. -
name: string
The name it binds.
-
value: string
The expression its value comes from, to be evaluated where the input was typed.
An import statement typed at the prompt: what it reads, and what it binds.
-
bindings: Binding[]
Every name it puts in scope. Empty for
import './styles.css', which binds nothing. -
specifier: string
The module it reads, exactly as written — a path, or a package name.
An import statement that could not be read, and the line that would have been read.
-
advice: string
What to say about it, in one line.
Usage
import * as mod from "lib/repl/input.ts";