edge-master
Version:
A Micro Framework for Edges
11 lines (10 loc) • 389 B
TypeScript
/// <reference types="@cloudflare/workers-types" />
import { ContextWithReq, ContextWithRes } from './base';
export type TaskContext = ContextWithReq & ContextWithRes;
export type TaskDuty = (args: TaskContext) => Promise<Response>;
export type Condition = (args: TaskContext) => boolean;
export type TaskConstructArgs = {
do: TaskDuty;
when?: Condition;
doThen?: TaskDuty;
};