tapable icon indicating copy to clipboard operation
tapable copied to clipboard

Add context support for Hook TS types

Open adierkens opened this issue 4 years ago • 1 comments

TL;DR

  • Adds context support for the Hook interface
  • Ran prettier and adds tapable.d.ts to 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

adierkens avatar Feb 15 '22 01:02 adierkens

CLA Signed

The committers are authorized under a signed CLA.

  • :white_check_mark: Adam Dierkens (496abe4e597d670cfc151ee598211824151ad0cc)