From 3277aa827b85cc3520d335af9dfb140fb5c7fbdd Mon Sep 17 00:00:00 2001 From: David Johnson Date: Thu, 17 Jan 2019 17:31:50 -0700 Subject: [PATCH 1/2] types/hapi: ServerMethod doesn't have to return Promise --- types/hapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 65ce60be85..3c546f71f4 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2704,7 +2704,7 @@ export interface ServerInjectResponse extends Shot.ResponseObject { * * * ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) */ -export type ServerMethod = (...args: any[]) => Promise; +export type ServerMethod = (...args: any[]) => any; /** * The same cache configuration used in server.cache(). From 3f6d69bf544701b9976e21020273e26b6bbd311a Mon Sep 17 00:00:00 2001 From: David Johnson Date: Thu, 17 Jan 2019 17:45:59 -0700 Subject: [PATCH 2/2] types/hapi: ServerMethod doesn't have to return Promise --- types/hapi/test/server/server-method.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/test/server/server-method.ts b/types/hapi/test/server/server-method.ts index bb729516b7..39c3fdb9d7 100644 --- a/types/hapi/test/server/server-method.ts +++ b/types/hapi/test/server/server-method.ts @@ -6,7 +6,7 @@ const server = new Server({ }); server.start(); -const add = (a: any, b: any) => { +const add = (a: any, b: any): number => { return a + b; };