import type { IncomingMessage as HttpRequest, ServerResponse } from "node:http"; /** * The concurrency precondition every Todo edit carries: the version the caller * believes it is editing, supplied either as `expectedVersion` in the body or * as an `If-Match` ETag. An edit with neither is refused before it is read — * blind writes are how two agents overwrite each other silently. * * Also the two request-framing checks the edit route makes before parsing: * a well-formed `Content-Length` and an uncompressed body. */ export type TodoEditPrecondition = { ok: true; expectedVersion: number; } | { ok: false; status: 400 | 428; body: { error: string; code: 'todo_precondition_required' | 'todo_invalid_version'; }; }; export declare function readTodoEditPrecondition(req: HttpRequest, body: Record): TodoEditPrecondition; type TodoEditValidationCode = 'todo_invalid_patch' | 'todo_invalid_assignee'; export declare function todoEditValidationError(res: ServerResponse, error: string, code?: TodoEditValidationCode): void; /** `undefined` when the header is absent, `null` when it is unusable. */ export declare function todoEditContentLength(value: string | string[] | undefined): number | undefined | null; export declare function hasSupportedTodoEditContentEncoding(value: string | string[] | undefined): boolean; export {}; //# sourceMappingURL=todo-edit-precondition.d.ts.map