forked from npmx-dev/npmx.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-pty.d.ts
More file actions
53 lines (49 loc) · 1.38 KB
/
node-pty.d.ts
File metadata and controls
53 lines (49 loc) · 1.38 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
// @lydell/node-pty package.json does not export its types so for nodenext target we need to add them
declare module '@lydell/node-pty' {
export function spawn(
file: string,
args: string[] | string,
options: IPtyForkOptions | IWindowsPtyForkOptions,
): IPty
export interface IBasePtyForkOptions {
name?: string
cols?: number
rows?: number
cwd?: string
env?: { [key: string]: string | undefined }
encoding?: string | null
handleFlowControl?: boolean
flowControlPause?: string
flowControlResume?: string
}
export interface IPtyForkOptions extends IBasePtyForkOptions {
uid?: number
gid?: number
}
export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
useConpty?: boolean
useConptyDll?: boolean
conptyInheritCursor?: boolean
}
export interface IPty {
readonly pid: number
readonly cols: number
readonly rows: number
readonly process: string
handleFlowControl: boolean
readonly onData: IEvent<string>
readonly onExit: IEvent<{ exitCode: number; signal?: number }>
resize(columns: number, rows: number): void
clear(): void
write(data: string | Buffer): void
kill(signal?: string): void
pause(): void
resume(): void
}
export interface IDisposable {
dispose(): void
}
export interface IEvent<T> {
(listener: (e: T) => any): IDisposable
}
}