webpack / tapable

Just a little module for plugins.
MIT License
3.71k stars 393 forks source link

Add context support for Hook TS types #172

Open adierkens opened 2 years ago

adierkens commented 2 years ago

TL;DR

--

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

linux-foundation-easycla[bot] commented 2 years ago

CLA Signed

The committers are authorized under a signed CLA.