-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
44 lines (42 loc) · 1.27 KB
/
index.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
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
/** The options that can be passed to the constructor of Pty. */
export interface PtyOptions {
command: string;
args?: Array<string>;
envs?: Record<string, string>;
dir?: string;
size?: Size;
cgroupPath?: string;
interactive?: boolean;
onExit: (err: null | Error, exitCode: number) => void;
}
/** A size struct to pass to resize. */
export interface Size {
cols: number;
rows: number;
}
/** Resize the terminal. */
export function ptyResize(fd: number, size: Size): void;
/**
* Set the close-on-exec flag on a file descriptor. This is `fcntl(fd, F_SETFD, FD_CLOEXEC)` under
* the covers.
*/
export function setCloseOnExec(fd: number, closeOnExec: boolean): void;
/**
* Get the close-on-exec flag on a file descriptor. This is `fcntl(fd, F_GETFD) & FD_CLOEXEC ==
*_CLOEXEC` under the covers.
*/
export function getCloseOnExec(fd: number): boolean;
export declare class Pty {
/** The pid of the forked process. */
pid: number;
constructor(opts: PtyOptions);
/**
* Transfers ownership of the file descriptor for the PTY controller. This can only be called
* once (it will error the second time). The caller is responsible for closing the file
* descriptor.
*/
takeFd(): c_int;
}