Created
December 25, 2021 15:00
-
-
Save Mathspy/4b2a32104f21dd0b1c49fa0e53ed94da to your computer and use it in GitHub Desktop.
Deno types for CloudFlare Workers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ExecutionContext { | |
waitUntil(promise: Promise<any>): void; | |
passThroughOnException(): void; | |
} | |
interface ExportedHandler<Env = unknown> { | |
fetch?: ExportedHandlerFetchHandler<Env>; | |
scheduled?: ExportedHandlerScheduledHandler<Env>; | |
} | |
declare type ExportedHandlerFetchHandler<Env = unknown> = (request: Request, env: Env, ctx: ExecutionContext) => Response | Promise<Response>; | |
declare type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>; | |
interface ScheduledController { | |
readonly scheduledTime: number; | |
readonly cron: string; | |
noRetry(): void; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment