-
Notifications
You must be signed in to change notification settings - Fork 314
Expand file tree
/
Copy pathinterfaces.ts
More file actions
141 lines (120 loc) · 3.52 KB
/
interfaces.ts
File metadata and controls
141 lines (120 loc) · 3.52 KB
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
/**
* Copyright (c) 2016, Daniel Imms (MIT License).
* Copyright (c) 2018, Microsoft Corporation (MIT License).
*/
export interface IProcessEnv {
[key: string]: string | undefined;
}
export interface ITerminal {
/**
* Gets the name of the process.
*/
process: string;
/**
* Gets the process ID.
*/
pid: number;
/**
* Writes data to the socket.
* @param data The data to write.
*/
write(data: string | Buffer): void;
/**
* Resize the pty.
* @param cols The number of columns.
* @param rows The number of rows.
* @param pixelSize Optional pixel dimensions of the pty. On Unix, this sets the `ws_xpixel`
* and `ws_ypixel` fields of the `winsize` struct. Applications running in the pty can read
* these values via the `TIOCGWINSZ` ioctl. This parameter is ignored on Windows.
*/
resize(cols: number, rows: number, pixelSize?: { width: number, height: number }): void;
/**
* Clears the pty's internal representation of its buffer. This is a no-op
* unless on Windows/ConPTY.
*/
clear(): void;
/**
* Close, kill and destroy the socket.
*/
destroy(): void;
/**
* Kill the pty.
* @param signal The signal to send, by default this is SIGHUP. This is not
* supported on Windows.
*/
kill(signal?: string): void;
/**
* Set the pty socket encoding.
*/
setEncoding(encoding: string | null): void;
/**
* Resume the pty socket.
*/
resume(): void;
/**
* Pause the pty socket.
*/
pause(): void;
/**
* Alias for ITerminal.on(eventName, listener).
*/
addListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Adds the listener function to the end of the listeners array for the event
* named eventName.
* @param eventName The event name.
* @param listener The callback function
*/
on(eventName: string, listener: (...args: any[]) => any): void;
/**
* Returns a copy of the array of listeners for the event named eventName.
*/
listeners(eventName: string): Function[];
/**
* Removes the specified listener from the listener array for the event named
* eventName.
*/
removeListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Removes all listeners, or those of the specified eventName.
*/
removeAllListeners(eventName: string): void;
/**
* Adds a one time listener function for the event named eventName. The next
* time eventName is triggered, this listener is removed and then invoked.
*/
once(eventName: string, listener: (...args: any[]) => any): void;
}
interface IBasePtyForkOptions {
name?: string;
cols?: number;
rows?: number;
cwd?: string;
env?: IProcessEnv;
encoding?: string | null;
handleFlowControl?: boolean;
flowControlPause?: string;
flowControlResume?: string;
}
export interface IPtyForkOptions extends IBasePtyForkOptions {
uid?: number;
gid?: number;
}
export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
/**
* Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when
* the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from
* build 17134 but is too unstable to enable by default.
*
* @deprecated This option is ignored and will be removed in a future version.
* https://github.com/microsoft/node-pty/issues/871
*/
useConpty?: boolean;
useConptyDll?: boolean;
conptyInheritCursor?: boolean;
}
export interface IPtyOpenOptions {
cols?: number;
rows?: number;
encoding?: string | null;
}