diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/worker.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/worker.ts b/src/worker.ts index e982634..186887d 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -2,17 +2,19 @@ import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { handle } from '@astrojs/cloudflare/handler'; import { handleSchedule } from './functions/scheduled'; +import type { ExecutionContext } from '@cloudflare/workers-types'; export function createExports(manifest: SSRManifest) { const app = new App(manifest); return { default: { - async fetch(request, env, ctx) { + async fetch(request: Request, env: Env, ctx: ExecutionContext) { + // @ts-expect-error - https://github.com/withastro/astro/issues/14038 return handle(manifest, app, request, env, ctx); }, - async scheduled(controller, env, ctx) { + async scheduled(controller: ScheduledController, env: Env, ctx: ExecutionContext) { return await handleSchedule(controller, env, ctx); } - } + } satisfies ExportedHandler<Env> }; } |
