import { AnyFS } from '@teambit/any-fs'; import { Exec, ExecOptions } from './exec'; export default interface Container { /** * container id */ id: string; fs: X; /** * execute a command on the container */ exec(options: ExecOptions): Promise; /** * execute a command on the container and return string promise */ execP(options: ExecOptions): Promise; /** * get capsule logs */ log(): Promise; on(event: string, fn: (data: any) => void): void; /** * start a container. */ start(): Promise; /** * get the container status. */ inspect(): Promise; /** * pause a container. */ pause(): Promise; /** * resume a paused container */ resume(): Promise; /** * stop an existing container. */ stop(ttl?: number): Promise; /** * get the container stats */ stats?(): Promise; /** * create a new image from the container current state */ commit?(options: CommitOptions): Promise; /** * display the container's running processes. */ top?(psArgs?: string): Promise; } export type ContainerStatus = { /** * array of open container ports */ ports: number[]; /** * container host */ host: string; }; export type CommitOptions = { /** * repository name for the created image */ repo: string; /** * tag name for the create image */ tag: string; /** * commit message */ comment: string; /** * author of the image. */ author: string; /** * whether to pause the container before committing */ pause: boolean; };