From 666bff50137ba3d7a67fee95fbdde78517f026b3 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Thu, 8 Dec 2016 21:33:05 +0800 Subject: [PATCH] feat: upgrade to tapbale v0.2.5 --- tapable/index.d.ts | 12 ++++++++++-- tapable/tapable-tests.ts | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tapable/index.d.ts b/tapable/index.d.ts index 01df2aa803..4fd56603ca 100644 --- a/tapable/index.d.ts +++ b/tapable/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for tapable v0.2.4 +// Type definitions for tapable v0.2.5 // Project: http://github.com/webpack/tapable.git // Definitions by: e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare abstract class Tapable { private _plugins: { - [index: string]: Tapable.Handler[] + [propName: string]: Tapable.Handler[] } /** @@ -37,6 +37,12 @@ declare abstract class Tapable { */ applyPlugins(name: string, ...args: any[]): void; + applyPlugins0(name: string): void; + + applyPlugins1(name: string, param: any): void; + + applyPlugins2(name: string, param1: any, param2: any): void; + /** * synchronously applies all registered handlers for target name(event id). * @@ -103,6 +109,8 @@ declare abstract class Tapable { */ applyPluginsAsyncSeries(name: string, ...args: any[]): void; + applyPluginsAsyncSeries1(name: string, param: any, callback: Tapable.CallbackFunction): void + /** * asynchronously applies all registered handlers for target name(event id). * diff --git a/tapable/tapable-tests.ts b/tapable/tapable-tests.ts index eca641655c..fce410defa 100644 --- a/tapable/tapable-tests.ts +++ b/tapable/tapable-tests.ts @@ -29,12 +29,16 @@ let callback: Tapable.CallbackFunction = function () { compiler.apply(new DllPlugin()); compiler.applyPlugins('doSomething', 'a', 'b'); +compiler.applyPlugins0('doSomething'); +compiler.applyPlugins1('doSomething', 'a'); +compiler.applyPlugins2('doSomething', 'a', 'b'); compiler.applyPluginsWaterfall('doSomething', 'a', 'b'); compiler.applyPluginsWaterfall0('doSomething', 'a'); compiler.applyPluginsBailResult('doSomething', 'a', 'b'); compiler.applyPluginsBailResult1('doSomething', ['a', 'b']); compiler.applyPluginsAsync('doSomething', 'a', 'b'); compiler.applyPluginsAsyncSeries('doSomething', 'a', 'b'); +compiler.applyPluginsAsyncSeries1('doSomething', 'a', callback); compiler.applyPluginsAsyncSeriesBailResult('doSomething', 'a', 'b'); compiler.applyPluginsAsyncSeriesBailResult1('doSomething', 'a', callback); compiler.applyPluginsAsyncWaterfall('doSomething', 'a', callback);