import State from './state'; import { AnyFS } from '@teambit/any-fs'; import Container, { ExecOptions } from './container'; import Console from './console'; import { Exec } from './container'; import ContainerFactory from './container/container-factory'; export declare type CapsuleBaseOptions = { id: string; }; export interface Serializable { toString(): string; } export default class Capsule { /** * container implementation the capsule is being executed within. */ protected container: Container; /** * the capsule's file system. */ readonly fs: Y; /** * console for controlling process streams as stdout, stdin and stderr. */ readonly console: Console; /** * capsule's state. */ readonly state: State; /** * config to pass capsule */ readonly config: any; constructor( /** * container implementation the capsule is being executed within. */ container: Container, /** * the capsule's file system. */ fs: Y, /** * console for controlling process streams as stdout, stdin and stderr. */ console: Console, /** * capsule's state. */ state: State, /** * config to pass capsule */ config?: any); get id(): string; get containerId(): string; run(modulePath: string, options?: {}): Promise; runFn(fn: () => Serializable, options?: { cwd: string; }): Promise; start(): Promise; serialize(): string; log(): Promise; on(event: string, fn: (data: any) => void): void; updateFs(fs: { [path: string]: string; }): Promise; pause(): Promise; resume(): Promise; stop(): Promise; status(): Promise; exec(execOpions: ExecOptions): Promise; destroy(): Promise; static create>(containerFactory: ContainerFactory, volume?: AnyFS, config?: any, initialState?: State, console?: Console): Promise; static obtain, Y extends CapsuleBaseOptions>(containerFactory: ContainerFactory, raw: string): Promise; }