forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblessed.d.ts
2834 lines (2593 loc) · 100 KB
/
blessed.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for blessed 0.1.81
// Project: https://github.com/chjj/blessed
// Definitions by: bryn austin bellomy <https://github.com/brynbellomy>, Diullei Gomes <https://github.com/diullei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "blessed" {
import {EventEmitter} from 'events';
import * as stream from "stream"
import * as child_process from "child_process";
export class BlessedProgram {
hideCursor: () => void;
move: any;
showCursor: any;
}
export module Widgets {
export module Types {
export type TTopLeft = string | number | "center";
export type TPosition = string | number;
export type TMouseAction = "mousedown" | "mouseup" | "mousemove";
export type TStyle = {
type?: string;
bg?: string;
fg?: string;
ch?: string;
bold?: boolean;
underline?: boolean;
blink?: boolean;
inverse?: boolean;
invisible?: boolean;
transparent?: boolean;
border?: "line" | "bg" | TBorder;
hover?: boolean;
focus?: boolean;
label?: string;
track?: {bg?: string; fg?: string;};
scrollbar?: {bg?: string; fg?: string;};
}
export type TBorder = {
/**
* Type of border (line or bg). bg by default.
*/
type?: "line" | "bg";
/**
* Character to use if bg type, default is space.
*/
ch?: string;
/**
* Border foreground and background, must be numbers (-1 for default).
*/
bg?: number;
fg?: number;
/**
* Border attributes.
*/
bold?: string;
underline?: string;
}
export type TCursor = {
/**
* Have blessed draw a custom cursor and hide the terminal cursor (experimental).
*/
artificial: boolean;
/**
* Shape of the cursor. Can be: block, underline, or line.
*/
shape: boolean;
/**
* Whether the cursor blinks.
*/
blink: boolean;
/**
* Color of the color. Accepts any valid color value (null is default).
*/
color: string;
}
export type TAlign = "left" | "center" | "right";
export type ListbarCommand = {
key: string;
callback: () => void;
};
export type TImage = {
/**
* Pixel width.
*/
width: number;
/**
* Pixel height.
*/
height: number;
/**
* Image bitmap.
* */
bmp: any;
/**
* Image cellmap (bitmap scaled down to cell size).
*/
cellmap: any;
};
export type Cursor = {
/**
* Have blessed draw a custom cursor and hide the terminal cursor (experimental).
*/
artificial: boolean;
/**
* Shape of the cursor. Can be: block, underline, or line.
*/
shape: boolean;
/**
* Whether the cursor blinks.
*/
blink: boolean;
/**
* Color of the color. Accepts any valid color value (null is default).
*/
color: string;
}
}
export module Events {
export interface IMouseEventArg {
x: number;
y: number;
action: Types.TMouseAction;
}
export interface IKeyEventArg {
full: string;
name: string;
shift: boolean;
ctrl: boolean;
meta: boolean;
sequence: string;
}
}
export interface NodeChildProcessExecOptions {
cwd?: string;
stdio?: any;
customFds?: any;
env?: any;
encoding?: string;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
}
export interface IDestroyable {
destroy(): void;
}
export interface IOptions {
}
export interface IHasOptions<T extends IOptions> {
options: T;
}
export interface TputsOptions extends IOptions {
terminal?: string;
extended?: boolean;
debug?: boolean;
termcap?: string;
terminfoFile?: string;
terminfoPrefix?: string;
termcapFile?: string;
}
export class Tput implements IHasOptions<TputsOptions> {
constructor(opts: TputsOptions);
// ** properties ** //
/**
* Original options object.
*/
options: TputsOptions;
debug: boolean;
padding: boolean;
extended: boolean;
printf: boolean;
termcap: string;
terminfoPrefix: string;
terminfoFile: string;
termcapFile: string;
error: Error;
terminal: string;
setup(): void;
term(is: any): boolean;
readTerminfo(term: string): string;
parseTerminfo(data: any, file: string): {
header: {
dataSize: number;
headerSize: number;
magicNumber: boolean;
namesSize: number;
boolCount: number;
numCount: number;
strCount: number;
strTableSize: number;
extended: {
dataSize: number;
headerSize: number;
boolCount: number;
numCount: number;
strCount: number;
strTableSize: number;
lastStrTableOffset: number;
}
}
name: string;
names: string[];
desc: string;
bools: Object;
numbers: Object;
strings: Object;
};
}
export interface IDestroyable {
destroy(): void;
}
export interface INodeOptions extends IOptions {
name?: string;
screen?: Screen;
parent?: Node;
children?: Node[];
focusable?: boolean;
}
export abstract class Node extends EventEmitter implements IHasOptions<INodeOptions>, IDestroyable {
constructor(options: INodeOptions);
// ** properties ** //
focusable: boolean;
/**
* Original options object.
*/
options: INodeOptions;
/**
* An object for any miscellanous user data.
*/
data: {[index: string]: any;};
/**
* An object for any miscellanous user data.
*/
_: {[index: string]: any;};
/**
* An object for any miscellanous user data.
*/
$: {[index: string]: any;};
/**
* Type of the node (e.g. box).
*/
type: string;
/**
* Render index (document order index) of the last render call.
*/
index: number;
/**
* Parent screen.
*/
screen: Screen;
/**
* Parent node.
*/
parent: Node;
/**
* Array of node's children.
*/
children: Node[];
// ** methods ** //
/**
* Prepend a node to this node's children.
*/
prepend(node: Node): void;
/**
* Append a node to this node's children.
*/
append(node: Node): void;
/**
* Remove child node from node.
*/
remove(node: Node): void;
/**
* Insert a node to this node's children at index i.
*/
insert(node: Node, index: number): void;
/**
* Insert a node to this node's children before the reference node.
*/
insertBefore(node: Node, refNode: Node): void;
/**
* Insert a node from node after the reference node.
*/
insertAfter(node: Node, refNode: Node): void;
/**
* Remove node from its parent.
*/
detach(): void;
/**
* Remove node from its parent.
*/
free(): void;
/**
* Remove node from its parent.
*/
forDescendants(iter: Function, s: any): void;
/**
* Remove node from its parent.
*/
forAncestors(iter: Function, s: any): void;
/**
* Remove node from its parent.
*/
collectDescendants(s: any): void;
/**
* Remove node from its parent.
*/
collectAncestors(s: any): void;
/**
* Remove node from its parent.
*/
emitDescendants(): void;
/**
* Remove node from its parent.
*/
emitAncestors(): void;
/**
* Remove node from its parent.
*/
hasDescendant(target: Node): void;
/**
* Remove node from its parent.
*/
hasAncestor(target: Node): boolean;
/**
* Remove node from its parent.
*/
destroy(): void;
/**
* Emit event for element, and recursively emit same event for all descendants.
*/
emitDescendants(type: string, ...args: any[]): void;
/**
* Get user property with a potential default value.
*/
get<T>(name: string, def: T): T;
/**
* Set user property to value.
*/
set<T>(name: string, value: T): void;
// ** events ** //
on(event: string, listener: Function): this;
/**
* Received when node is added to a parent.
*/
on(event: "adopt", callback: (arg: Node) => void): this;
/**
* Received when node is removed from it's current parent.
*/
on(event: "remove", callback: (arg: Node) => void): this;
/**
* Received when node gains a new parent.
*/
on(event: "reparent", callback: (arg: Node) => void): this;
/**
* Received when node is attached to the screen directly or somewhere in its ancestry.
*/
on(event: "attach", callback: (arg: Node) => void): this;
/**
* Received when node is detached from the screen directly or somewhere in its ancestry.
*/
on(event: "detach", callback: (arg: Node) => void): this;
}
export class NodeWithEvents extends Node {
// ** methods ** //
/**
* Bind a keypress listener for a specific key.
*/
key(name: string | string[], listener: Function): void;
/**
* Bind a keypress listener for a specific key once.
*/
onceKey(name: string, listener: Function): void;
/**
* Remove a keypress listener for a specific key.
*/
unkey(name: string, listener: Function): void;
removeKey(name: string, listener: Function): void;
// ** events ** //
on(event: string, listener: Function): this;
/**
* Received on screen resize.
*/
on(event: "resize", callback: () => void): this;
/**
* Received on mouse events.
*/
on(event: "mouse", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mouseout", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mouseover", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mousedown", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mouseup", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mousewheel", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "wheeldown", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "wheelup", callback: (arg: Events.IMouseEventArg) => void): this;
on(event: "mousemove", callback: (arg: Events.IMouseEventArg) => void): this;
/**
* Received on key events.
*/
on(event: "keypress", callback: (ch: string, key: Events.IKeyEventArg) => void): this;
/**
* Global events received for all elements.
*/
on(event: "element click", callback: (arg: Screen) => void): this;
on(event: "element mouseover", callback: (arg: Screen) => void): this;
on(event: "element mouseout", callback: (arg: Screen) => void): this;
on(event: "element mouseup", callback: (arg: Screen) => void): this;
/**
* Received on key event for [name].
*/
//on(event: "key", callback: (arg: BlessedScreen) => void): this;
/**
* Received when the terminal window focuses/blurs. Requires a terminal supporting the
* focus protocol and focus needs to be passed to program.enableMouse().
*/
on(event: "focus", callback: (arg: Screen) => void): this;
/**
* Received when the terminal window focuses/blurs. Requires a terminal supporting the
* focus protocol and focus needs to be passed to program.enableMouse().
*/
on(event: "blur", callback: (arg: Screen) => void): this;
/**
* Received before render.
*/
on(event: "prerender", callback: () => void): this;
/**
* Received on render.
*/
on(event: "render", callback: () => void): this;
/**
* Received when blessed notices something untoward (output is not a tty, terminfo not found, etc).
*/
on(event: "warning", callback: (text: string) => void): this;
/**
* Received when the screen is destroyed (only useful when using multiple screens).
*/
on(event: "destroy", callback: () => void): this;
/**
* Received when the element is moved.
*/
on(event: "move", callback: () => void): this;
/**
* Element was clicked (slightly smarter than mouseup).
*/
on(event: "click", callback: (arg: Screen) => void): this;
/**
* Received when element is shown.
*/
on(event: "show", callback: () => void): this;
/**
* Received when element becomes hidden.
*/
on(event: "hide", callback: () => void): this;
on(event: "set content", callback: () => void): this;
on(event: "parsed content", callback: () => void): this;
}
export interface IScreenOptions extends INodeOptions {
/**
* The blessed Program to be associated with. Will be automatically instantiated if none is provided.
*/
program?: BlessedProgram;
/**
* Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with
* uniform cells to their sides). This is known to cause flickering with elements that are not full-width,
* however, it is more optimal for terminal rendering.
*/
smartCSR?: boolean;
/**
* Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR,
* but may cause flickering depending on what is on each side of the element.
*/
fastCSR?: boolean;
/**
* Attempt to perform back_color_erase optimizations for terminals that support it. It will also work
* with terminals that don't support it, but only on lines with the default background color. As it
* stands with the current implementation, it's uncertain how much terminal performance this adds at
* the cost of overhead within node.
*/
useBCE?: boolean;
/**
* Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300).
*/
resizeTimeout?: number;
/**
* The width of tabs within an element's content.
*/
tabSize?: number;
/**
* Automatically position child elements with border and padding in mind (NOTE: this is a recommended
* option. It may become default in the future).
*/
autoPadding?: boolean;
cursor?: Types.TCursor;
/**
* Create a log file. See log method.
*/
log?: (...msg: any[]) => void;
/**
* Dump all output and input to desired file. Can be used together with log option if set as a boolean.
*/
dump?: string;
/**
* Debug mode. Enables usage of the debug method. Also creates a debug console which will display when
* pressing F12. It will display all log and debug messages.
*/
debug?: (...msg: string[]) => void;
/**
* Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful
* for creating a key that will always exit no matter whether the keys are locked.
*/
ignoreLocked?: boolean;
/**
* Automatically "dock" borders with other elements instead of overlapping, depending on position
* (experimental). For example: These border-overlapped elements:
*/
dockBorders?: boolean;
/**
* Normally, dockable borders will not dock if the colors or attributes are different. This option
* will allow them to dock regardless. It may produce some odd looking multi-colored borders though.
*/
ignoreDockContrast?: boolean;
/**
* Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode
* combining characters. This allows you to display text above the basic multilingual plane. This
* is behind an option because it may affect performance slightly negatively. Without this option
* enabled, all double-width, surrogate pair, and combining characters will be replaced by '??',
* '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply
* removes them from an element's content if iTerm2 is detected).
*/
fullUnicode?: boolean;
/**
* Send focus events after mouse is enabled.
*/
sendFocus?: boolean;
/**
* Display warnings (such as the output not being a TTY, similar to ncurses).
*/
warnings?: boolean;
/**
* Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page.
* If value is true unicode is forced. If value is false non-unicode is forced (default: null).
*/
forceUnicode?: boolean;
/**
* Input and output streams. process.stdin/process.stdout by default, however, it could be a
* net.Socket if you want to make a program that runs over telnet or something of that nature.
* */
input?: stream.Writable;
/**
* Input and output streams. process.stdin/process.stdout by default, however, it could be a
* net.Socket if you want to make a program that runs over telnet or something of that nature.
* */
output?: stream.Readable;
/**
* The blessed Tput object (only available if you passed tput: true to the Program constructor.)
*/
tput?: Tput;
/**
* Top of the focus history stack.
*/
focused?: BlessedElement;
/**
* Width of the screen (same as program.cols).
*/
width?: Types.TPosition;
/**
* Height of the screen (same as program.rows).
*/
height?: Types.TPosition;
/**
* Same as screen.width.
*/
cols?: number;
/**
* Same as screen.height.
*/
rows?: number;
/**
* Relative top offset, always zero.
*/
top?: Types.TTopLeft;
/**
* Relative left offset, always zero.
*/
left?: Types.TTopLeft;
/**
* Relative right offset, always zero.
*/
right?: Types.TPosition;
/**
* Relative bottom offset, always zero.
*/
bottom?: Types.TPosition;
/**
* Absolute top offset, always zero.
*/
atop?: Types.TTopLeft;
/**
* Absolute left offset, always zero.
*/
aleft?: Types.TTopLeft;
/**
* Absolute right offset, always zero.
*/
aright?: Types.TPosition;
/**
* Absolute bottom offset, always zero.
*/
abottom?: Types.TPosition;
/**
* Whether the focused element grabs all keypresses.
*/
grabKeys?: any;
/**
* Prevent keypresses from being received by any element.
*/
lockKeys?: boolean;
/**
* The currently hovered element. Only set if mouse events are bound.
*/
hover?: any;
/**
* Set or get terminal name. Set calls screen.setTerminal() internally.
*/
terminal?: string;
/**
* Set or get window title.
*/
title?: string;
}
export class Screen extends NodeWithEvents implements IHasOptions<IScreenOptions> {
constructor(opts: IScreenOptions);
// ** properties ** //
cleanSides: any;
/**
* Original options object.
*/
options: IScreenOptions;
/**
* The blessed Program to be associated with. Will be automatically instantiated if none is provided.
*/
program: BlessedProgram;
/**
* Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with
* uniform cells to their sides). This is known to cause flickering with elements that are not full-width,
* however, it is more optimal for terminal rendering.
*/
smartCSR: boolean;
/**
* Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR,
* but may cause flickering depending on what is on each side of the element.
*/
fastCSR: boolean;
/**
* Attempt to perform back_color_erase optimizations for terminals that support it. It will also work
* with terminals that don't support it, but only on lines with the default background color. As it
* stands with the current implementation, it's uncertain how much terminal performance this adds at
* the cost of overhead within node.
*/
useBCE: boolean;
/**
* Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300).
*/
resizeTimeout: number;
/**
* The width of tabs within an element's content.
*/
tabSize: number;
/**
* Automatically position child elements with border and padding in mind (NOTE: this is a recommended
* option. It may become default in the future).
*/
autoPadding: boolean;
cursor: Types.TCursor;
/**
* Dump all output and input to desired file. Can be used together with log option if set as a boolean.
*/
dump: string;
/**
* Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful
* for creating a key that will always exit no matter whether the keys are locked.
*/
ignoreLocked: boolean;
/**
* Automatically "dock" borders with other elements instead of overlapping, depending on position
* (experimental). For example: These border-overlapped elements:
*/
dockBorders: boolean;
/**
* Normally, dockable borders will not dock if the colors or attributes are different. This option
* will allow them to dock regardless. It may produce some odd looking multi-colored borders though.
*/
ignoreDockContrast: boolean;
/**
* Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode
* combining characters. This allows you to display text above the basic multilingual plane. This
* is behind an option because it may affect performance slightly negatively. Without this option
* enabled, all double-width, surrogate pair, and combining characters will be replaced by '??',
* '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply
* removes them from an element's content if iTerm2 is detected).
*/
fullUnicode: boolean;
/**
* Send focus events after mouse is enabled.
*/
sendFocus: boolean;
/**
* Display warnings (such as the output not being a TTY, similar to ncurses).
*/
warnings: boolean;
/**
* Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page.
* If value is true unicode is forced. If value is false non-unicode is forced (default: null).
*/
forceUnicode: boolean;
/**
* Input and output streams. process.stdin/process.stdout by default, however, it could be a
* net.Socket if you want to make a program that runs over telnet or something of that nature.
* */
input: stream.Writable;
/**
* Input and output streams. process.stdin/process.stdout by default, however, it could be a
* net.Socket if you want to make a program that runs over telnet or something of that nature.
* */
output: stream.Readable;
/**
* The blessed Tput object (only available if you passed tput: true to the Program constructor.)
*/
tput: Tput;
/**
* Top of the focus history stack.
*/
focused: BlessedElement;
/**
* Width of the screen (same as program.cols).
*/
width: Types.TPosition;
/**
* Height of the screen (same as program.rows).
*/
height: Types.TPosition;
/**
* Same as screen.width.
*/
cols: number;
/**
* Same as screen.height.
*/
rows: number;
/**
* Relative top offset, always zero.
*/
top: Types.TTopLeft;
/**
* Relative left offset, always zero.
*/
left: Types.TTopLeft;
/**
* Relative right offset, always zero.
*/
right: Types.TPosition;
/**
* Relative bottom offset, always zero.
*/
bottom: Types.TPosition;
/**
* Absolute top offset, always zero.
*/
atop: Types.TTopLeft;
/**
* Absolute left offset, always zero.
*/
aleft: Types.TTopLeft;
/**
* Absolute right offset, always zero.
*/
aright: Types.TPosition;
/**
* Absolute bottom offset, always zero.
*/
abottom: Types.TPosition;
/**
* Whether the focused element grabs all keypresses.
*/
grabKeys: any;
/**
* Prevent keypresses from being received by any element.
*/
lockKeys: boolean;
/**
* The currently hovered element. Only set if mouse events are bound.
*/
hover: any;
/**
* Set or get terminal name. Set calls screen.setTerminal() internally.
*/
terminal: string;
/**
* Set or get window title.
*/
title: string;
// ** methods ** //
/**
* Write string to the log file if one was created.
*/
log(...msg: any[]): void;
/**
* Same as the log method, but only gets called if the debug option was set.
*/
debug(...msg: string[]): void;
/**
* Allocate a new pending screen buffer and a new output screen buffer.
*/
alloc(): void;
/**
* Reallocate the screen buffers and clear the screen.
*/
realloc(): void;
/**
* Draw the screen based on the contents of the screen buffer.
*/
draw(start: number, end: number): void;
/**
* Render all child elements, writing all data to the screen buffer and drawing the screen.
*/
render(): void;
/**
* Clear any region on the screen.
*/
clearRegion(x1: number, x2: number, y1: number, y2: number): void;
/**
* Fill any region with a character of a certain attribute.
*/
fillRegion(attr: string, ch: string, x1: number, x2: number, y1: number, y2: number): void;
/**
* Focus element by offset of focusable elements.
*/
focusOffset(offset: number): any;
/**
* Focus previous element in the index.
*/
focusPrevious(): void;
/**
* Focus next element in the index.
*/
focusNext(): void;
/**
* Push element on the focus stack (equivalent to screen.focused = el).
*/
focusPush(element: BlessedElement): void;
/**
* Pop element off the focus stack.
*/
focusPop(): BlessedElement;
/**
* Save the focused element.
*/
saveFocus(): BlessedElement;
/**
* Restore the saved focused element.
*/
restoreFocus(): BlessedElement;
/**
* "Rewind" focus to the last visible and attached element.
*/
rewindFocus(): BlessedElement;
/**
* Spawn a process in the foreground, return to blessed app after exit.
*/
spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess;
/**
* Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit.
*/
exec(file: string, args: string[], options: NodeChildProcessExecOptions, callback: Function): child_process.ChildProcess;
/**
* Read data from text editor.
*/
readEditor(options: any, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
readEditor(callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
/**
* Set effects based on two events and attributes.
*/
setEffects(el: BlessedElement, fel: BlessedElement, over: any, out: any, effects: any, temp: any): void;
/**
* Insert a line into the screen (using csr: this bypasses the output buffer).
*/
insertLine(n: number, y: number, top: number, bottom: number): void;
/**
* Delete a line from the screen (using csr: this bypasses the output buffer).
*/
deleteLine(n: number, y: number, top: number, bottom: number): void;
/**
* Insert a line at the bottom of the screen.
*/
insertBottom(top: number, bottom: number): void;
/**
* Insert a line at the top of the screen.
*/
insertTop(top: number, bottom: number): void;
/**
* Delete a line at the bottom of the screen.
*/
deleteBottom(top: number, bottom: number): void;
/**
* Delete a line at the top of the screen.
*/
deleteTop(top: number, bottom: number): void;
/**
* Enable mouse events for the screen and optionally an element (automatically called when a form of
* on('mouse') is bound).
*/
enableMouse(el: BlessedElement): void;
enableMouse(): void;
/**
* Enable keypress events for the screen and optionally an element (automatically called when a form of
* on('keypress') is bound).
*/
enableKeys(el: BlessedElement): void;
enableKeys(): void;
/**
* Enable key and mouse events. Calls bot enableMouse and enableKeys.
*/
enableInput(el: BlessedElement): void;
enableInput(): void;
/**
* Attempt to copy text to clipboard using iTerm2's proprietary sequence. Returns true if successful.
*/
copyToClipboard(text: string): void;
/**
* Attempt to change cursor shape. Will not work in all terminals (see artificial cursors for a solution
* to this). Returns true if successful.
*/
cursorShape(shape: boolean, blink: boolean): any;
/**
* Attempt to change cursor color. Returns true if successful.
*/
cursorColor(color: string): void;
/**
* Attempt to reset cursor. Returns true if successful.
*/
cursorReset(): 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.
*/
screenshot(xi: number, xl: number, yi: number, yl: number): string;
screenshot(): void;