UNPKG

winterspec

Version:

Write Winter-CG compatible routes with filesystem routing and tons of features

22 lines (21 loc) 982 B
import { EdgeRuntime } from "edge-runtime"; import type { BirpcReturn } from "birpc"; import { makeRequestAgainstWinterSpec } from "../../types/winter-spec.js"; import { Middleware } from "../../middleware/index.js"; import type { BundlerRpcFunctions } from "./types.js"; export declare class RequestHandlerController { private bundlerRpc; private middleware; private cachedWinterCGRuntime?; private cachedNodeHandler?; private buildLastUpdatedAt; constructor(bundlerRpc: BirpcReturn<BundlerRpcFunctions, any>, middleware: Middleware[]); /** * You **should not** cache the result of this function. Call it every time you want to use the runtime. */ getWinterCGRuntime(): Promise<EdgeRuntime<import("@edge-runtime/vm").EdgeContext>>; /** * You **should not** cache the result of this function. Call it every time you want to use the handler. */ getNodeHandler(): Promise<ReturnType<typeof makeRequestAgainstWinterSpec>>; }