// Minimal types for the Workers runtime modules this viewer imports. tsconfig.json does not load the generated // runtime types (`cf workers types`); these declarations cover only what rate.ts touches. // A missing storage value is the global PlatformAbsent brand from src/absent.ts. The host still returns its own hole. declare module 'cloudflare:workers' { export abstract class WorkerEntrypoint { ctx: unknown; env: Env; constructor(ctx: unknown, env: Env); fetch?(req: Request): Promise; } export abstract class DurableObject { ctx: DurableObjectState; env: Env; constructor(ctx: DurableObjectState, env: Env); alarm?(): Promise; } export interface DurableObjectState { storage: DurableObjectStorage; blockConcurrencyWhile(fn: () => Promise): Promise; } export interface DurableObjectStorage { get(key: string): Promise; put(key: string, value: T): Promise; put(key: string, value: T, options: { allowUnconfirmed: boolean }): Promise; getAlarm(): Promise; setAlarm(scheduledTime: number): Promise; sql: SqlStorage; } export interface SqlStorage { exec = Record>(query: string, ...bindings: SqlValue[]): SqlCursor; } export type SqlValue = string | number | null | ArrayBuffer; export interface SqlCursor { toArray(): T[]; one(): T; readonly rowsWritten: number; } }