Closed AshotN closed 9 months ago
This PR updates the generators for *.schema files to include a type for HookContext.
*.schema
HookContext
Without typing HookContext<Service> the revolvers experience type issues.
HookContext<Service>
With this PR, the only place that the generator doesn't type HookContext is in the logError hook, which can easily be typed to any
logError
any
After-which, we can remove the default for the HookContext generic. https://github.com/feathersjs/feathers/blob/dove/packages/generators/src/app/templates/declarations.tpl.ts#L30
I propose to replace the default HookContext<S = any> to HookContext<S extends ServiceMethods>
HookContext<S = any>
HookContext<S extends ServiceMethods>
Summary
This PR updates the generators for
*.schema
files to include a type forHookContext
.Without typing
HookContext<Service>
the revolvers experience type issues.Other Information
With this PR, the only place that the generator doesn't type
HookContext
is in thelogError
hook, which can easily be typed toany
After-which, we can remove the default for the
HookContext
generic. https://github.com/feathersjs/feathers/blob/dove/packages/generators/src/app/templates/declarations.tpl.ts#L30I propose to replace the default
HookContext<S = any>
toHookContext<S extends ServiceMethods>