declare interface ExecutionContext { waitUntil(promise: Promise): void; passThroughOnException(): void; } declare interface Fetcher { fetch(input: Request | URL | string): Promise; } declare interface DurableObjectId {} declare interface DurableObjectNamespace { idFromName(name: string): DurableObjectId; get(id: DurableObjectId): Stub; } declare interface KVNamespacePutOptions { expiration?: number; expirationTtl?: number; metadata?: unknown; } declare interface KVNamespaceListKey { name: string; expiration?: number; metadata?: unknown; } declare interface KVNamespaceListResult { keys: KVNamespaceListKey[]; list_complete: boolean; cursor?: string; } declare interface KVNamespaceListOptions { prefix?: string; limit?: number; cursor?: string; } declare interface KVNamespace { get(key: string): Promise; get(key: string, type: "json"): Promise; get(key: string, type: "text"): Promise; get(key: string, type: "arrayBuffer"): Promise; put(key: string, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise; delete(key: string): Promise; list(options?: KVNamespaceListOptions): Promise; } declare interface R2HTTPMetadata { contentType?: string; cacheControl?: string; contentDisposition?: string; contentEncoding?: string; contentLanguage?: string; } declare interface R2PutOptions { httpMetadata?: R2HTTPMetadata; customMetadata?: Record; } declare interface R2Object { key: string; size: number; body?: ReadableStream; httpMetadata?: R2HTTPMetadata; } declare interface R2ObjectBody extends R2Object { body: ReadableStream; arrayBuffer(): Promise; text(): Promise; json(): Promise; } declare interface R2Objects { objects: R2Object[]; truncated: boolean; cursor?: string; } declare interface R2Bucket { get(key: string, options?: unknown): Promise; head(key: string): Promise; list(options?: { prefix?: string; limit?: number; cursor?: string; delimiter?: string }): Promise; put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise; delete(key: string | string[]): Promise; } declare interface SqlStorageCursor> extends Iterable { one(): Row; toArray(): Row[]; } declare interface SqlStorage { exec>(query: string, ...bindings: unknown[]): SqlStorageCursor; } declare interface DurableObjectStorage { sql: SqlStorage; deleteAll(): Promise; } declare interface DurableObjectState { storage: DurableObjectStorage; blockConcurrencyWhile(callback: () => Promise): Promise; } declare abstract class DurableObject { protected readonly ctx: DurableObjectState; protected readonly env: unknown; constructor(ctx: DurableObjectState, env: unknown); } declare interface ExportedHandler { fetch(request: Request, env: Env, ctx: ExecutionContext): Response | Promise; } declare module "*.wasm" { const module: WebAssembly.Module; export default module; }