import { SandboxImpl } from "./sandbox.js"; //#region src/sandbox/docker.d.ts /** * Structural view of a `dockerode` container instance. * * @stable */ interface DockerodeContainer { readonly id: string; readonly start: () => Promise; readonly wait: () => Promise<{ readonly StatusCode: number; }>; readonly logs: (opts: { readonly stdout: boolean; readonly stderr: boolean; }) => Promise; readonly remove: (opts?: { readonly force?: boolean; }) => Promise; readonly attach: (opts: { readonly stream: boolean; readonly stdin: boolean; readonly stdout: boolean; readonly stderr: boolean; }) => Promise; } /** * Structural view of a `dockerode` client instance. * * @stable */ interface DockerodeClient { readonly createContainer: (opts: Record) => Promise; readonly modem?: { readonly demuxStream?: (raw: NodeJS.ReadableStream, out: NodeJS.WritableStream, err: NodeJS.WritableStream) => void; }; } /** * Structural view of the `dockerode` module returned by * `DockerSandboxOptions.peerLoader`. * * @stable */ interface DockerodeModule { default?: new (opts?: { readonly socketPath?: string; }) => DockerodeClient; } /** * Options for `createDockerSandbox(...)`. * * @stable */ interface DockerSandboxOptions { /** * Container image. Defaults to a no-op stub the operator must * override; the framework deliberately does not ship an image. */ readonly image?: string; /** * Hostname for the Docker daemon socket. Forwarded to `new * Dockerode({ socketPath })`. Defaults to the platform default. */ readonly socketPath?: string; /** Default wall-clock timeout (ms). Defaults to 30000. */ readonly defaultTimeoutMs?: number; /** Memory limit (MB). Defaults to 512. */ readonly memoryLimitMb?: number; /** * Container user as `"uid:gid"` (the create request's `User`). * Defaults to `'10001:10001'` so sandboxed code never runs as the * image's default user - which is root in most base images * (deep-retest 0.13.12 P2). Numeric ids need no passwd entry. Pass * `''` to keep the image default (NOT recommended; document why in * your deployment notes if you do). */ readonly user?: string; /** * PID ceiling for the container (`PidsLimit`) - bounds fork/spawn * storms that would otherwise run until the timeout. Defaults to * 128; clamped to `[16, 4096]`. */ readonly pidsLimit?: number; /** * CPU allowance in CPUs (`NanoCpus`), fractional allowed. Bounds * busy-loop burn. Defaults to 1; clamped to `[0.1, 8]`. */ readonly cpus?: number; /** * Override the peer-dep loader. Tests inject a stub here. */ readonly peerLoader?: () => Promise; } /** * Construct a `DockerSandbox` instance. The adapter resolves the * peer dependency lazily on the first `run(...)` call. * * @stable */ declare function createDockerSandbox(opts?: DockerSandboxOptions): SandboxImpl; //#endregion export { DockerSandboxOptions, DockerodeClient, DockerodeContainer, DockerodeModule, createDockerSandbox }; //# sourceMappingURL=docker.d.ts.map