feat: add exec pty support
This commit is contained in:
24
src/types/lydell-node-pty.d.ts
vendored
Normal file
24
src/types/lydell-node-pty.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
declare module "@lydell/node-pty" {
|
||||
export type PtyExitEvent = { exitCode: number; signal?: number };
|
||||
export type PtyListener<T> = (event: T) => void;
|
||||
export type PtyHandle = {
|
||||
pid: number;
|
||||
write: (data: string | Buffer) => void;
|
||||
onData: (listener: PtyListener<string>) => void;
|
||||
onExit: (listener: PtyListener<PtyExitEvent>) => void;
|
||||
};
|
||||
|
||||
export type PtySpawn = (
|
||||
file: string,
|
||||
args: string[] | string,
|
||||
options: {
|
||||
name?: string;
|
||||
cols?: number;
|
||||
rows?: number;
|
||||
cwd?: string;
|
||||
env?: Record<string, string>;
|
||||
},
|
||||
) => PtyHandle;
|
||||
|
||||
export const spawn: PtySpawn;
|
||||
}
|
||||
Reference in New Issue
Block a user