// Minimal Cloudflare runtime types so the framework typechecks without a hard // dependency on @cloudflare/workers-types being installed by the consumer. // // These are structural — anything matching the shape (including the real // types from `@cloudflare/workers-types`) is assignable. declare global { interface D1Database { prepare(query: string): D1PreparedStatement; batch(statements: D1PreparedStatement[]): Promise[]>; } interface D1PreparedStatement { bind(...values: unknown[]): D1PreparedStatement; first(colName?: string): Promise; all(): Promise>; run(): Promise; } interface D1Result { results?: T[]; success: boolean; meta: { changes: number }; } interface D1AllResult { results?: T[]; success: boolean; meta: { changes: number }; } interface D1RunResult { success: boolean; meta: { changes: number; last_row_id: number }; } interface R2Bucket { head(key: string): Promise; put(key: string, value: ArrayBuffer | ReadableStream | Blob | string, options?: R2PutOptions): Promise; } interface R2HeadResult { key: string; size: number; } interface R2Object { key: string; } interface R2PutOptions { httpMetadata?: { contentType?: string }; } interface ExecutionContext { waitUntil(promise: Promise): void; passThroughOnException(): void; } interface ScheduledEvent { cron: string; scheduledTime: number; } } export {};