/** * The three declarations a server body can carry a function in: a route, the * `@notFound` fallback, and the `@response` policy. * * D115 P4 R4a. Each one checks the same two things in its own vocabulary — * which inputs the framework supplies and what the result is allowed to be — * and each writes the lowering hint that lets the emitter and the OpenAPI * document describe what the types already decided. */ import { type Expression, type Span, type ValueType } from "@velarscript/compiler/extension"; import { type NodeNotFoundDeclaration, type NodeResponseDeclaration, type NodeRouteDeclaration } from "../server-ast.ts"; import { type NodeRouteInputType } from "../server-types.ts"; import { type RouteAnalysisHost } from "./routes.ts"; /** * What a handler asks of the analyzer that hosts it. The two input tables are * written by the contextual-default seam as the signature is read and consulted * here as the body is checked, so they arrive live through the host. */ export interface HandlerAnalysisHost extends RouteAnalysisHost { readonly contextualRouteParameters: ReadonlyMap; readonly routeInputs: ReadonlyMap; analyzeFunctionDeclaration(statement: NodeNotFoundDeclaration | NodeResponseDeclaration | NodeRouteDeclaration, className: string | null, method: boolean, declareSelf: boolean, forceAsynchronous: boolean, declarationKind: string): void; inferExpression(expression: Expression, contextualType: ValueType): ValueType; inferredFunctionResult(statement: NodeNotFoundDeclaration | NodeResponseDeclaration | NodeRouteDeclaration): ValueType; requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span): void; } export declare function analyzeNotFound(host: HandlerAnalysisHost, fallback: NodeNotFoundDeclaration): void; export declare function analyzeResponse(host: HandlerAnalysisHost, handler: NodeResponseDeclaration): void; export declare function analyzeRoute(host: HandlerAnalysisHost, route: NodeRouteDeclaration): void; //# sourceMappingURL=handlers.d.ts.map