tapable
tapable copied to clipboard
Add context support for Hook TS types
TL;DR
- Adds
contextsupport for the Hook interface - Ran
prettierand addstapable.d.tsto the list of files to format
--
Happy to split this PR up into 2 if that makes it easier to review.
The main change was the addition of another parameter to the base Hook interface for Context, that's then passed down to the HookInterceptor type, which is now a discriminated union based on the presence of the context: true parameter to the intercept() call and augments the expected arguments.
I also updated the args in call() and loop() to leverage the argument types in their signature (instead of any[])
Fixes #171