iniquity

A re-imagining of the iconic BBS software.

View on GitHub

Class: Runtime

core.Runtime

Runtime context for BBS execution Primary coordinator for all runtime components

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Runtime(output)

Parameters

Name Type
output IQOutput

Defined in

core/src/core.ts:157

Properties

data

data: IQReactorOptions

Defined in

core/src/core.ts:150

Accessors

mci

get mci(): MCIProcessor

Get the MCI processor

Returns

MCIProcessor

Defined in

core/src/core.ts:181


terminfo

get terminfo(): IQTermInfoObject

Get terminal dimensions

Returns

IQTermInfoObject

Defined in

core/src/core.ts:171

Methods

alert

alert(message, options?): Promise<void>

Display an alert box

Parameters

Name Type
message string
options? IAlertOptions

Returns

Promise<void>

Defined in

core/src/core.ts:492


artwork

artwork(options?): Artwork

Create artwork instance

Parameters

Name Type
options? IQArtworkOptions

Returns

Artwork

Defined in

core/src/core.ts:428


ask

ask(question): Promise<string>

Ask the user a question and return their input

Parameters

Name Type
question string

Returns

Promise<string>

Defined in

core/src/core.ts:327


clearLastRenderedMenuArtKey

clearLastRenderedMenuArtKey(): void

Clear the last-rendered art key (e.g. after full-screen goodbye so next menu full-redraws).

Returns

void

Defined in

core/src/core.ts:589


config

config(): IQConfig

Get configuration

Returns

IQConfig

Defined in

core/src/core.ts:485


cursor

cursor(options?): IQCursorChainableMethods

Get cursor control

Parameters

Name Type
options? IQCursorOptions

Returns

IQCursorChainableMethods

Defined in

core/src/core.ts:436


disablePause

disablePause(): void

Disable pause

Returns

void

Defined in

core/src/core.ts:617


disconnect

disconnect(): void

Disconnect the user

Returns

void

Defined in

core/src/core.ts:407


enablePause

enablePause(): void

Enable pause

Returns

void

Defined in

core/src/core.ts:610


frame

frame(options): IQFrame

Create a frame

Parameters

Name Type
options IQFrameOptions

Returns

IQFrame

Defined in

core/src/core.ts:421


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

core/src/core.ts:575


getMCIVar

getMCIVar(key): any

Get custom MCI variable

Parameters

Name Type
key string

Returns

any

Defined in

core/src/core.ts:209


getOutput

getOutput(): IQOutput

Get current output

Returns

IQOutput

Defined in

core/src/core.ts:164


getProgramDirectory

getProgramDirectory(): string

Get program directory

Returns

string

Defined in

core/src/core.ts:544


gotoxy

gotoxy(x, y): void

Move cursor to position

Parameters

Name Type
x number
y number

Returns

void

Defined in

core/src/core.ts:400


group

group(options): IQGroup

Create or load a group

Parameters

Name Type
options string | IGroupOptions

Returns

IQGroup

Defined in

core/src/core.ts:457


groups

groups(): IQGroupList

Get group list utilities

Returns

IQGroupList

Defined in

core/src/core.ts:464


isPauseAborted

isPauseAborted(): boolean

Check if pause was aborted by user

Returns

boolean

Defined in

core/src/core.ts:596


menu(options): IQMenu

Create a menu

Parameters

Name Type
options IQMenuOptions

Returns

IQMenu

Defined in

core/src/core.ts:414


network

network(): IQNetwork

Get network utilities

Returns

IQNetwork

Defined in

core/src/core.ts:471


pause

pause(optionsOrPrompt?): Promise<string>

Display pause prompt and wait for key

Parameters

Name Type
optionsOrPrompt? string | IQPauseOptions

Returns

Promise<string>

Defined in

core/src/core.ts:335


print

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

core/src/core.ts:288


printMCI

printMCI(text, pageLength?): Promise<IBBSPrintFunctions>

Print text with MCI processing

Parameters

Name Type
text string
pageLength? number

Returns

Promise<IBBSPrintFunctions>

Defined in

core/src/core.ts:319


processMCI

processMCI(text): string

Process MCI codes in text

Parameters

Name Type
text string

Returns

string

Defined in

core/src/core.ts:188


processPendingActions

processPendingActions(): Promise<boolean>

Process pending MCI actions

Returns

Promise<boolean>

Defined in

core/src/core.ts:216


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

core/src/core.ts:553


resetPauseAborted

resetPauseAborted(): void

Reset pause aborted state

Returns

void

Defined in

core/src/core.ts:603


say

say(text, options?): IBBSSayFunctions

Display text to the user

Parameters

Name Type
text any
options? IQSayOptions

Returns

IBBSSayFunctions

Defined in

core/src/core.ts:256


sayRaw

sayRaw(text): IBBSSayFunctions

Display raw text without MCI processing

Parameters

Name Type
text any

Returns

IBBSSayFunctions

Defined in

core/src/core.ts:281


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

core/src/core.ts:582


setMCIContext

setMCIContext(ctx): void

Set MCI context

Parameters

Name Type
ctx Partial<MCIContext>

Returns

void

Defined in

core/src/core.ts:195


setMCIVar

setMCIVar(key, value): void

Set custom MCI variable

Parameters

Name Type
key string
value any

Returns

void

Defined in

core/src/core.ts:202


setProgramDirectory

setProgramDirectory(dir): void

Set program directory for asset resolution

Parameters

Name Type
dir string

Returns

void

Defined in

core/src/core.ts:537


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

core/src/core.ts:568


text

text(content?): IQText

Create text manipulation instance

Parameters

Name Type Default value
content string ""

Returns

IQText

Defined in

core/src/core.ts:478


user

user(options): IQUser

Create or load a user

Parameters

Name Type
options IUserOptions

Returns

IQUser

Defined in

core/src/core.ts:443


users

users(): IQUserList

Get user list utilities

Returns

IQUserList

Defined in

core/src/core.ts:450


wait

wait(ms?): Promise<void>

Wait for specified milliseconds

Parameters

Name Type Default value
ms number 100

Returns

Promise<void>

Defined in

core/src/core.ts:393