From 1067f5ae62e72ed0bbb5d81d315dc78165fd3301 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Tue, 29 Nov 2016 18:18:18 +0800 Subject: [PATCH] fix: add this type references for some methods --- tapable/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tapable/index.d.ts b/tapable/index.d.ts index 68ea3e4104..01df2aa803 100644 --- a/tapable/index.d.ts +++ b/tapable/index.d.ts @@ -16,16 +16,16 @@ declare abstract class Tapable { * @param names a string or an array of strings to generate the id(group name) of plugins * @param handler a function which provides the plugin functionality * */ - plugin(names: string, handler: Tapable.Handler): void; + plugin(names: string, handler: (this: this, ...args: any[]) => void): void; - plugin(names: string[], handler: Tapable.Handler): void; + plugin(names: string[], handler: (this: this, ...args: any[]) => void): void; /** * invoke all plugins with this attached. * This method is just to "apply" plugins' definition, so that the real event listeners can be registered into * registry. Mostly the `apply` method of a plugin is the main place to place extension logic. */ - apply(...plugins: Tapable.Plugin[]): void; + apply(...plugins: (((this: this) => any) | Tapable.Plugin)[]): void; /** * synchronously applies all registered handlers for target name(event id).