[READ-ONLY] a fast, modern browser for the npm registry
at main 53 lines 1.4 kB view raw
1// @lydell/node-pty package.json does not export its types so for nodenext target we need to add them 2declare module '@lydell/node-pty' { 3 export function spawn( 4 file: string, 5 args: string[] | string, 6 options: IPtyForkOptions | IWindowsPtyForkOptions, 7 ): IPty 8 export interface IBasePtyForkOptions { 9 name?: string 10 cols?: number 11 rows?: number 12 cwd?: string 13 env?: { [key: string]: string | undefined } 14 encoding?: string | null 15 handleFlowControl?: boolean 16 flowControlPause?: string 17 flowControlResume?: string 18 } 19 20 export interface IPtyForkOptions extends IBasePtyForkOptions { 21 uid?: number 22 gid?: number 23 } 24 25 export interface IWindowsPtyForkOptions extends IBasePtyForkOptions { 26 useConpty?: boolean 27 useConptyDll?: boolean 28 conptyInheritCursor?: boolean 29 } 30 31 export interface IPty { 32 readonly pid: number 33 readonly cols: number 34 readonly rows: number 35 readonly process: string 36 handleFlowControl: boolean 37 readonly onData: IEvent<string> 38 readonly onExit: IEvent<{ exitCode: number; signal?: number }> 39 resize(columns: number, rows: number): void 40 clear(): void 41 write(data: string | Buffer): void 42 kill(signal?: string): void 43 pause(): void 44 resume(): void 45 } 46 47 export interface IDisposable { 48 dispose(): void 49 } 50 export interface IEvent<T> { 51 (listener: (e: T) => any): IDisposable 52 } 53}