-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathReveryTerminal.rei
118 lines (95 loc) · 2.51 KB
/
ReveryTerminal.rei
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
module RingBuffer = RingBuffer;
module Cursor: {
type t = {
row: int,
column: int,
visible: bool,
shape: Vterm.TermProp.CursorShape.t,
};
let initial: t;
};
module Theme: {
type t = int => Revery.Color.t;
let default: t;
};
module Font: {
type t = {
font: Revery.Font.t,
fontSize: float,
lineHeight: float,
characterHeight: float,
characterWidth: float,
smoothing: Revery.Font.Smoothing.t,
};
let make:
(~smoothing: Revery.Font.Smoothing.t=?, ~size: float, Revery.Font.t) => t;
};
module Screen: {
type t;
let initial: t;
// Get a cell, where [row] is 0-indexed, starting at the earliest
// row in the scrollback buffer.
let getCell: (~row: int, ~column: int, t) => Vterm.ScreenCell.t;
let getForegroundColor:
(
~defaultBackground: Revery.Color.t=?,
~defaultForeground: Revery.Color.t=?,
~theme: Theme.t,
Vterm.ScreenCell.t
) =>
Revery.Color.t;
let getBackgroundColor:
(
~defaultBackground: Revery.Color.t=?,
~defaultForeground: Revery.Color.t=?,
~theme: Theme.t,
Vterm.ScreenCell.t
) =>
Revery.Color.t;
// [getTotalRows(screen)] returns the count of total rows, including scrollback.
// For example, if the screen shows 40 rows, and there are 100 lines
// in the scrollback buffer, this would report 140.
let getTotalRows: t => int;
// [getVisibleRows(screen)] returns the number of visible rows, not including scrollback.
let getVisibleRows: t => int;
let getColumns: t => int;
};
type effect =
| ScreenResized(Screen.t)
| ScreenUpdated(Screen.t)
| TermPropChanged(Vterm.TermProp.t)
| CursorMoved(Cursor.t)
| Output(string);
type t;
type unsubscribe = unit => unit;
let make:
(
~scrollBackSize: int=?,
~rows: int,
~columns: int,
~onEffect: effect => unit,
unit
) =>
t;
// Write process output (ie, stdout)
let write: (~input: string, t) => unit;
// Send an input key to the terminal.
// This will trigger the `Output` effect
let input: (~modifier: Vterm.modifier=?, ~key: Vterm.key, t) => unit;
let resize: (~rows: int, ~columns: int, t) => unit;
let screen: t => Screen.t;
let cursor: t => Cursor.t;
let render:
(
~opacity: float=?,
~defaultForeground: Revery.Color.t=?,
~defaultBackground: Revery.Color.t=?,
~scrollBarBackground: Revery.Color.t=?,
~scrollBarThumb: Revery.Color.t=?,
~scrollBarThickness: int=?,
~theme: Theme.t=?,
~font: Font.t,
~cursor: Cursor.t,
Screen.t
) =>
Revery.UI.element;