lantern
Import
Section titled “Import”import * as api from "@fungi.computer/lantern";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | Cli | Own terminal presentation; callers retain commands, credentials and state. |
| type alias | CliOptions | |
| type alias | SearchChoice | Already ordered choices; the caller owns group membership and labels. |
| type alias | SearchOptions |
Cliclass
Section titled “Cli”Own terminal presentation; callers retain commands, credentials and state.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Cli(options): Cli;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
CliOptions |
Returns
Section titled “Returns”Properties
Section titled “Properties”interactive
Section titled “interactive”readonly interactive: boolean;Methods
Section titled “Methods”welcome()
Section titled “welcome()”welcome(message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
Returns
Section titled “Returns”void
select()
Section titled “select()”select<Value>(options): Promise<symbol | Value>;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Value |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
SelectOptions<Value> |
Returns
Section titled “Returns”Promise<symbol | Value>
text()
Section titled “text()”text(options): Promise<string | symbol>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
TextOptions |
Returns
Section titled “Returns”Promise<string | symbol>
search()
Section titled “search()”search(options): Promise<string | symbol>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
SearchOptions |
Returns
Section titled “Returns”Promise<string | symbol>
password()
Section titled “password()”password(options): Promise<string | symbol>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
PasswordOptions |
Returns
Section titled “Returns”Promise<string | symbol>
confirm()
Section titled “confirm()”confirm(options): Promise<boolean | symbol>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ConfirmOptions |
Returns
Section titled “Returns”Promise<boolean | symbol>
info()
Section titled “info()”info(message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
Returns
Section titled “Returns”void
url(url): void;Show a URL inside the prompt frame as one unbroken line. info() and step()
add a status symbol; this keeps only the frame’s “│” bar before the URL and
never inserts a line break, so the terminal soft-wraps it and a selection from
its first character copies the whole URL.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url |
string |
Returns
Section titled “Returns”void
link()
Section titled “link()”link(label, url): string;An OSC 8 hyperlink around a short label, for terminals that render it. Falls
back to the plain label when output is non-interactive, piped, or NO_COLOR/dumb
— the same signal info() already uses to decide whether to use clack’s styling
at all.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
label |
string |
url |
string |
Returns
Section titled “Returns”string
step()
Section titled “step()”step(message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
Returns
Section titled “Returns”void
outro()
Section titled “outro()”outro(message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
Returns
Section titled “Returns”void
cancel()
Section titled “cancel()”cancel(message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
Returns
Section titled “Returns”void
task()
Section titled “task()”task<T>(message, work): Promise<T>;Stop animation on both success and failure, without exposing error payloads.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |
work |
(update) => Promise<T> |
Returns
Section titled “Returns”Promise<T>
checklist()
Section titled “checklist()”checklist(): (label, ok, detail) => void;Shared doctor checklist; the caller owns what constitutes a pass.
Returns
Section titled “Returns”(label, ok, detail) => void
CliOptionstype alias
Section titled “CliOptions”type CliOptions = object;Properties
Section titled “Properties”brand: CliBrand;input?
Section titled “input?”optional input?: Readable;output?
Section titled “output?”optional output?: Writable;interactive?
Section titled “interactive?”optional interactive?: boolean;columns?
Section titled “columns?”optional columns?: number;SearchChoicetype alias
Section titled “SearchChoice”type SearchChoice = Readonly<{ value: string; label: string; description?: string; group?: string;}>;Already ordered choices; the caller owns group membership and labels.
SearchOptionstype alias
Section titled “SearchOptions”type SearchOptions = Readonly<{ message: string; choices: readonly SearchChoice[]; collapsedGroup?: string; signal?: AbortSignal;}>;References
Section titled “References”renderBanner
Section titled “renderBanner”Re-exports renderBanner