render() function
render() function
Section titled “render() function”Draws the active terminal state line and overlay menus onto the output stream.
Signature:
export declare function render(state: ReplState, registry: Registry, promptStr: string, jsMode: boolean, opts: RenderOptions | undefined, stdout: Writable & { columns?: number; rows?: number;}, context: any, globals: any): void;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
state |
Current REPL state (input, cursor position, candidates, etc.). | |
|
registry |
Registry of command metadata used for completion and colouring. | |
|
promptStr |
string |
The prompt string to display (may contain ANSI codes). |
|
jsMode |
boolean |
Whether the JS VM input mode is active. |
|
opts |
RenderOptions | undefined |
Optional rendering overrides (e.g. flash the prompt red on error). |
|
stdout |
Writable & { columns?: number; rows?: number; } |
The writable stream to render into. |
|
context |
any |
Sandbox context reference passed through to colorInput. |
|
globals |
any |
Global variables reference passed through to colorInput. |
Returns:
void
Remarks
Section titled “Remarks”Calculates previous drop lists, prints ghost hints, adds syntax text-coloring tokens, renders scrolling window overlays for overflows, and highlights selection blocks.