@types/blessed
- Version 0.1.25
- Published
- 103 kB
- 1 dependency
- MIT license
Install
npm i @types/blessed
yarn add @types/blessed
pnpm add @types/blessed
Overview
TypeScript definitions for blessed
Index
Variables
Functions
- bigtext()
- box()
- button()
- checkbox()
- cleanTags()
- escape()
- filemanager()
- form()
- generateTags()
- input()
- layout()
- line()
- list()
- listbar()
- listtable()
- loading()
- log()
- message()
- parseTags()
- program()
- progressbar()
- prompt()
- question()
- radiobutton()
- radioset()
- screen()
- scrollablebox()
- scrollabletext()
- stripTags()
- table()
- terminal()
- text()
- textarea()
- textbox()
Classes
BlessedProgram
- ae()
- alternate()
- alternateBuffer()
- as()
- back()
- backspace()
- bel()
- bell()
- bg()
- bindMouse()
- bindResponse()
- cbt()
- cha()
- charAttributes()
- charPosAbsolute()
- charset()
- cht()
- civis()
- clear()
- cnl()
- cols
- copyRectangle()
- copyToClipboard()
- cpl()
- cr()
- csr()
- cub()
- cud()
- cuf()
- cup()
- cursor_invisible()
- cursorBackward()
- cursorBackwardTab()
- cursorCharAbsolute()
- cursorColor()
- cursorDown()
- cursorForward()
- cursorForwardTab()
- cursorNextLine()
- cursorPos()
- cursorPrecedingLine()
- cursorReset()
- cursorShape()
- cursorUp()
- cuu()
- da()
- dch()
- debug()
- deccara()
- deccra()
- decdc()
- decefr()
- decelr()
- decera()
- decfra()
- decic()
- decll()
- decrara()
- decreqtparm()
- decrqlp()
- decrqm()
- decrqmp()
- decrst()
- decsace()
- decsca()
- decscl()
- decscursr()
- decsera()
- decset()
- decsle()
- decstbm()
- decstr()
- decswbv()
- dectcemh()
- deleteChars()
- deleteColumns()
- deleteLines()
- destroy()
- deviceStatuses()
- disableGpm()
- disableModifieres()
- disableMouse()
- dl()
- down()
- dsr()
- dynamicColors()
- ech()
- echo()
- ed()
- el()
- enableFilterRectangle()
- enableGpm()
- enableLocatorReporting()
- enableMouse()
- enter_alt_charset_mode()
- eraseChars()
- eraseInDisplay()
- eraseInLine()
- eraseRectangle()
- exit_alt_charset_mode()
- feed()
- ff()
- fg()
- fillRectangle()
- flush()
- form()
- forward()
- getCursor()
- getCursorColor()
- getTextParams()
- getWindowSize()
- has()
- hideCursor()
- hpa()
- HPositionRelative()
- ht()
- hvp()
- HVPosition()
- ich()
- il()
- ind()
- index()
- initMouseTracking()
- input
- insertChars()
- insertColumns()
- insertLines()
- isiTerm2
- isLXDE
- isOSXTerm
- isRxvt
- isTerminator
- isVTE
- isXFCE
- isXterm
- kbs()
- key()
- left()
- lineHeight()
- linePosAbsolute()
- listen()
- loadLEDs()
- log()
- lrestoreCursor()
- lsaveCursor()
- manipulateWindow()
- mc()
- mc0()
- mc4()
- mc5()
- mc5p()
- mediaCopy()
- move()
- newline()
- nextLine()
- nl()
- normalBuffer()
- nul()
- omove()
- onceKey()
- options
- out()
- output
- p0()
- pause()
- pf()
- po()
- pos()
- print()
- print_screen()
- prtr_non()
- prtr_off()
- prtr_on()
- ps()
- rc()
- rcA()
- removeKey()
- rep()
- repeat()
- repeatPrecedingCharacter()
- req_mouse_pos()
- reqmp()
- requestAnsiMode()
- requestLocatorPosition()
- requestParameters()
- requestPrivateMode()
- reset()
- resetColors()
- resetCursor()
- resetMode()
- resetTitleModes()
- response()
- restoreCursor()
- restoreCursorA()
- restorePrivateValues()
- restoreReportedCursor
- resume
- return()
- reverse()
- reverseAttrInRectangle()
- reverseIndex()
- ri()
- right()
- rm()
- rmacs()
- rmcup()
- rmove()
- rows
- rs2()
- rsetx()
- rsety()
- saveCursor()
- saveCursorA()
- savedX
- savedY
- savePrivateValues()
- saveReportedCursor()
- sc()
- scA()
- scrollBottom
- scrollDown()
- scrollTop
- scrollUp()
- sd()
- selData()
- selectChangeExtent()
- selectiveEraseRectangle()
- sendDeviceAttributes()
- setAttrInRectangle()
- setBackground()
- setCharProtectionAttr()
- setConformanceLevel()
- setCursorStyle()
- setForeground()
- setG()
- setLocatorEvents()
- setMarginBellVolume()
- setMode()
- setMouse()
- setPointerMode()
- setResources()
- setScrollRegion()
- setTerminal()
- setTitle()
- setTitleModeFeature()
- setupDump()
- setupTput()
- setWarningBellVolume()
- setx()
- sety()
- shiftIn()
- shiftOut()
- showCursor()
- sigtstp()
- simpleInsert()
- sm()
- smacs()
- smcup()
- softReset()
- su()
- tab()
- tabClear()
- tabSet()
- tbc()
- term()
- tmux
- tmuxVersion
- type
- unKey()
- up()
- useBuffer
- vi()
- vpa()
- VPositionRelative()
- vpr()
- vtab()
- write()
- x
- y
- zero
Interfaces
Namespaces
Widgets
- ANSIImageElement
- ANSIImageOptions
- BigTextElement
- BigTextOptions
- BlessedElement
- Border
- BoxElement
- BoxOptions
- ButtonElement
- ButtonOptions
- CheckboxElement
- CheckboxOptions
- Coords
- ElementOptions
- FileManagerElement
- FileManagerOptions
- FormElement
- FormOptions
- IDestroyable
- IDestroyable
- IHasOptions
- ImageElement
- ImageOptions
- INodeOptions
- InputElement
- InputOptions
- IOptions
- IScreenOptions
- LabelOptions
- LayoutElement
- LayoutOptions
- LineElement
- LineOptions
- ListbarElement
- ListbarOptions
- ListElement
- ListElementEventType
- ListElementStyle
- ListOptions
- ListTableElement
- ListTableOptions
- LoadingElement
- LoadingOptions
- Log
- LogOptions
- MessageElement
- MessageOptions
- Node
- NodeChildProcessExecOptions
- NodeEventType
- NodeGenericEventType
- NodeMouseEventType
- NodeScreenEventType
- NodeWithEvents
- OverlayImageElement
- OverlayImageOptions
- Padding
- Position
- PositionCoords
- Program
- ProgressBarElement
- ProgressBarOptions
- PromptElement
- PromptOptions
- QuestionElement
- QuestionOptions
- RadioButtonElement
- RadioButtonOptions
- RadioSetElement
- RadioSetOptions
- Screen
- ScrollableBoxElement
- ScrollableBoxOptions
- ScrollableTextElement
- ScrollableTextOptions
- StyleListTable
- TableElement
- TableOptions
- TerminalElement
- TerminalOptions
- TextareaElement
- TextareaElementEventType
- TextareaOptions
- TextboxElement
- TextboxOptions
- TextElement
- TextOptions
- Tput
- TputsOptions
- VideoElement
- VideoOptions
Variables
variable colors
const colors: { match(hexColor: string): string };
Functions
function bigtext
bigtext: (options?: Widgets.BigTextOptions) => Widgets.BigTextElement;
function box
box: (options?: Widgets.BoxOptions) => Widgets.BoxElement;
function button
button: (options?: Widgets.ButtonOptions) => Widgets.ButtonElement;
function checkbox
checkbox: (options?: Widgets.CheckboxOptions) => Widgets.CheckboxElement;
function cleanTags
cleanTags: (text: string) => string;
function escape
escape: (text: string) => string;
function filemanager
filemanager: ( options?: Widgets.FileManagerOptions) => Widgets.FileManagerElement;
function form
form: <TFormData>( options?: Widgets.FormOptions) => Widgets.FormElement<TFormData>;
function generateTags
generateTags: (style: any, text: string) => string;
function input
input: (options?: Widgets.InputOptions) => Widgets.InputElement;
function layout
layout: (options?: Widgets.LayoutOptions) => Widgets.LayoutElement;
function line
line: (options?: Widgets.LineOptions) => Widgets.LineElement;
function list
list: ( options?: Widgets.ListOptions<Widgets.ListElementStyle>) => Widgets.ListElement;
function listbar
listbar: (options?: Widgets.ListbarOptions) => Widgets.ListbarElement;
function listtable
listtable: (options?: Widgets.ListTableOptions) => Widgets.ListTableElement;
function loading
loading: (options?: Widgets.LoadingOptions) => Widgets.LoadingElement;
function log
log: (options?: Widgets.LogOptions) => Widgets.Log;
function message
message: (options?: Widgets.MessageOptions) => Widgets.MessageElement;
function parseTags
parseTags: (text: string, screen?: Widgets.Screen) => string;
function program
program: (options?: Widgets.IScreenOptions) => BlessedProgram;
function progressbar
progressbar: ( options?: Widgets.ProgressBarOptions) => Widgets.ProgressBarElement;
function prompt
prompt: (options?: Widgets.PromptOptions) => Widgets.PromptElement;
function question
question: (options?: Widgets.QuestionOptions) => Widgets.QuestionElement;
function radiobutton
radiobutton: ( options?: Widgets.RadioButtonOptions) => Widgets.RadioButtonElement;
function radioset
radioset: (options?: Widgets.RadioSetOptions) => Widgets.RadioSetElement;
function screen
screen: (options?: Widgets.IScreenOptions) => Widgets.Screen;
function scrollablebox
scrollablebox: (options?: Widgets.BoxOptions) => Widgets.BoxElement;
function scrollabletext
scrollabletext: (options?: Widgets.BoxOptions) => Widgets.BoxElement;
function stripTags
stripTags: (text: string) => string;
function table
table: (options?: Widgets.TableOptions) => Widgets.TableElement;
function terminal
terminal: (options?: Widgets.TerminalOptions) => Widgets.TerminalElement;
function text
text: (options?: Widgets.TextOptions) => Widgets.TextElement;
function textarea
textarea: (options?: Widgets.TextareaOptions) => Widgets.TextareaElement;
function textbox
textbox: (options?: Widgets.TextboxOptions) => Widgets.TextboxElement;
Classes
class BlessedProgram
class BlessedProgram extends EventEmitter {}
constructor
constructor(options?: IBlessedProgramOptions);
property cols
cols: number;
property input
input: Readable;
property isiTerm2
isiTerm2: boolean;
property isLXDE
isLXDE: boolean;
property isOSXTerm
isOSXTerm: boolean;
property isRxvt
isRxvt: boolean;
property isTerminator
isTerminator: boolean;
property isVTE
isVTE: boolean;
property isXFCE
isXFCE: boolean;
property isXterm
isXterm: boolean;
property options
options: IBlessedProgramOptions;
property output
output: Writable;
property restoreReportedCursor
restoreReportedCursor: () => boolean;
property resume
resume: () => void;
property rows
rows: number;
property savedX
savedX: number;
property savedY
savedY: number;
property scrollBottom
scrollBottom: number;
property scrollTop
scrollTop: number;
property tmux
tmux: boolean;
property tmuxVersion
tmuxVersion: number;
property type
type: string;
property useBuffer
useBuffer: boolean;
property x
x: number;
property y
y: number;
property zero
zero: boolean;
method ae
ae: () => boolean;
method alternate
alternate: () => boolean;
method alternateBuffer
alternateBuffer: () => boolean;
method as
as: () => boolean;
method back
back: (param?: number) => boolean;
method backspace
backspace: () => boolean;
method bel
bel: () => boolean;
method bell
bell: () => boolean;
method bg
bg: (color: string, val?: boolean) => boolean;
method bindMouse
bindMouse: () => void;
method bindResponse
bindResponse: () => void;
method cbt
cbt: (param?: number) => boolean;
method cha
cha: (param?: number) => boolean;
method charAttributes
charAttributes: { (param: string, val?: boolean): boolean; (param: string[], val?: boolean): boolean;};
method charPosAbsolute
charPosAbsolute: (param?: number) => boolean;
method charset
charset: (val?: string, level?: number) => boolean;
method cht
cht: (param?: number) => boolean;
method civis
civis: () => boolean;
method clear
clear: () => boolean;
method cnl
cnl: (param?: number) => boolean;
method copyRectangle
copyRectangle: (...args: string[]) => boolean;
method copyToClipboard
copyToClipboard: (text: string) => boolean;
method cpl
cpl: (param?: number) => boolean;
method cr
cr: () => boolean;
method csr
csr: (top: number, bottom: number) => boolean;
method cub
cub: (param?: number) => boolean;
method cud
cud: (param?: number) => boolean;
method cuf
cuf: (param?: number) => boolean;
method cup
cup: (row?: number, col?: number) => boolean;
method cursor_invisible
cursor_invisible: () => boolean;
method cursorBackward
cursorBackward: (param?: number) => boolean;
method cursorBackwardTab
cursorBackwardTab: (param?: number) => boolean;
method cursorCharAbsolute
cursorCharAbsolute: (param?: number) => boolean;
method cursorColor
cursorColor: (color: string) => boolean;
method cursorDown
cursorDown: (param?: number) => boolean;
method cursorForward
cursorForward: (param?: number) => boolean;
method cursorForwardTab
cursorForwardTab: (param?: number) => boolean;
method cursorNextLine
cursorNextLine: (param?: number) => boolean;
method cursorPos
cursorPos: (row?: number, col?: number) => boolean;
method cursorPrecedingLine
cursorPrecedingLine: (param?: number) => boolean;
method cursorReset
cursorReset: () => boolean;
method cursorShape
cursorShape: (shape: string, blink?: boolean) => boolean;
method cursorUp
cursorUp: (param?: number) => boolean;
method cuu
cuu: (param?: number) => boolean;
method da
da: (param?: number, callback?: Function) => boolean;
method dch
dch: (param?: number) => boolean;
method debug
debug: () => boolean;
method deccara
deccara: (...args: string[]) => boolean;
method deccra
deccra: (...args: string[]) => boolean;
method decdc
decdc: (...args: string[]) => boolean;
method decefr
decefr: (...args: string[]) => boolean;
method decelr
decelr: (...args: string[]) => boolean;
method decera
decera: (...args: string[]) => boolean;
method decfra
decfra: (...args: string[]) => boolean;
method decic
decic: (...args: string[]) => boolean;
method decll
decll: (param?: number) => boolean;
method decrara
decrara: (...args: string[]) => boolean;
method decreqtparm
decreqtparm: (param: number) => boolean;
method decrqlp
decrqlp: (param?: string, callback?: Function) => boolean;
method decrqm
decrqm: (param?: number) => boolean;
method decrqmp
decrqmp: (param?: number) => boolean;
method decrst
decrst: (...args: string[]) => boolean;
method decsace
decsace: (param?: number) => boolean;
method decsca
decsca: (param?: number) => boolean;
method decscl
decscl: (...args: string[]) => boolean;
method decscursr
decscursr: (param?: string) => boolean;
method decsera
decsera: (...args: string[]) => boolean;
method decset
decset: (...args: string[]) => boolean;
method decsle
decsle: (...args: string[]) => boolean;
method decstbm
decstbm: (top: number, bottom: number) => boolean;
method decstr
decstr: () => boolean;
method decswbv
decswbv: (param?: number) => boolean;
method dectcemh
dectcemh: () => boolean;
method deleteChars
deleteChars: (param?: number) => boolean;
method deleteColumns
deleteColumns: (...args: string[]) => boolean;
method deleteLines
deleteLines: (param?: number) => boolean;
method destroy
destroy: () => void;
method deviceStatuses
deviceStatuses: ( param?: string, callback?: Function, dec?: boolean, noBypass?: boolean) => boolean;
method disableGpm
disableGpm: () => void;
method disableModifieres
disableModifieres: (...args: string[]) => boolean;
method disableMouse
disableMouse: () => void;
method dl
dl: (param?: number) => boolean;
method down
down: (param?: number) => boolean;
method dsr
dsr: ( param?: string, callback?: Function, dec?: boolean, noBypass?: boolean) => boolean;
method dynamicColors
dynamicColors: (param?: string) => boolean;
method ech
ech: (param?: number) => boolean;
method echo
echo: (text: string, attr?: boolean) => boolean;
method ed
ed: (param?: string) => boolean;
method el
el: (param?: string) => boolean;
method enableFilterRectangle
enableFilterRectangle: (...args: string[]) => boolean;
method enableGpm
enableGpm: () => void;
method enableLocatorReporting
enableLocatorReporting: (...args: string[]) => boolean;
method enableMouse
enableMouse: () => void;
method enter_alt_charset_mode
enter_alt_charset_mode: () => boolean;
method eraseChars
eraseChars: (param?: number) => boolean;
method eraseInDisplay
eraseInDisplay: (param?: string) => boolean;
method eraseInLine
eraseInLine: (param?: string) => boolean;
method eraseRectangle
eraseRectangle: (...args: string[]) => boolean;
method exit_alt_charset_mode
exit_alt_charset_mode: () => boolean;
method feed
feed: () => boolean;
method ff
ff: () => boolean;
method fg
fg: (color: string, val?: boolean) => boolean;
method fillRectangle
fillRectangle: (...args: string[]) => boolean;
method flush
flush: () => void;
method form
form: () => boolean;
method forward
forward: (param?: number) => boolean;
method getCursor
getCursor: (callback: Function) => boolean;
method getCursorColor
getCursorColor: (callback: Function) => boolean;
method getTextParams
getTextParams: (param: string, callback: Function) => boolean;
method getWindowSize
getWindowSize: (callback?: Function) => boolean;
method has
has: (name: string) => boolean;
method hideCursor
hideCursor: () => boolean;
method hpa
hpa: (param?: number) => boolean;
method HPositionRelative
HPositionRelative: (param?: number) => boolean;
method ht
ht: () => boolean;
method hvp
hvp: (row?: number, col?: number) => boolean;
method HVPosition
HVPosition: (row?: number, col?: number) => boolean;
method ich
ich: (param?: number) => boolean;
method il
il: (param?: number) => boolean;
method ind
ind: () => boolean;
method index
index: () => boolean;
method initMouseTracking
initMouseTracking: (...args: string[]) => boolean;
method insertChars
insertChars: (param?: number) => boolean;
method insertColumns
insertColumns: (...args: string[]) => boolean;
method insertLines
insertLines: (param?: number) => boolean;
method kbs
kbs: () => boolean;
method key
key: (key: string | string[], listener: Function) => void;
method left
left: (param?: number) => boolean;
method lineHeight
lineHeight: () => boolean;
method linePosAbsolute
linePosAbsolute: (param?: number) => boolean;
method listen
listen: () => void;
method loadLEDs
loadLEDs: (param?: number) => boolean;
method log
log: () => boolean;
method lrestoreCursor
lrestoreCursor: (key?: string, hide?: boolean) => void;
method lsaveCursor
lsaveCursor: (key?: string) => void;
method manipulateWindow
manipulateWindow: (...args: any[]) => boolean;
method mc
mc: (...args: string[]) => boolean;
method mc0
mc0: () => boolean;
method mc4
mc4: () => boolean;
method mc5
mc5: () => boolean;
method mc5p
mc5p: () => boolean;
method mediaCopy
mediaCopy: (...args: string[]) => boolean;
method move
move: (x: number, y: number) => boolean;
method newline
newline: () => boolean;
method nextLine
nextLine: () => boolean;
method nl
nl: () => boolean;
method normalBuffer
normalBuffer: () => boolean;
method nul
nul: () => boolean;
method omove
omove: (x: number, y: number) => void;
method onceKey
onceKey: (key: string | string[], listener: Function) => void;
method out
out: (param: string, ...args: any[]) => boolean;
method p0
p0: () => boolean;
method pause
pause: (callback?: Function) => Function;
method pf
pf: () => boolean;
method po
po: () => boolean;
method pos
pos: (row?: number, col?: number) => boolean;
method print
print: (text: string, attr?: boolean) => boolean;
method print_screen
print_screen: () => boolean;
method prtr_non
prtr_non: () => boolean;
method prtr_off
prtr_off: () => boolean;
method prtr_on
prtr_on: () => boolean;
method ps
ps: () => boolean;
method rc
rc: (key?: string, hide?: boolean) => boolean;
method rcA
rcA: () => boolean;
method removeKey
removeKey: (key: string | string[], listener: Function) => void;
method rep
rep: (param?: number) => boolean;
method repeat
repeat: (ch: string, i?: number) => string;
method repeatPrecedingCharacter
repeatPrecedingCharacter: (param?: number) => boolean;
method req_mouse_pos
req_mouse_pos: (param?: string, callback?: Function) => boolean;
method reqmp
reqmp: (param?: string, callback?: Function) => boolean;
method requestAnsiMode
requestAnsiMode: (param?: number) => boolean;
method requestLocatorPosition
requestLocatorPosition: (param?: string, callback?: Function) => boolean;
method requestParameters
requestParameters: (param?: number) => boolean;
method requestPrivateMode
requestPrivateMode: (param?: number) => boolean;
method reset
reset: () => boolean;
method resetColors
resetColors: (param?: string) => boolean;
method resetCursor
resetCursor: () => boolean;
method resetMode
resetMode: (...args: string[]) => boolean;
method resetTitleModes
resetTitleModes: (...args: string[]) => boolean;
method response
response: { ( name: string, text: string, callback: Function, noBypass?: boolean ): boolean; (name: string, callback?: Function): boolean;};
method restoreCursor
restoreCursor: (key?: string, hide?: boolean) => boolean;
method restoreCursorA
restoreCursorA: () => boolean;
method restorePrivateValues
restorePrivateValues: (...args: string[]) => boolean;
method return
return: () => boolean;
method reverse
reverse: () => boolean;
method reverseAttrInRectangle
reverseAttrInRectangle: (...args: string[]) => boolean;
method reverseIndex
reverseIndex: () => boolean;
method ri
ri: () => boolean;
method right
right: (param?: number) => boolean;
method rm
rm: (...args: string[]) => boolean;
method rmacs
rmacs: () => boolean;
method rmcup
rmcup: () => boolean;
method rmove
rmove: (x: number, y: number) => void;
method rs2
rs2: () => boolean;
method rsetx
rsetx: (x: number) => boolean;
method rsety
rsety: (y: number) => boolean;
method saveCursor
saveCursor: (key: string) => boolean;
method saveCursorA
saveCursorA: () => boolean;
method savePrivateValues
savePrivateValues: (...args: string[]) => boolean;
method saveReportedCursor
saveReportedCursor: (callback: Function) => void;
method sc
sc: (key: string) => boolean;
method scA
scA: () => boolean;
method scrollDown
scrollDown: (param?: number) => boolean;
method scrollUp
scrollUp: (param?: number) => boolean;
method sd
sd: (param?: number) => boolean;
method selData
selData: (a: string, b: string) => boolean;
method selectChangeExtent
selectChangeExtent: (param?: number) => boolean;
method selectiveEraseRectangle
selectiveEraseRectangle: (...args: string[]) => boolean;
method sendDeviceAttributes
sendDeviceAttributes: (param?: number, callback?: Function) => boolean;
method setAttrInRectangle
setAttrInRectangle: (...args: string[]) => boolean;
method setBackground
setBackground: (color: string, val?: boolean) => boolean;
method setCharProtectionAttr
setCharProtectionAttr: (param?: number) => boolean;
method setConformanceLevel
setConformanceLevel: (...args: string[]) => boolean;
method setCursorStyle
setCursorStyle: (param?: string) => boolean;
method setForeground
setForeground: (color: string, val?: boolean) => boolean;
method setG
setG: (val: number) => boolean;
method setLocatorEvents
setLocatorEvents: (...args: string[]) => boolean;
method setMarginBellVolume
setMarginBellVolume: (param?: number) => boolean;
method setMode
setMode: (...args: string[]) => boolean;
method setMouse
setMouse: (opt?: {}, enable?: boolean) => void;
method setPointerMode
setPointerMode: (...args: string[]) => boolean;
method setResources
setResources: (...args: string[]) => boolean;
method setScrollRegion
setScrollRegion: (top: number, bottom: number) => boolean;
method setTerminal
setTerminal: (terminal: string) => void;
method setTitle
setTitle: (title: string) => boolean;
method setTitleModeFeature
setTitleModeFeature: (...args: string[]) => boolean;
method setupDump
setupDump: () => void;
method setupTput
setupTput: () => void;
method setWarningBellVolume
setWarningBellVolume: (param?: number) => boolean;
method setx
setx: (x: number) => boolean;
method sety
sety: (y: number) => boolean;
method shiftIn
shiftIn: () => boolean;
method shiftOut
shiftOut: () => boolean;
method showCursor
showCursor: () => boolean;
method sigtstp
sigtstp: (callback?: Function) => boolean;
method simpleInsert
simpleInsert: (ch: string, i?: number, attr?: boolean) => boolean;
method sm
sm: (...args: string[]) => boolean;
method smacs
smacs: () => boolean;
method smcup
smcup: () => boolean;
method softReset
softReset: () => boolean;
method su
su: (param?: number) => boolean;
method tab
tab: () => boolean;
method tabClear
tabClear: (param?: number) => boolean;
method tabSet
tabSet: () => boolean;
method tbc
tbc: (param?: number) => boolean;
method term
term: (is: string) => boolean;
method unKey
unKey: (key: string | string[], listener: Function) => void;
method up
up: (param?: number) => boolean;
method vi
vi: () => boolean;
method vpa
vpa: (param?: number) => boolean;
method VPositionRelative
VPositionRelative: (param?: number) => boolean;
method vpr
vpr: (param?: number) => boolean;
method vtab
vtab: () => boolean;
method write
write: (text: string) => boolean;
Interfaces
interface IBlessedProgramOptions
interface IBlessedProgramOptions {}
property buffer
buffer?: boolean | undefined;
property debug
debug?: boolean | undefined;
property dump
dump?: boolean | undefined;
property input
input?: Readable | undefined;
property log
log?: string | undefined;
property output
output?: Writable | undefined;
property resizeTimeout
resizeTimeout?: boolean | undefined;
property term
term?: string | undefined;
property terminal
terminal?: string | undefined;
property tput
tput?: string | undefined;
property zero
zero?: boolean | undefined;
Namespaces
namespace Widgets
namespace Widgets {}
class ANSIImageElement
class ANSIImageElement extends BoxElement implements IHasOptions<ANSIImageOptions> {}
Convert any .png file (or .gif, see below) to an ANSI image and display it as an element.
constructor
constructor(options?: ANSIImageOptions);
property img
img: Types.TImage;
Image object from the png reader.
property options
options: ANSIImageOptions;
method clearImage
clearImage: (callback: () => void) => void;
clear the current image.
method pause
pause: () => void;
Pause animation.
method play
play: () => void;
Play animation if it has been paused or stopped.
method setImage
setImage: (img: string, callback: () => void) => void;
set the image in the box to a new path.
method stop
stop: () => void;
Stop animation.
class BigTextElement
class BigTextElement extends BoxElement implements IHasOptions<BigTextOptions> {}
A box which can render content drawn as 8x14 cell characters using the terminus font.
constructor
constructor(opts: BigTextOptions);
property options
options: BigTextOptions;
Original options object.
class BlessedElement
abstract class BlessedElement extends NodeWithEvents implements IHasOptions<ElementOptions> {}
constructor
constructor(opts: ElementOptions);
property abottom
abottom: Types.TPosition;
Calculated absolute bottom offset.
property aleft
aleft: Types.TTopLeft;
Calculated absolute left offset.
property aright
aright: Types.TPosition;
Calculated absolute right offset.
property atop
atop: Types.TTopLeft;
Calculated absolute top offset.
property bg
bg: number;
Border foreground and background, must be numbers (-1 for default).
property bold
bold: string;
Border attributes.
property border
border: Border;
Border object.
property bottom
bottom: Types.TPosition;
Calculated relative bottom offset.
property content
content: string;
property detached
detached: boolean;
property draggable
draggable: boolean;
Whether the element is draggable. Set to true to allow dragging.
property fg
fg: number;
property height
height: string | number;
Calculated height.
property hidden
hidden: boolean;
property iheight
iheight: Types.TPosition;
property ileft
ileft: Types.TTopLeft;
property itop
itop: Types.TTopLeft;
property iwidth
iwidth: Types.TPosition;
property left
left: Types.TTopLeft;
Calculated relative left offset.
property lpos
lpos: PositionCoords;
property name
name: string;
Name of the element. Useful for form submission.
property options
options: ElementOptions;
Original options object.
property position
position: Position;
property rbottom
rbottom: Types.TPosition;
Calculated relative bottom offset.
property right
right: Types.TPosition;
Calculated relative right offset.
property rleft
rleft: Types.TTopLeft;
Calculated relative left offset.
property rright
rright: Types.TPosition;
Calculated relative right offset.
property rtop
rtop: Types.TTopLeft;
Calculated relative top offset.
property style
style: any;
property top
top: Types.TTopLeft;
Calculated relative top offset.
property underline
underline: string;
property visible
visible: boolean;
property width
width: string | number;
Calculated width.
method clearBaseLine
clearBaseLine: (i: number) => void;
Clear a line from the box's content from the visible top.
method clearLine
clearLine: (i: number) => void;
Clear a line from the box's content.
method deleteBottom
deleteBottom: () => void;
Delete a line at the bottom of the box.
method deleteLine
deleteLine: (i: number) => void;
Delete a line from the box's content.
method deleteTop
deleteTop: () => void;
Delete a line at the top of the box.
method destroy
destroy: () => void;
Same as the detach() method, except this will automatically call free() and unbind any screen events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free().
method disableDrag
disableDrag: () => void;
Disable dragging of the element.
method enableDrag
enableDrag: () => void;
Enable dragging of the element.
method enableInput
enableInput: () => void;
Enable key and mouse events. Calls both
enableMouse()
andenableKeys()
.
method enableKeys
enableKeys: () => void;
Enable keypress events for the element (automatically called when a form of on('keypress') is bound).
method enableMouse
enableMouse: () => void;
Enable mouse events for the element (automatically called when a form of on('mouse') is bound).
method focus
focus: () => void;
Focus element.
method free
free: () => void;
Free up the element. Automatically unbind all events that may have been bound to the screen object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), and destroy().
method getBaseLine
getBaseLine: (i: number) => string;
Get a line from the box's content from the visible top.
method getContent
getContent: () => string;
Return content, slightly different from el.content. Assume the above formatting.
method getLine
getLine: (i: number) => string;
Get a line from the box's content.
method getLines
getLines: () => string[];
An array containing the content lines.
method getScreenLines
getScreenLines: () => string[];
An array containing the lines as they are displayed on the screen.
method getText
getText: () => string;
Similar to getContent, but return content with tags and escape codes removed.
method hide
hide: () => void;
Hide element.
method insertBottom
insertBottom: (lines: string | string[]) => void;
Insert a line at the bottom of the box.
method insertLine
insertLine: (i: number, lines: string | string[]) => void;
Insert a line into the box's content.
method insertTop
insertTop: (lines: string | string[]) => void;
Insert a line at the top of the box.
method onScreenEvent
onScreenEvent: (type: string, handler: (...args: any[]) => void) => void;
Same asel.on('screen', ...) except this will automatically keep track of which listeners are bound to the screen object. For use with removeScreenEvent(), free(), and destroy().
method popLine
popLine: (i: number) => string;
Pop a line off the bottom of the content.
method pushLine
pushLine: (lines: string | string[]) => void;
Push a line onto the bottom of the content.
method removeHover
removeHover: () => void;
Remove the hover label completely.
method removeLabel
removeLabel: () => any;
Remove the label completely.
method removeScreenEvent
removeScreenEvent: (type: string, handler: (...args: any[]) => void) => void;
Same asel.removeListener('screen', ...) except this will automatically keep track of which listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy().
method render
render: () => Coords;
Write content and children to the screen buffer.
method screenshot
screenshot: { (xi: number, xl: number, yi: number, yl: number): string; (): void;};
Take an SGR screenshot of the screen within the region. Returns a string containing only characters and SGR codes. Can be displayed by simply echoing it in a terminal.
method setBack
setBack: () => void;
Put the element in back of its siblings.
method setBaseLine
setBaseLine: (i: number, line: string | string[]) => void;
Set a line in the box's content from the visible top.
method setContent
setContent: (text: string) => void;
Set the content. Note: When text is input, it will be stripped of all non-SGR escape codes, tabs will be replaced with 8 spaces, and tags will be replaced with SGR codes (if enabled).
method setFront
setFront: () => void;
Put the element in front of its siblings.
method setHover
setHover: (arg: string | LabelOptions) => void;
text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute in the browser. Example options: {text:'foo'}
method setIndex
setIndex: (z: number) => void;
Set the z-index of the element (changes rendering order).
method setLabel
setLabel: (arg: string | LabelOptions) => void;
text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'}
method setLine
setLine: (i: number, line: string | string[]) => void;
Set a line in the box's content.
method setText
setText: (text: string) => void;
Similar to setContent, but ignore tags and remove escape codes.
method shiftLine
shiftLine: (i: number) => void;
Shift a line off the top of the content.
method show
show: () => void;
Show element.
method strWidth
strWidth: (text: string) => string;
Get a string's displayed width, taking into account double-width, surrogate pairs, combining characters, tags, and SGR escape codes.
method toggle
toggle: () => void;
Toggle hidden/shown.
method unshiftLine
unshiftLine: (lines: string | string[]) => void;
Unshift a line onto the top of the content.
class BoxElement
class BoxElement extends ScrollableTextElement implements IHasOptions<BoxOptions> {}
A box element which draws a simple box containing content or other elements.
constructor
constructor(opts: BoxOptions);
property options
options: BoxOptions;
Original options object.
class ButtonElement
class ButtonElement extends InputElement implements IHasOptions<ButtonOptions> {}
constructor
constructor(opts: ButtonOptions);
property options
options: ButtonOptions;
Original options object.
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: 'press', callback: () => void): this;};
method press
press: () => void;
Press button. Emits press.
class CheckboxElement
class CheckboxElement extends InputElement implements IHasOptions<CheckboxOptions> {}
A checkbox which can be used in a form element.
constructor
constructor(options?: CheckboxOptions);
property checked
checked: boolean;
whether the element is checked or not.
property options
options: CheckboxOptions;
Original options object.
property text
text: string;
the text next to the checkbox (do not use setcontent, use
check.text = ''
).
property value
value: boolean;
same as
checked
.
method check
check: () => void;
check the element.
method toggle
toggle: () => void;
toggle checked state.
method uncheck
uncheck: () => void;
uncheck the element.
class FileManagerElement
class FileManagerElement extends ListElement implements IHasOptions<FileManagerOptions> {}
constructor
constructor(opts: FileManagerOptions);
property cwd
cwd: string;
Current working directory.
property options
options: FileManagerOptions;
Original options object.
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: 'cd', callback: (file: string, cwd: string) => void): this; (event: 'file', callback: (file: string) => void): this; (event: 'error', callback: (err: any, file: string) => void): this; (event: 'refresh', callback: () => void): this;};
Received when an item is selected.
method pick
pick: { (cwd: string, callback: () => void): void; (callback: () => void): void;};
Pick a single file and return the path in the callback.
method refresh
refresh: { (cwd: string, callback: () => void): void; (callback?: () => void): void;};
Refresh the file list (perform a readdir on cwd and update the list items).
method reset
reset: { (cwd: string, callback: () => void): void; (callback?: () => void): void;};
Reset back to original cwd.
class FormElement
class FormElement<TFormData> extends BoxElement implements IHasOptions<FormOptions> {}
constructor
constructor(opts: FormOptions);
property options
options: FormOptions;
Original options object.
property submission
submission: {};
Last submitted data.
method cancel
cancel: () => void;
Discard the form.
method focusNext
focusNext: () => void;
Focus next form element.
method focusPrevious
focusPrevious: () => void;
Focus previous form element.
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: 'submit', callback: (out: TFormData) => void): this; (event: 'cancel' | 'reset', callback: () => void): this;};
Form is submitted. Receives a data object.
method reset
reset: () => void;
Clear the form.
method submit
submit: () => void;
Submit the form.
class ImageElement
class ImageElement extends BoxElement implements IHasOptions<ImageOptions> {}
Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals.
constructor
constructor(options?: ImageOptions);
property options
options: ImageOptions;
class InputElement
abstract class InputElement extends BoxElement {}
constructor
constructor(opts: InputOptions);
class LayoutElement
class LayoutElement extends BlessedElement implements IHasOptions<LayoutOptions> {}
constructor
constructor(options?: LayoutOptions);
property options
options: LayoutOptions;
method getLast
getLast: (i: number) => BlessedElement;
Get the last rendered and visible child element based on an index. This is useful for basing the position of the current child element on the position of the last child element.
method getLastCoords
getLastCoords: (i: number) => PositionCoords;
Get the last rendered and visible child element coords based on an index. This is useful for basing the position of the current child element on the position of the last child element. See the example below.
method isRendered
isRendered: (el: BlessedElement) => boolean;
Check to see if a previous child element has been rendered and is visible on screen. This is only useful for checking child elements that have already been attempted to be rendered! see the example below.
method renderer
renderer: (coords: PositionCoords) => void;
A callback which is called right before the children are iterated over to be rendered. Should return an iterator callback which is called on each child element: iterator(el, i).
class LineElement
class LineElement extends BoxElement implements IHasOptions<LineOptions> {}
A simple line which can be line or bg styled.
constructor
constructor(opts: LineOptions);
property options
options: LineOptions;
Original options object.
class ListbarElement
class ListbarElement extends BoxElement implements IHasOptions<ListbarOptions> {}
constructor
constructor(opts: ListbarOptions);
property options
options: ListbarOptions;
Original options object.
method add
add: (item: Types.ListbarCommand, callback: () => void) => void;
Append an item to the bar.
method addItem
addItem: (item: Types.ListbarCommand, callback: () => void) => void;
Append an item to the bar.
method appendItem
appendItem: (item: Types.ListbarCommand, callback: () => void) => void;
Append an item to the bar.
method move
move: (offset: number) => void;
Move relatively across the bar.
method moveLeft
moveLeft: (offset: number) => void;
Move left relatively across the bar.
method moveRight
moveRight: (offset: number) => void;
Move right relatively across the bar.
method on
on: { (event: string, listener: (...args: any[]) => void): this; ( event: 'remove item' | 'set items' | 'select tab', callback: () => void ): this;};
method removeItem
removeItem: (child: BlessedElement) => void;
Remove item from the bar.
method select
select: (offset: number) => void;
Select an item on the bar.
method selectTab
selectTab: (index: number) => void;
Select button and execute its callback.
method setItems
setItems: (commands: Types.ListbarCommand[]) => void;
Set commands (see commands option above).
class ListElement
class ListElement extends BoxElement implements IHasOptions<ListOptions<ListElementStyle>> {}
constructor
constructor(opts: ListOptions<ListElementStyle>);
property options
options: ListOptions<ListElementStyle>;
Original options object.
method add
add: (text: string) => void;
Add an item based on a string.
method addItem
addItem: (text: string) => void;
Add an item based on a string.
method clearItems
clearItems: () => void;
Clears all items from the list.
method down
down: (amount: number) => void;
Select item below selected.
method fuzzyFind
fuzzyFind: (arg: string | RegExp | (() => void)) => void;
Find an item based on its text content.
method getItem
getItem: (child: BlessedElement | number | string) => BlessedElement;
Returns the item element. Child can be an element, index, or string.
method getItemIndex
getItemIndex: (child: BlessedElement | number | string) => number;
Returns the item index from the list. Child can be an element, index, or string.
method insertItem
insertItem: (i: number, child: BlessedElement | number | string) => void;
Inserts an item to the list. Child can be an element, index, or string.
method move
move: (offset: number) => void;
Select item based on current offset.
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: 'select', callback: (item: BoxElement, index: number) => void): this; (event: ListElementEventType, callback: () => void): this; ( event: 'select item', callback: (item: BlessedElement, index: number) => void ): this;};
Received when an item is selected.
method pick
pick: (callback: () => void) => void;
Show/focus list and pick an item. The callback is executed with the result.
method popItem
popItem: () => BlessedElement;
Pop an item off the list.
method pushItem
pushItem: (child: BlessedElement) => number;
Push an item onto the list.
method removeItem
removeItem: (child: BlessedElement | number | string) => BlessedElement;
Removes an item from the list. Child can be an element, index, or string.
method select
select: (index: number) => void;
Select an index of an item.
method setItem
setItem: (child: BlessedElement, content: BlessedElement | string) => void;
Set item to content.
method setItems
setItems: (items: BlessedElement[] | string[]) => void;
Sets the list items to multiple strings.
method shiftItem
shiftItem: () => BlessedElement;
Shift an item off the list.
method spliceItem
spliceItem: (i: number, n: number, ...items: BlessedElement[]) => void;
Remove and insert items to the list.
method unshiftItem
unshiftItem: (child: BlessedElement) => number;
Unshift an item onto the list.
method up
up: (amount: number) => void;
Select item above selected.
class ListTableElement
class ListTableElement extends ListElement implements IHasOptions<ListTableOptions> {}
constructor
constructor(opts: ListTableOptions);
property options
options: ListTableOptions;
Original options object.
method setData
setData: (rows: string[][]) => void;
Set rows in table. Array of arrays of strings.
Example 1
table.setData([ [ 'Animals', 'Foods' ], [ 'Elephant', 'Apple' ], [ 'Bird', 'Orange' ] ]);
method setRows
setRows: (rows: string[][]) => void;
Set rows in table. Array of arrays of strings.
Example 1
table.setData([ [ 'Animals', 'Foods' ], [ 'Elephant', 'Apple' ], [ 'Bird', 'Orange' ] ]);
class LoadingElement
class LoadingElement extends BoxElement implements IHasOptions<LoadingOptions> {}
A box with a spinning line to denote loading (automatically hidden).
constructor
constructor(opts: LoadingOptions);
property options
options: LoadingOptions;
method load
load: (text: string) => void;
Display the loading box with a message. Will lock keys until stop is called.
method stop
stop: () => void;
Hide loading box. Unlock keys.
class Log
class Log extends ScrollableTextElement implements IHasOptions<LogOptions> {}
A log permanently scrolled to the bottom.
constructor
constructor(options?: LogOptions);
property options
options: LogOptions;
property scrollback
scrollback: number;
amount of scrollback allowed. default: Infinity.
property scrollOnInput
scrollOnInput: boolean;
scroll to bottom on input even if the user has scrolled up. default: false.
method add
add: (text: string) => void;
add a log line.
method log
log: (text: string) => void;
add a log line.
class MessageElement
class MessageElement extends BoxElement implements IHasOptions<MessageOptions> {}
A box containing a message to be displayed (automatically hidden).
constructor
constructor(opts: MessageOptions);
property options
options: MessageOptions;
method display
display: { (text: string, time: number, callback: (err: any) => void): void; (text: string, callback: (err: any) => void): void;};
method error
error: { (text: string, time: number, callback: () => void): void; (text: string, callback: () => void): void;};
Display an error in the same way.
method log
log: { (text: string, time: number, callback: (err: any) => void): void; (text: string, callback: (err: any) => void): void;};
Display a message for a time (default is 3 seconds). Set time to 0 for a perpetual message that is dismissed on keypress.
class Node
abstract class Node extends EventEmitter implements IHasOptions<INodeOptions>, IDestroyable {}
constructor
constructor(options: INodeOptions);
property $
$: { [index: string]: any };
An object for any miscellanous user data.
property children
children: Node[];
Array of node's children.
property data
data: { [index: string]: any };
An object for any miscellanous user data.
property focusable
focusable: boolean;
property index
index: number;
Render index (document order index) of the last render call.
property options
options: INodeOptions;
Original options object.
property parent
parent: Node;
Parent node.
property screen
screen: Screen;
Parent screen.
property type
type: string;
Type of the node (e.g. box).
method append
append: (node: Node) => void;
Append a node to this node's children.
method collectAncestors
collectAncestors: (s: any) => void;
method collectDescendants
collectDescendants: (s: any) => void;
method destroy
destroy: () => void;
method detach
detach: () => void;
Remove node from its parent.
method emitAncestors
emitAncestors: () => void;
method emitDescendants
emitDescendants: (type?: string, ...args: any[]) => void;
Emit event for element, and recursively emit same event for all descendants.
method forAncestors
forAncestors: (iter: (node: Node) => void, s: any) => void;
method forDescendants
forDescendants: (iter: (node: Node) => void, s: any) => void;
method free
free: () => void;
method get
get: <T>(name: string, def: T) => T;
Get user property with a potential default value.
method hasAncestor
hasAncestor: (target: Node) => boolean;
method hasDescendant
hasDescendant: (target: Node) => void;
method insert
insert: (node: Node, index: number) => void;
Insert a node to this node's children at index i.
method insertAfter
insertAfter: (node: Node, refNode: Node) => void;
Insert a node from node after the reference node.
method insertBefore
insertBefore: (node: Node, refNode: Node) => void;
Insert a node to this node's children before the reference node.
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: NodeEventType, callback: (arg: Node) => void): this;};
method prepend
prepend: (node: Node) => void;
Prepend a node to this node's children.
method remove
remove: (node: Node) => void;
Remove child node from node.
method set
set: (name: string, value: any) => void;
Set user property to value.
class NodeWithEvents
class NodeWithEvents extends Node {}
method key
key: ( name: string | string[], listener: (ch: any, key: Events.IKeyEventArg) => void) => void;
Bind a keypress listener for a specific key.
method on
on: { (event: string, listener: (ch: any, key: Events.IKeyEventArg) => void): this; ( event: NodeMouseEventType, callback: (arg: Events.IMouseEventArg) => void ): this; ( event: 'keypress', callback: (ch: string, key: Events.IKeyEventArg) => void ): this; (event: NodeScreenEventType, callback: (arg: Screen) => void): this; (event: 'warning', callback: (text: string) => void): this; (event: NodeGenericEventType, callback: () => void): this;};
Received on mouse events.
Received on key events.
Received when blessed notices something untoward (output is not a tty, terminfo not found, etc).
method onceKey
onceKey: ( name: string, listener: (ch: any, key: Events.IKeyEventArg) => void) => void;
Bind a keypress listener for a specific key once.
method removeKey
removeKey: ( name: string, listener: (ch: any, key: Events.IKeyEventArg) => void) => void;
method unkey
unkey: ( name: string, listener: (ch: any, key: Events.IKeyEventArg) => void) => void;
Remove a keypress listener for a specific key.
class OverlayImageElement
class OverlayImageElement extends BoxElement implements IHasOptions<OverlayImageOptions> {}
Convert any .png file (or .gif, see below) to an ANSI image and display it as an element.
constructor
constructor(options?: OverlayImageOptions);
property options
options: OverlayImageOptions;
method clearImage
clearImage: (callback: () => void) => void;
clear the current image.
method getPixelRatio
getPixelRatio: (callback: () => void) => void;
get the pixel to cell ratio for the terminal.
method imageSize
imageSize: (img: string, callback: () => void) => void;
get the size of an image file in pixels.
method setImage
setImage: (img: string, callback: () => void) => void;
set the image in the box to a new path.
method termSize
termSize: (callback: () => void) => void;
get the size of the terminal in pixels.
class PositionCoords
class PositionCoords {}
class Program
class Program {}
method text
text: (text: string, attr: string) => string;
Wrap the given text in terminal formatting codes corresponding to the given attribute name. The
attr
string can be of the formred fg
or52 bg
where52
is a 0-255 integer color number.
class ProgressBarElement
class ProgressBarElement extends InputElement implements IHasOptions<ProgressBarOptions> {}
A progress bar allowing various styles. This can also be used as a form input.
constructor
constructor(options?: ProgressBarOptions);
property options
options: ProgressBarOptions;
method on
on: { (event: string, listener: (...args: any[]) => void): this; (event: 'reset' | 'complete', callback: () => void): this;};
method progress
progress: (amount: number) => void;
progress the bar by a fill amount.