import { t as WorkspaceEgressPolicy } from "../../shared-3MpgXJDw.js"; import { n as WorkspaceBackend, t as BackendHandle } from "../../shared-C-sNJ-xg.js"; import { RpcTarget } from "cloudflare:workers"; //#region src/backends/container-legacy/container-launch-record.d.ts interface ContainerLaunchSpec { env: Record; enableInternet: boolean; } //#endregion //#region src/backends/container-legacy/container-lifecycle.d.ts interface ContainerExitInfo { exitedAt: number; reason: string; } //#endregion //#region src/backends/container-legacy/container-host.d.ts interface WorkspaceRef { binding: string; id: string; name?: string; } interface ContainerRuntimeInfo { runtimeId: string; clientSecret: string; outcome: "launched" | "adopted" | "relaunched"; } interface ILegacyWorkspaceContainerAPI { start(spec: ContainerLaunchSpec): Promise; interceptOutboundHttp(host: string, workspace: WorkspaceRef): Promise; interceptAllOutboundHttp(workspace: WorkspaceRef, token: string): Promise; fetchPort(port: number, input: RequestInfo | URL, init?: RequestInit): Promise; port(port: number): Fetcher; restart(spec: ContainerLaunchSpec): Promise; setInactivityTimeout(durationMs: number): Promise; status(): Promise<{ running: boolean; exit: ContainerExitInfo | null; }>; exitInfo(): Promise; } declare class LegacyWorkspaceContainerAPI extends RpcTarget implements ILegacyWorkspaceContainerAPI { #private; constructor(ctx: DurableObjectState); start(spec: ContainerLaunchSpec): Promise; restart(spec: ContainerLaunchSpec): Promise; setInactivityTimeout(durationMs: number): Promise; status(): Promise<{ running: boolean; exit: ContainerExitInfo | null; }>; exitInfo(): Promise; interceptAllOutboundHttp(ref: WorkspaceRef, token: string): Promise; interceptOutboundHttp(host: string, ref: WorkspaceRef): Promise; fetchPort(port: number, input: RequestInfo | URL, init?: RequestInit): Promise; port(port: number): { fetch(input: RequestInfo | URL, init?: RequestInit): Promise; connect(address: SocketAddress | string, options?: SocketOptions): Socket; }; } type DOCtor = new (...args: any[]) => object; type WithWorkspaceContainerCtor = TBase & (new (...args: any[]) => InstanceType & { getWorkspaceContainer(): LegacyWorkspaceContainerAPI; }); /** * Adds the container host surface that `LegacyContainerBackend` dials to a durable object class. * * @deprecated Use `withWorkspaceContainer` from * `@cloudflare/computer/backends/container`. This mixin will be removed in * a future release. */ declare function withLegacyWorkspaceContainer(Base: TBase): WithWorkspaceContainerCtor; //#endregion //#region src/backends/container-legacy/cloudflare-container.d.ts interface ContainerHostHolder { getWorkspaceContainer(): ILegacyWorkspaceContainerAPI | Promise; } interface LegacyContainerBackendOptions { container: () => ContainerHostHolder | Promise; workspace: WorkspaceRef; egressHost?: string; egress?: WorkspaceEgressPolicy; containerPort?: number; containerEnv?: Record; connectTimeoutMs?: number; heartbeatIntervalMs?: number; restartAttempts?: number; healthProbeTimeoutMs?: number; healthRetryInitialDelayMs?: number; healthRetryMaxDelayMs?: number; id?: string; } /** * Runs shell commands in a platform-scheduled Cloudflare Container through `computerd`. * * @deprecated Use `ContainerBackend` from * `@cloudflare/computer/backends/container`, which serves containers the * durable object schedules. This backend will be removed in a future release. */ declare class LegacyContainerBackend implements WorkspaceBackend { #private; readonly type = "cloudflare-container"; readonly id: string; constructor(options: LegacyContainerBackendOptions); connect(): Promise; handleFetch(req: Request): Promise; } //#endregion export { type ContainerLaunchSpec, type ContainerRuntimeInfo, type ILegacyWorkspaceContainerAPI, LegacyContainerBackend, type LegacyContainerBackendOptions, LegacyWorkspaceContainerAPI, type WorkspaceEgressPolicy, type WorkspaceRef, withLegacyWorkspaceContainer }; //# sourceMappingURL=index.d.ts.map