hono
hono copied to clipboard
`outputFormat` supports Response
What is the feature you are proposing?
I want outputFormat to support Response.
Currently, outputFormat supports only Handler:
import { Hono } from 'hono'
import { customHandler } from './xxx' // CustomHandler has `outputFormat` type in Input
const app = new Hono()
app.get('/', customHandler)
I want make helper, it makes response.
import { Hono } from 'hono'
import { customHelper } from './xxx'
const app = new Hono()
app.get('/', () => {
return customHelper() // I want Response to have `outputFormat`
})
Because I want to make helper and client for helper.
Hi @nakasyou, do you have a PoC of the helper you're creating?, If the customHelper() returns a Response I think currently we could do:
const customHelper = (): Response & TypedResponse => {}
And it would fully support our current type interface.