diff --git a/packages/feathers/index.d.ts b/packages/feathers/index.d.ts index 985a018c01..b48a914180 100644 --- a/packages/feathers/index.d.ts +++ b/packages/feathers/index.d.ts @@ -49,9 +49,9 @@ declare namespace createApplication { } // tslint:disable-next-line void-return - type Hook = (hook: HookContext) => (Promise | HookContext | void); + type Hook> = (hook: HookContext) => (Promise | void> | HookContext | void); - interface HookContext { + interface HookContext> { /** * A read only property that contains the Feathers application object. This can be used to * retrieve other services (via context.app.service('name')) or configuration values. @@ -101,7 +101,7 @@ declare namespace createApplication { /** * A read only property and contains the service this hook currently runs on. */ - readonly service: Service; + readonly service: S; /** * A writeable, optional property and contains a 'safe' version of the data that * should be sent to any client. If context.dispatch has not been set context.result