/** * What a value is, seen as a response: the shapes `velar/serve` builds, the * predicates that decide whether a route may return one, and the two * constructors that carry a response's compile-time metadata alongside it. * * D115 P4 R4a. `Data` is the recursive half — a record whose every field is * itself Data — and it is asked here rather than in the analyzer because the * intrinsics, the handlers and the OpenAPI derivation all ask it, and one * question answered in three places is how three answers start to differ. */ import { type CompilerIntrinsicAnalysisContext, type ValueType } from "@velarscript/compiler/extension"; import { type RouteParameterKind } from "../contracts.ts"; export declare function literalStatus(expression: ReturnType, fallback: number): number | null; export declare function nodeResponseValue(body: "json" | "text" | "stream", value: ValueType, status: number | null, contentType: string): ValueType; export declare function nodeOutcomeValue(value: ValueType, status: number | null): ValueType; export declare function scalarKind(type: ValueType): Extract | null; export declare function isNamedDataRecord(type: ValueType, fieldsOf: (identity: string) => ReadonlyMap | null, seen: ReadonlySet): boolean; export declare function isResponseShape(type: ValueType): boolean; export declare function requireResponseValue(context: CompilerIntrinsicAnalysisContext, type: ValueType, span: Parameters[1]): void; export declare function isRouteResult(type: ValueType, fieldsOf: (identity: string) => ReadonlyMap | null, seen: ReadonlySet): boolean; /** * 响应策略是语义结果到最终表示的最后一步,因此不能再返回一个 HttpOutcome; * 否则会形成第二轮策略选择,并让“只编码一次”的边界变得含糊。 */ export declare function isResponsePolicyResult(type: ValueType, fieldsOf: (identity: string) => ReadonlyMap | null, seen: ReadonlySet): boolean; //# sourceMappingURL=response-shapes.d.ts.map