Class: Runtime
core.Runtime
Runtime context for BBS execution Primary coordinator for all runtime components
Table of contents
Constructors
Properties
Accessors
Methods
- alert
- artwork
- ask
- clearLastRenderedMenuArtKey
- config
- cursor
- disablePause
- disconnect
- enablePause
- frame
- getLastRenderedMenuArtKey
- getMCIVar
- getOutput
- getProgramDirectory
- gotoxy
- group
- groups
- isPauseAborted
- menu
- network
- pause
- printMCI
- processMCI
- processPendingActions
- processSnacks
- resetPauseAborted
- say
- sayRaw
- setLastRenderedMenuArtKey
- setMCIContext
- setMCIVar
- setProgramDirectory
- setPromptPosition
- text
- user
- users
- wait
Constructors
constructor
• new Runtime(output)
Parameters
| Name | Type |
|---|---|
output |
IQOutput |
Defined in
Properties
data
• data: IQReactorOptions
Defined in
Accessors
mci
• get mci(): MCIProcessor
Get the MCI processor
Returns
Defined in
terminfo
• get terminfo(): IQTermInfoObject
Get terminal dimensions
Returns
Defined in
Methods
alert
▸ alert(message, options?): Promise<void>
Display an alert box
Parameters
| Name | Type |
|---|---|
message |
string |
options? |
IAlertOptions |
Returns
Promise<void>
Defined in
artwork
▸ artwork(options?): Artwork
Create artwork instance
Parameters
| Name | Type |
|---|---|
options? |
IQArtworkOptions |
Returns
Defined in
ask
▸ ask(question): Promise<string>
Ask the user a question and return their input
Parameters
| Name | Type |
|---|---|
question |
string |
Returns
Promise<string>
Defined in
clearLastRenderedMenuArtKey
▸ clearLastRenderedMenuArtKey(): void
Clear the last-rendered art key (e.g. after full-screen goodbye so next menu full-redraws).
Returns
void
Defined in
config
▸ config(): IQConfig
Get configuration
Returns
Defined in
cursor
▸ cursor(options?): IQCursorChainableMethods
Get cursor control
Parameters
| Name | Type |
|---|---|
options? |
IQCursorOptions |
Returns
Defined in
disablePause
▸ disablePause(): void
Disable pause
Returns
void
Defined in
disconnect
▸ disconnect(): void
Disconnect the user
Returns
void
Defined in
enablePause
▸ enablePause(): void
Enable pause
Returns
void
Defined in
frame
▸ frame(options): IQFrame
Create a frame
Parameters
| Name | Type |
|---|---|
options |
IQFrameOptions |
Returns
Defined in
getLastRenderedMenuArtKey
▸ getLastRenderedMenuArtKey(): null | string
Get the art key of the last menu that drew artwork (used to skip redraw when same art).
Returns
null | string
Defined in
getMCIVar
▸ getMCIVar(key): any
Get custom MCI variable
Parameters
| Name | Type |
|---|---|
key |
string |
Returns
any
Defined in
getOutput
▸ getOutput(): IQOutput
Get current output
Returns
Defined in
getProgramDirectory
▸ getProgramDirectory(): string
Get program directory
Returns
string
Defined in
gotoxy
▸ gotoxy(x, y): void
Move cursor to position
Parameters
| Name | Type |
|---|---|
x |
number |
y |
number |
Returns
void
Defined in
group
▸ group(options): IQGroup
Create or load a group
Parameters
| Name | Type |
|---|---|
options |
string | IGroupOptions |
Returns
Defined in
groups
▸ groups(): IQGroupList
Get group list utilities
Returns
Defined in
isPauseAborted
▸ isPauseAborted(): boolean
Check if pause was aborted by user
Returns
boolean
Defined in
menu
▸ menu(options): IQMenu
Create a menu
Parameters
| Name | Type |
|---|---|
options |
IQMenuOptions |
Returns
Defined in
network
▸ network(): IQNetwork
Get network utilities
Returns
Defined in
pause
▸ pause(optionsOrPrompt?): Promise<string>
Display pause prompt and wait for key
Parameters
| Name | Type |
|---|---|
optionsOrPrompt? |
string | IQPauseOptions |
Returns
Promise<string>
Defined in
▸ print(text, pageLength?): Promise<IBBSPrintFunctions>
Print text with automatic pause at page length
Parameters
| Name | Type |
|---|---|
text |
any |
pageLength? |
number |
Returns
Promise<IBBSPrintFunctions>
Defined in
printMCI
▸ printMCI(text, pageLength?): Promise<IBBSPrintFunctions>
Print text with MCI processing
Parameters
| Name | Type |
|---|---|
text |
string |
pageLength? |
number |
Returns
Promise<IBBSPrintFunctions>
Defined in
processMCI
▸ processMCI(text): string
Process MCI codes in text
Parameters
| Name | Type |
|---|---|
text |
string |
Returns
string
Defined in
processPendingActions
▸ processPendingActions(): Promise<boolean>
Process pending MCI actions
Returns
Promise<boolean>
Defined in
processSnacks
▸ processSnacks(): void
Process any queued snacks (draw one, then after duration clear and process next). Called from menu loop or session tick. No-op if output does not support snacks. Cursor is restored by showSnack (save/restore) so behavior is correct in any context.
Returns
void
Defined in
resetPauseAborted
▸ resetPauseAborted(): void
Reset pause aborted state
Returns
void
Defined in
say
▸ say(text, options?): IBBSSayFunctions
Display text to the user
Parameters
| Name | Type |
|---|---|
text |
any |
options? |
IQSayOptions |
Returns
Defined in
sayRaw
▸ sayRaw(text): IBBSSayFunctions
Display raw text without MCI processing
Parameters
| Name | Type |
|---|---|
text |
any |
Returns
Defined in
setLastRenderedMenuArtKey
▸ setLastRenderedMenuArtKey(key): void
Set the art key after drawing menu artwork (so next menu can skip if same).
Parameters
| Name | Type |
|---|---|
key |
string |
Returns
void
Defined in
setMCIContext
▸ setMCIContext(ctx): void
Set MCI context
Parameters
| Name | Type |
|---|---|
ctx |
Partial<MCIContext> |
Returns
void
Defined in
setMCIVar
▸ setMCIVar(key, value): void
Set custom MCI variable
Parameters
| Name | Type |
|---|---|
key |
string |
value |
any |
Returns
void
Defined in
setProgramDirectory
▸ setProgramDirectory(dir): void
Set program directory for asset resolution
Parameters
| Name | Type |
|---|---|
dir |
string |
Returns
void
Defined in
setPromptPosition
▸ setPromptPosition(x, y): void
Set the current prompt position (1-based). Called by the menu so the cursor can be restored to the prompt after a snack is cleared.
Parameters
| Name | Type |
|---|---|
x |
number |
y |
number |
Returns
void
Defined in
text
▸ text(content?): IQText
Create text manipulation instance
Parameters
| Name | Type | Default value |
|---|---|---|
content |
string |
"" |
Returns
Defined in
user
▸ user(options): IQUser
Create or load a user
Parameters
| Name | Type |
|---|---|
options |
IUserOptions |
Returns
Defined in
users
▸ users(): IQUserList
Get user list utilities
Returns
Defined in
wait
▸ wait(ms?): Promise<void>
Wait for specified milliseconds
Parameters
| Name | Type | Default value |
|---|---|---|
ms |
number |
100 |
Returns
Promise<void>