From 87bec82fdafc0bb6a753ae590896bd487505c64d Mon Sep 17 00:00:00 2001 From: Aponia Date: Sun, 18 Aug 2024 02:16:34 -0700 Subject: [PATCH] fix(treaty2): ws exposed data type should be the success response type --- src/treaty2/ws.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/treaty2/ws.ts b/src/treaty2/ws.ts index 75da87a..903defe 100644 --- a/src/treaty2/ws.ts +++ b/src/treaty2/ws.ts @@ -25,7 +25,7 @@ export class EdenWS = {}> { on( type: K, - listener: (event: Treaty.WSEvent) => void, + listener: (event: Treaty.WSEvent) => void, options?: boolean | AddEventListenerOptions ) { return this.addEventListener(type, listener, options) @@ -43,7 +43,7 @@ export class EdenWS = {}> { subscribe( onMessage: ( - event: Treaty.WSEvent<'message', Schema['response']> + event: Treaty.WSEvent<'message', Schema['response'][200]> ) => void, options?: boolean | AddEventListenerOptions ) { @@ -52,7 +52,7 @@ export class EdenWS = {}> { addEventListener( type: K, - listener: (event: Treaty.WSEvent) => void, + listener: (event: Treaty.WSEvent) => void, options?: boolean | AddEventListenerOptions ) { this.ws.addEventListener(