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
forMiddlewareprop toInput.In WebSocket helper, helper uses
jsonproperty 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
ToSchemareceivesInputinstead ofInput['in'].Author should do the followings, if applicable
yarn denoifyto generate files for Deno