import type { ExportedHandler, Message, MessageBatch, Request, Response, ScheduledController } from "@cloudflare/workers-types"; import type { Data } from "@edgefirst-dev/data"; import type { WorkerKVRateLimit } from "@edgefirst-dev/worker-kv-rate-limit"; import type { Logger } from "drizzle-orm"; import type { Job } from "./lib/jobs/job.js"; import type { Task } from "./lib/tasks/task.js"; import type { Bindings, DatabaseSchema } from "./lib/types.js"; export declare function bootstrap(options: bootstrap.Options): ExportedHandler; export declare namespace bootstrap { interface Options { /** The options for the ORM. */ orm?: { /** The database schema for the ORM. */ schema: DatabaseSchema; /** The logger for the ORM. */ logger?: Logger; }; /** The options for the rate limit. */ rateLimit?: WorkerKVRateLimit.Options; /** A function that returns the list of jobs to register */ jobs?(): Job[]; tasks?(): Task[]; onJobError?(error: unknown, message: Message): void; onTaskError?(error: unknown, task: Task): void; /** The function that will run every time a new request comes in */ onRequest(request: Request, bindings: Bindings, ctx: ExecutionContext): Promise; /** The function that will run every time a scheduled task is executed */ onSchedule?(event: ScheduledController, bindings: Bindings, ctx: ExecutionContext): Promise; /** The function that will run every time a queue message is consumed */ onQueue?(batch: MessageBatch, bindings: Bindings, ctx: ExecutionContext): Promise; } }