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:177

Properties

data

data: IQReactorOptions

Defined in

core/src/core.ts:170

Accessors

mci

get mci(): MCIProcessor

Get the MCI processor

Returns

MCIProcessor

Defined in

core/src/core.ts:201


terminfo

get terminfo(): IQTermInfoObject

Get terminal dimensions

Returns

IQTermInfoObject

Defined in

core/src/core.ts:191

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:512


artwork

artwork(options?): Artwork

Create artwork instance

Parameters

Name Type
options? IQArtworkOptions

Returns

Artwork

Defined in

core/src/core.ts:448


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:347


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:609


config

config(): IQConfig

Get configuration

Returns

IQConfig

Defined in

core/src/core.ts:505


cursor

cursor(options?): IQCursorChainableMethods

Get cursor control

Parameters

Name Type
options? IQCursorOptions

Returns

IQCursorChainableMethods

Defined in

core/src/core.ts:456


disablePause

disablePause(): void

Disable pause

Returns

void

Defined in

core/src/core.ts:637


disconnect

disconnect(): void

Disconnect the user

Returns

void

Defined in

core/src/core.ts:427


enablePause

enablePause(): void

Enable pause

Returns

void

Defined in

core/src/core.ts:630


frame

frame(options): IQFrame

Create a frame

Parameters

Name Type
options IQFrameOptions

Returns

IQFrame

Defined in

core/src/core.ts:441


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:595


getMCIVar

getMCIVar(key): any

Get custom MCI variable

Parameters

Name Type
key string

Returns

any

Defined in

core/src/core.ts:229


getOutput

getOutput(): IQOutput

Get current output

Returns

IQOutput

Defined in

core/src/core.ts:184


getProgramDirectory

getProgramDirectory(): string

Get program directory

Returns

string

Defined in

core/src/core.ts:564


gotoxy

gotoxy(x, y): void

Move cursor to position

Parameters

Name Type
x number
y number

Returns

void

Defined in

core/src/core.ts:420


group

group(options): IQGroup

Create or load a group

Parameters

Name Type
options string | IGroupOptions

Returns

IQGroup

Defined in

core/src/core.ts:477


groups

groups(): IQGroupList

Get group list utilities

Returns

IQGroupList

Defined in

core/src/core.ts:484


isPauseAborted

isPauseAborted(): boolean

Check if pause was aborted by user

Returns

boolean

Defined in

core/src/core.ts:616


menu(options): IQMenu

Create a menu

Parameters

Name Type
options IQMenuOptions

Returns

IQMenu

Defined in

core/src/core.ts:434


network

network(): IQNetwork

Get network utilities

Returns

IQNetwork

Defined in

core/src/core.ts:491


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:355


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:308


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:339


processMCI

processMCI(text): string

Process MCI codes in text

Parameters

Name Type
text string

Returns

string

Defined in

core/src/core.ts:208


processPendingActions

processPendingActions(): Promise<boolean>

Process pending MCI actions

Returns

Promise<boolean>

Defined in

core/src/core.ts:236


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:573


resetPauseAborted

resetPauseAborted(): void

Reset pause aborted state

Returns

void

Defined in

core/src/core.ts:623


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:276


sayRaw

sayRaw(text): IBBSSayFunctions

Display raw text without MCI processing

Parameters

Name Type
text any

Returns

IBBSSayFunctions

Defined in

core/src/core.ts:301


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:602


setMCIContext

setMCIContext(ctx): void

Set MCI context

Parameters

Name Type
ctx Partial<MCIContext>

Returns

void

Defined in

core/src/core.ts:215


setMCIVar

setMCIVar(key, value): void

Set custom MCI variable

Parameters

Name Type
key string
value any

Returns

void

Defined in

core/src/core.ts:222


setProgramDirectory

setProgramDirectory(dir): void

Set program directory for asset resolution

Parameters

Name Type
dir string

Returns

void

Defined in

core/src/core.ts:557


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:588


text

text(content?): IQText

Create text manipulation instance

Parameters

Name Type Default value
content string ""

Returns

IQText

Defined in

core/src/core.ts:498


user

user(options): IQUser

Create or load a user

Parameters

Name Type
options IUserOptions

Returns

IQUser

Defined in

core/src/core.ts:463


users

users(): IQUserList

Get user list utilities

Returns

IQUserList

Defined in

core/src/core.ts:470


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:413