diff --git a/package-lock.json b/package-lock.json index 2e87d4e..c22b69a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "license": "Apache-2.0", "dependencies": { "@matrixai/async-init": "^1.9.4", diff --git a/package.json b/package.json index c63d3c8..3eb1198 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "author": "Matrix AI", "contributors": [ { diff --git a/src/handlers/ClientHandler.ts b/src/handlers/ClientHandler.ts index 6a3c93f..0aea354 100644 --- a/src/handlers/ClientHandler.ts +++ b/src/handlers/ClientHandler.ts @@ -8,12 +8,12 @@ abstract class ClientHandler< Input extends JSONValue = JSONValue, Output extends JSONValue = JSONValue, > extends Handler { - public handle = async function* ( + public handle = async ( input: AsyncIterableIterator, cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { + ): Promise => { throw new ErrorRPCMethodNotImplemented(); }; } diff --git a/src/handlers/RawHandler.ts b/src/handlers/RawHandler.ts index 500ce99..01fd1d7 100644 --- a/src/handlers/RawHandler.ts +++ b/src/handlers/RawHandler.ts @@ -6,16 +6,13 @@ import { ErrorRPCMethodNotImplemented } from '../errors'; abstract class RawHandler< Container extends ContainerType = ContainerType, - Input extends JSONValue = JSONValue, // Define Input type if needed - Output extends JSONValue = JSONValue, // Define Output type if needed > extends Handler { - public handle = async function* ( - input: AsyncIterableIterator, // Change this based on your specific needs + public handle = async ( + input: [JSONRPCRequest, ReadableStream], cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { - // Change return type to AsyncIterableIterator + ): Promise<[JSONValue, ReadableStream]> => { throw new ErrorRPCMethodNotImplemented('This method must be overridden'); }; } diff --git a/src/handlers/UnaryHandler.ts b/src/handlers/UnaryHandler.ts index 22ee1e2..0a1e37b 100644 --- a/src/handlers/UnaryHandler.ts +++ b/src/handlers/UnaryHandler.ts @@ -8,12 +8,12 @@ abstract class UnaryHandler< Input extends JSONValue = JSONValue, Output extends JSONValue = JSONValue, > extends Handler { - public handle = async function* ( + public handle = async ( input: Input, cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { + ): Promise => { throw new ErrorRPCMethodNotImplemented('This method must be overridden'); }; }