From ea56e2218ff49063e4c5d92ec636916455c2d159 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 7 Nov 2021 14:56:48 +0100 Subject: [PATCH] fix(types): better types for TypedRouter.routeAndAddResponse --- ts/typedrequest.classes.typedrequest.ts | 2 +- ts/typedrequest.classes.typedrouter.ts | 2 +- ts/typedrequest.classes.typedtarget.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/typedrequest.classes.typedrequest.ts b/ts/typedrequest.classes.typedrequest.ts index d8bcc8b..7b8e803 100644 --- a/ts/typedrequest.classes.typedrequest.ts +++ b/ts/typedrequest.classes.typedrequest.ts @@ -21,7 +21,7 @@ export class TypedRequest routes a typed request object to request fire event * @param typedRequestArg */ - public async routeAndAddResponse(typedRequestArg: plugins.typedRequestInterfaces.ITypedRequest) { + public async routeAndAddResponse(typedRequestArg: T) { if (!typedRequestArg?.correlation?.phase || typedRequestArg.correlation.phase === 'request') { const typedHandler = this.getTypedHandlerForMethod(typedRequestArg.method); diff --git a/ts/typedrequest.classes.typedtarget.ts b/ts/typedrequest.classes.typedtarget.ts index 44f6d58..591ae50 100644 --- a/ts/typedrequest.classes.typedtarget.ts +++ b/ts/typedrequest.classes.typedtarget.ts @@ -6,6 +6,7 @@ export type IPostMethod = ( ) => Promise; /** + * this is an alternative to a post url supplied in `new Typedrequest(new TypedTarget(...), 'someMethodName')` * enables the use of custom post functions * used for things like broadcast channels * e.g. @designestate/dees-comms