edge-master
Version:
A Micro Framework for Edges
18 lines (17 loc) • 459 B
TypeScript
/// <reference types="@cloudflare/workers-types" />
export type IMatcher = (req: Request) => boolean;
export type RequestHandlerArgs<T = any> = {
req: Request;
env?: T;
exeCtx?: ExecutionContext;
};
export type Context = {
reqCtx: RequestHandlerArgs;
responder: (res: Response | PromiseLike<Response>) => void;
};
export type ContextWithReq = Context & {
req: Request;
};
export type ContextWithRes = Context & {
res: Response;
};