From 1055c845f63748fb78598b6312d06d923de9f2bc Mon Sep 17 00:00:00 2001 From: igio Date: Tue, 16 Feb 2021 17:00:14 +0000 Subject: [PATCH 1/2] fix: set withConfig return type to include correct properties Current behavior: withConfig return type - does contain callAsync, which doesn't exist - doesn't contain tapAsync or tapPromise, which does exist Expected behavior: withConfig return type - should be limited to return value in source - should include properties depends on the current child instance related withConfig source code: https://github.com/webpack/tapable/blob/413fa785018406464963c29d172e06d2df42f22e/lib/Hook.js#L105 --- tapable.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tapable.d.ts b/tapable.d.ts index d77f31b..5d52646 100644 --- a/tapable.d.ts +++ b/tapable.d.ts @@ -63,7 +63,7 @@ declare class Hook { callAsync(...args: Append, Callback>): void; promise(...args: AsArray): Promise; tap(options: string | Tap & IfSet, fn: (...args: AsArray) => R): void; - withOptions(options: TapOptions & IfSet): Hook; + withOptions(options: TapOptions & IfSet): Omit; } export class SyncHook extends Hook { From 0ab826bdb6aacf08b09fb20a8aeac14999f1695b Mon Sep 17 00:00:00 2001 From: Ferdi Date: Wed, 17 Feb 2021 12:18:35 +0000 Subject: [PATCH 2/2] omit promise field and fix linting Co-authored-by: Tobias Koppers --- tapable.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tapable.d.ts b/tapable.d.ts index 5d52646..c2897a5 100644 --- a/tapable.d.ts +++ b/tapable.d.ts @@ -63,7 +63,7 @@ declare class Hook { callAsync(...args: Append, Callback>): void; promise(...args: AsArray): Promise; tap(options: string | Tap & IfSet, fn: (...args: AsArray) => R): void; - withOptions(options: TapOptions & IfSet): Omit; + withOptions(options: TapOptions & IfSet): Omit; } export class SyncHook extends Hook {