Skip to content

Commit

Permalink
Update type definitions for containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentonv committed Jan 22, 2025
1 parent 8abaf07 commit 86db375
Show file tree
Hide file tree
Showing 21 changed files with 262 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/workerd/api/rtti.c++
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
F("node", EW_NODE_ISOLATE_TYPES) \
F("rtti", EW_RTTI_ISOLATE_TYPES) \
F("webgpu", EW_WEBGPU_ISOLATE_TYPES) \
F("eventsource", EW_EVENTSOURCE_ISOLATE_TYPES)
F("eventsource", EW_EVENTSOURCE_ISOLATE_TYPES) \
F("container", EW_CONTAINER_ISOLATE_TYPES)

namespace workerd::api {

Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2021-11-03/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3401,6 +3402,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2021-11-03/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3413,6 +3414,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-01-31/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3427,6 +3428,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-01-31/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3439,6 +3440,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-03-21/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3452,6 +3453,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-03-21/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3464,6 +3465,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-08-04/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3453,6 +3454,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-08-04/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3465,6 +3466,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-10-31/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3456,6 +3457,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-10-31/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3468,6 +3469,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-11-30/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3461,6 +3462,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2022-11-30/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3473,6 +3474,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2023-03-01/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3463,6 +3464,18 @@ interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
type AiImageClassificationInput = {
image: number[];
};
Expand Down
13 changes: 13 additions & 0 deletions types/generated-snapshot/2023-03-01/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ export interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
Expand Down Expand Up @@ -3475,6 +3476,18 @@ export interface EventSourceEventSourceInit {
withCredentials?: boolean;
fetcher?: Fetcher;
}
export interface Container {
get running(): boolean;
start(options?: ContainerStartupOptions): void;
monitor(): Promise<void>;
destroy(error?: any): Promise<void>;
signal(signo: number): void;
getTcpPort(port: number): Fetcher;
}
export interface ContainerStartupOptions {
entrypoint?: string[];
enableInternet: boolean;
}
export type AiImageClassificationInput = {
image: number[];
};
Expand Down
Loading

0 comments on commit 86db375

Please sign in to comment.