New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add forMiddleware
types to Input
#2562
Conversation
Hi @nakasyou ! This is an interesting feature. Please let us know another use case, not only the WebSocket helper case. |
For example, you can create your protocol such as type-safe SSE: // server
import { typedSSE, sseClient } from 'hono-typed-sse'
import { Hono } from 'hono'
import { hc } from 'hono/client'
const app = new Hono().get('/sse', typedSSE<Data>(...))
// client
const client = hc<typeof app>('/')
const sse = sseClient(client.sse) In this case, this package can use |
Cool! I'll use it to know the feeling of using it. |
Hi @nakasyou Sorry for the delay. This is good. We can merge this. But one thing. I wonder if the naming Any thoughts? |
Hi @yusukebe, thank you for trying.
I agreed. I think so. So I changed. Also, I changed |
I added a
forMiddleware
prop toInput
.In WebSocket helper, helper uses
json
property for telling data to client, but I think it isn't smart because websocket helper actually doesn't use JSON.This PR adds properties for various helpers and middleware to tell data to clients.
In creating this PR, I enabled that
ToSchema
receivesInput
instead ofInput['in']
.Author should do the followings, if applicable
yarn denoify
to generate files for Deno