import { DuplexBufferStream } from '../../utils'; /** * exec instance */ export interface Exec { /** * stdout stream */ stdout: DuplexBufferStream; /** * stdin stream */ stderr: DuplexBufferStream; /** * listen to events on exec */ on(name: string, cb: () => void): void; /** * stdin stream */ stdin: DuplexBufferStream; /** * inspect the exec instance for its status. */ inspect(): Promise; /** * abort the running command. */ abort(): Promise; } /** * options for executing a container command. */ export type ExecOptions = { /** * command to execute */ command: string[]; /** * detach from the command right after its started */ detach?: boolean; /** * allocate a pseudo-tty. */ tty?: boolean; /** * runs the exec process with extended privileges. */ privileged?: boolean; /** * a list of environment variables in the form ["VAR=value", ...]. */ environmentVariables?: string[]; /** * the user, and optionally, group to run the exec process inside the container. Format is one of: user, user:group, uid, or uid:gid. */ user?: string; }; export type ExecStatus = { /** * the process id */ pid: number; /** * is the process still running */ running: boolean; };