From 191c20e64905352bc67de9cad4d4bdba2e9f992f Mon Sep 17 00:00:00 2001 From: Kyle Chisholm Date: Mon, 30 Mar 2020 19:47:52 -0400 Subject: [PATCH] Replace method generic type to for request and response data (#43463) --- types/socketcluster-client/lib/clientsocket.d.ts | 4 ++-- types/socketcluster-client/socketcluster-client-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/socketcluster-client/lib/clientsocket.d.ts b/types/socketcluster-client/lib/clientsocket.d.ts index d843e8f9c7..c268364e57 100644 --- a/types/socketcluster-client/lib/clientsocket.d.ts +++ b/types/socketcluster-client/lib/clientsocket.d.ts @@ -144,7 +144,7 @@ declare class AGClientSocket extends AsyncStreamEmitter implements AGChanne isSubscribed(channelName: string, includePending?: boolean): boolean; transmitPublish(channelName: string, data: any): Promise; - invokePublish(channelName: string, data: T): Promise<{ channel: string; data: T }>; + invokePublish(channelName: string, data: any): Promise<{ channel: string; data: any }>; /* AGChannel.Client end */ @@ -175,7 +175,7 @@ declare class AGClientSocket extends AsyncStreamEmitter implements AGChanne send(data: any): void; transmit(event: string, data: any, options?: { ackTimeout?: number }): Promise; - invoke(event: string, data: T, options?: { ackTimeout?: number }): Promise; + invoke(event: string, data: any, options?: { ackTimeout?: number }): Promise; startBatch(): void; flushBatch(): void; diff --git a/types/socketcluster-client/socketcluster-client-tests.ts b/types/socketcluster-client/socketcluster-client-tests.ts index 5e9078c0f4..4cfe073107 100644 --- a/types/socketcluster-client/socketcluster-client-tests.ts +++ b/types/socketcluster-client/socketcluster-client-tests.ts @@ -10,7 +10,7 @@ const socket = create({ socket.transmit('foo', 123); (async () => { - // $ExpectType number + // $ExpectType any await socket.invoke('myProc', 123); })(); @@ -51,7 +51,7 @@ socket.transmitPublish('myChannel', 'This is a message'); // $ExpectType string response.channel; - // $ExpectType string + // $ExpectType any response.data; } catch (error) {} })();