import type { Context } from 'hono'; import type { ContentfulStatusCode } from 'hono/utils/http-status'; import type { Result } from './types.mjs'; export type SuccessEnvelope = { code: 'SUCCESS'; data: T; }; export type ErrorResponse = { message: string; }; /** * Convert Result to properly typed HTTP response * * Success responses use envelope { code: 'SUCCESS', data: T } for future extensibility * Error responses use simple { message: string } format * * @param result - Result from command/repository * @param successStatus - HTTP status code for success (default 200) * @returns Function that takes Context and returns typed response * * @example * const result = await createOrganisation(data) * return resultToResponse(result, 201)(c) */ export declare const resultToResponse: (result: Result, successStatus?: ContentfulStatusCode) => (c: Context) => (Response & import("hono").TypedResponse<"SUCCESS" | T extends bigint | readonly bigint[] ? never : { [K in keyof { code: "SUCCESS"; data: T; } as (SuccessEnvelope[K] extends infer T_1 ? T_1 extends SuccessEnvelope[K] ? T_1 extends import("hono/utils/types").InvalidJSONValue ? true : false : never : never) extends true ? never : K]: boolean extends (SuccessEnvelope[K] extends infer T_2 ? T_2 extends SuccessEnvelope[K] ? T_2 extends import("hono/utils/types").InvalidJSONValue ? true : false : never : never) ? import("hono/utils/types").JSONParsed[K], bigint | readonly bigint[]> | undefined : import("hono/utils/types").JSONParsed[K], bigint | readonly bigint[]>; }, ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 404, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 409, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 400, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 401, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 403, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 503, "json">) | (Response & import("hono").TypedResponse<{ message: string; }, 500, "json">);