Skip to content

Script

const Script: object

alert: (message, __namedParameters) => Effect<void, never, never>

Waits until the user dismisses it. Interrupting the effect closes the dialog.

string

DialogOptions = {}

Effect<void, never, never>

beep: (times) => Effect<void, never, never>

Plays Mira’s chime times times and waits for the last one to finish. Interrupting the effect cuts it off.

number = 1

Effect<void, never, never>

confirm: (message, __namedParameters) => Effect<boolean, never, never>

True when confirmed, false when cancelled. Interrupting the effect closes the dialog.

string

ConfirmOptions = {}

Effect<boolean, never, never>

exit: (__namedParameters) => Effect<never>

Ends the script from any fiber. Cleanup runs first, then the logout, then the tab closes a second later.

ExitOptions = {}

Effect<never>

inputs: <D>() => InputValues<D>

The values this run started with. Pass typeof inputs to type them; Mira checks the values, not the type.

D extends Inputs = Inputs

InputValues<D>

prompt: (message, __namedParameters) => Effect<string | null, never, never>

The text as entered, or null when cancelled. Interrupting the effect closes the dialog.

string

PromptOptions = {}

Effect<string | null, never, never>

signal: AbortSignal = stopping.signal

Aborts when the script is stopped or exits, before cleanup runs, or when it ends.

sleep: (duration) => Effect<void, never, never>

Input

Effect<void, never, never>