Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/treaty2/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class EdenWS<in out Schema extends InputSchema<any> = {}> {

on<K extends keyof WebSocketEventMap>(
type: K,
listener: (event: Treaty.WSEvent<K, Schema['response']>) => void,
listener: (event: Treaty.WSEvent<K, Schema['response'][200]>) => void,
options?: boolean | AddEventListenerOptions
) {
return this.addEventListener(type, listener, options)
Expand All @@ -43,7 +43,7 @@ export class EdenWS<in out Schema extends InputSchema<any> = {}> {

subscribe(
onMessage: (
event: Treaty.WSEvent<'message', Schema['response']>
event: Treaty.WSEvent<'message', Schema['response'][200]>
) => void,
options?: boolean | AddEventListenerOptions
) {
Expand All @@ -52,7 +52,7 @@ export class EdenWS<in out Schema extends InputSchema<any> = {}> {

addEventListener<K extends keyof WebSocketEventMap>(
type: K,
listener: (event: Treaty.WSEvent<K, Schema['response']>) => void,
listener: (event: Treaty.WSEvent<K, Schema['response'][200]>) => void,
options?: boolean | AddEventListenerOptions
) {
this.ws.addEventListener(
Expand Down