/** * Lightweight request body validation for HTTP routes. * Prefer these helpers over `JSON.parse(...) as { field?: string }` for new code. * * Secondary-dev checklist: * 1. readJsonBody(req) * 2. requireString / requireEnum / optionalString * 3. throw YskError → sendError (or let outer catch) */ import type { IncomingMessage } from 'node:http'; export type JsonObject = Record; /** Parse JSON body; empty body → {}. Invalid JSON → 400. */ export declare function readJsonBody(req: IncomingMessage): Promise; export declare function requireString(data: JsonObject, key: string, opts?: { min?: number; max?: number; trim?: boolean; }): string; export declare function optionalString(data: JsonObject, key: string, opts?: { max?: number; }): string | undefined; export declare function requireEnum(data: JsonObject, key: string, allowed: readonly T[]): T; export declare function optionalBoolean(data: JsonObject, key: string): boolean | undefined; export declare function optionalNumber(data: JsonObject, key: string, opts?: { min?: number; max?: number; }): number | undefined; //# sourceMappingURL=validate.d.ts.map