import type { Response } from "express"; export interface ApiOk { ok: true; data: T; meta?: Record; } export interface ApiError { ok: false; error: string; message: string; } export type ApiResponse = ApiOk | ApiError; export declare function ok(res: Response, data: T, meta?: Record, status?: number): Response>; export declare function created(res: Response, data: T): Response>; export declare function notFound(res: Response, message?: string): Response>; export declare function badRequest(res: Response, message: string): Response>; export declare function serverError(res: Response, err: unknown): Response>; export declare function noContent(res: Response): Response>; /** * FR-D6: for a route that is mounted and routable but does no work. * * The alternative this replaces is the one that shipped: returning `ok:true` * with a state noun ("staged") for a payload that was parsed and discarded. * Every consumer of this API branches on `ok` — packages/engram-dashboard does * it at client.ts:59 — so a truthful `ok:false` is the only value that reaches * a user as the truth. 501 rather than 500 because nothing went wrong: the * feature is absent, which is a fact about the server, not an incident. */ export declare function notImplemented(res: Response, message: string): Response>; //# sourceMappingURL=api-helpers.d.ts.map