© 2026 Hedgehog Software, LLC
c.json()
hono.Handler<..>
type MyResponse = {someType: string}; type MyHandlerResponse = hono.HandlerResponse<MyResponse>; type MyHandler = hono.Handler<any, any, any, MyHandlerResponse>
c.json({...})
c.json('') // No type error, even though it should be an object. I get suggestions though, see video
export type HandlerResponse<O> = Response | TypedResponse<O> | Promise<Response | TypedResponse<O>>; export type TypedResponse<T = unknown, U extends StatusCode = StatusCode, F extends ResponseFormat = T extends string ? 'text' : T extends JSONValue ? 'json' : ResponseFormat> = { _data: T; _status: U; _format: F; };