1declare module "cloudflare:workers" {
2 export const env: Record<string, unknown>;
3 export const waitUntil: (promise: Promise<unknown>) => void;
4 /** Minimal structural declaration for the fixture (no @cloudflare/workers-types in `types` to avoid DOM lib conflicts). */
5 export abstract class DurableObject<Env = unknown> {
6 protected ctx: {
7 storage: {
8 sql: {
9 exec(
10 query: string,
11 ...bindings: Array<unknown>
12 ): {
13 toArray(): Array<Record<string, unknown>>;
14 };
15 };
16 };
17 };
18 protected env: Env;
19 constructor(ctx: unknown, env: unknown);
20 }
21}
22
23/**
24 * The import seam for wrapping waku's server handler from a custom worker
25 * entry: resolved by `makeWakuServerEntryPlugin` (injected by the waku
26 * integration for every deploy target) to
27 * `<wakuDirectory>/dist/lib/vite-entries/entry.server.js` (whose default
28 * export is the adapter's ExportedHandler). See README.
29 */
30declare module "virtual:waku/server-entry" {
31 const handler: {
32 fetch(
33 request: Request,
34 env: unknown,
35 ctx: unknown,
36 ): Response | Promise<Response>;
37 };
38 export default handler;
39}