Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions deno_dist/client/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { UpgradedWebSocketResponseInputJSONType } from '../helper/websocket/index.ts'
import type { Hono } from '../hono.ts'
import type { Endpoint, ResponseFormat, Schema } from '../types.ts'
import type { StatusCode, SuccessStatusCode } from '../utils/http-status.ts'
Expand Down Expand Up @@ -34,10 +33,10 @@ export type ClientRequest<S extends Schema> = {
: {}
: {}
) => URL
} & (S['$get'] extends { input: { json: UpgradedWebSocketResponseInputJSONType } }
} & (S['$get'] extends { outputFormat: 'ws' }
? S['$get'] extends { input: infer I }
? {
$ws: (args?: Omit<I, 'json'>) => WebSocket
$ws: (args?: I) => WebSocket
}
: {}
: {})
Expand Down
6 changes: 1 addition & 5 deletions deno_dist/helper/websocket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export interface WSEvents {
onError?: (evt: Event, ws: WSContext) => void
}

export type UpgradedWebSocketResponseInputJSONType = '__websocket'

/**
* Upgrade WebSocket Type
*/
Expand All @@ -23,9 +21,7 @@ export type UpgradeWebSocket = (
any,
string,
{
in: {
json: UpgradedWebSocketResponseInputJSONType
}
outputFormat: 'ws'
}
>

Expand Down
Loading