Files
DefinitelyTyped/tapable/index.d.ts
Andy 05e9c858cf Merge 20dec (#13471)
* base-64 typings

* formatting and indenting

* feat: add typings for watchpack

* fix: improve missing typings

* Port from https://github.com/agileek/typings-vis/blob/master/vs.d.ts

* Fix travis build failures

* Port PR https://github.com/agileek/typings-vis/pull/12

* Fix travis build failures

* added tsconfig and tslint

* removed patch number

* added tests

* made it export like base64-js

* removed old code

* formatted code

* fix: add files field in tsconfig.json for expected publishment

* fix: improve most missing typings

* feat: upgrade to v3.0.0

* feat: upgrade to tapbale v0.2.5

* Types 2.0 (#13261)

* updating typing of the latest 7.0 react-autosuggest

* updating typing of react-autosuggest 7.0

* update typings for react-autosuggest 7.0

* Remove '+' from header versions, so they can be parsed (#13239)

* Updated masonry-layout to fix linting errors (#13272)

* Updated masonry-layout to fix linting errors

* Fixed the tests I could fix.

* Removed patch version

* Add redux-persist and basic transformers (#13389)

* Add definitions for redux-persist

* Add missin generic types

* Add definitions for filter transformer

* Add definitions for encrypt transformer

* Fix header

* Add definitions for compress transformer

* Delete unnecessary linter configs

* Change way of importing, fix tests

* fix: angulartics type definition for ES6 import

* fix: lint error

* fix scalar type config (#13398)

The `GraphQLScalarTypeConfig` interface had incorrect types. Correct types may be seen here: 379a308439/src/type/definition.js (L348-L350)

* [interact.js] Update module names (#13316)

Update CommonJS module name as it was changed in version 1.2.7.
AMD module name is also different from both new and old CommonJS module names, so a separate declaration was created for that as well.

* Add definitions for redux-recycle (#13424)

* Add definitions for redux-recycle

* Fix linter errors

* [jest] add type definition for toHaveBeenLastCalledWith (#13038)

* remove ajv because the package bundles its own types (#13028)

* Updated type definitions to yfiles for HTML 2.0. (#13332)

* Updated type definitions to yFiles for HTML 2.0.

* Updated type definitions to yfiles for HTML 2.0.

* Added contact in yfiles .d.ts header.

* Add redux-batched-actions typings. (#13054)

* Add types for mailgen (#13080)

* Typings for cordova-sqlite-storage (#13081)

* Add flatpickr definitions (#13083)

* Add pouch-redux-middleware typing (#13071)

* Add pouch-redux-middleware typing

* Fix <> in comment

* Add declaration for crc (#13068)

* Updated jquery.dataTables for 1.10.9 (#13099)

Release Notes: https://cdn.datatables.net/1.10.9/

* Moved legacy browser settings to its own data type.
* Added 'aIds' property on legacy settings object for mapping row ids to data indexes.
* Added 'rowIdFn' function to legacy settings object to get a row's id from the row's data.

* chore(lint): change vis typing to external module (#13399)

* Fix cordova-sqlite-storage lint

* Lint `vis`: Remove "I" prefix for namespaces

* Change cordova-sqlite-storage back. Linter was wrong.
2016-12-20 11:55:40 -08:00

214 lines
8.1 KiB
TypeScript

// Type definitions for tapable v0.2.5
// Project: http://github.com/webpack/tapable.git
// Definitions by: e-cloud <https://github.com/e-cloud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare abstract class Tapable {
private _plugins: {
[propName: string]: Tapable.Handler[]
}
/**
* Register plugin(s)
* This acts as the same as on() of EventEmitter, for registering a handler/listener to do something when the
* signal/event happens.
*
* @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: (this: this, ...args: any[]) => void): 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: (((this: this) => any) | Tapable.Plugin)[]): void;
/**
* synchronously applies all registered handlers for target name(event id).
*
* The handlers are called with all the rest arguments.
*
* @param name - plugin group name
* @param args
*/
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).
*
* The handlers are called with the return value of the previous handler and all the rest arguments.
*
* `init` is used for the first handler.
*
* return the returned value of the last handler
*/
applyPluginsWaterfall(name: string, init: any, ...args: any[]): any;
/**
* synchronously applies all registered handlers for target name(event id).
*
* The handlers are called ONLY with the return value of the previous handler.
*
* `init` is used for the first handler.
*
* return the returned value of the last handler
*/
applyPluginsWaterfall0(name: string, init: any): any;
/**
* synchronously applies all registered handlers for target name(event id).
*
* The handlers are called with all the rest arguments.
*
* If a handler returns something !== undefined, that value is returned and no more handlers will be applied.
*/
applyPluginsBailResult(name: string, ...args: any[]): any;
/**
* synchronously applies all registered handlers for target name(event id).
*
* The handlers are called with target param
*
* If a handler returns something !== undefined, the value is returned and no more handlers are applied.
*
* Note: the fundamental difference with `{@link applyPluginsBailResult}`, is that,
* `{@link applyPluginsBailResult}` passes the arguments as arguments list for plugins
* while `{@link applyPluginsBailResult1}` passes the arguments as single param(any type) for plugins
*/
applyPluginsBailResult1(name: string, param: any): any;
/**
* asynchronously applies all registered handlers for target name(event id).
*
* The handlers are called with all the rest arguments
* and a callback function with the signature (err: Error) => void.
*
* The handlers are called in series, one at a time. After all handlers are applied, callback is called.
*
* If any handler invokes the (anonymous)callback with error, no more handlers will be called
* and the real callback is call with that error.
*/
applyPluginsAsync(name: string, ...args: any[]): void;
/**
* same as `applyPluginsAsync`
* @see applyPluginsAsync
* @alias Tapable.applyPluginsAsync
* @param name
* @param args
*/
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).
*
* The handlers are called with all the rest arguments
* and a callback function with the signature (...params) => void.
*
* Handlers must invoke the (anonymous)callback, otherwise the series is cut down and real callback won't be
* invoked.
*
* The order is defined by registration order not by speed of the handler function.
*
* If a handler returns something !== undefined, that value is returned and no more handlers will be applied.
*/
applyPluginsAsyncSeriesBailResult(name: string, ...args: any[]): void;
/**
* asynchronously applies all registered handlers for target name(event id).
*
* @see applyPluginsAsyncSeriesBailResult
*
* Note: the fundamental difference with `{@link applyPluginsAsyncSeriesBailResult}`, is that,
* `{@link applyPluginsAsyncSeriesBailResult}` passes the arguments as arguments list for plugins
* while `{@link applyPluginsAsyncSeriesBailResult1}` passes the arguments as single param(any type)
* and a callback for plugins
*/
applyPluginsAsyncSeriesBailResult1(name: string, param: any, callback: Tapable.CallbackFunction): void;
/**
* Asynchronously applies all registered handlers for target name(event id).
*
* The handlers are called with the current value and a callback function with the signature (err: Error,
* nextValue: any) => void.
*
* `init` is used for the first handler. The rest handles are called with the value which previous handler uses
* to invoke the (anonymous)callback invoked
*
* After all handlers are applied, callback is called with the last value.
*
* If any handler invokes the (anonymous)callback with error, no more handlers will be called
* and the real callback is call with that error.
*/
applyPluginsAsyncWaterfall(name: string, init: any, callback: Tapable.CallbackFunction): void;
/**
* applies all registered handlers for target name(event id) in parallel.
*
* The handlers are called with all the rest arguments
* and a callback function with the signature (err?: Error) => void.
*
* The callback function is called when all handlers call the callback without err.
*
* If any handler invokes the callback with err, callback is invoked with this error and the other handlers are
* skipped.
*/
applyPluginsParallel(name: string, ...args: any[]): void;
/**
* applies all registered handlers for target name(event id) in parallel.
*
* The handlers are called with all the rest arguments
* and a callback function with the signature (currentResult?: []) => void.
*
* Handlers must call the callback.
*
* The first result (either error or value) with is not undefined is passed to the callback.
*
* The order is defined by registration not by speed of the handler function.
*/
applyPluginsParallelBailResult(name: string, ...args: any[]): void;
/**
* applies all registered handlers for target name(event id) in parallel.
*
* @see applyPluginsParallelBailResult
*
* Note: the fundamental difference with `{@link applyPluginsParallelBailResult}`, is that,
* `{@link applyPluginsParallelBailResult}` passes the arguments as arguments list for plugins
* while `{@link applyPluginsParallelBailResult1}` passes the arguments as single param(any type)
* and a callback for plugins
*/
applyPluginsParallelBailResult1(name: string, param: any, callback: Tapable.CallbackFunction): void;
static mixin(proto: any): void;
}
declare namespace Tapable {
interface Handler {
(...args: any[]): void;
}
interface Plugin {
apply(...args: any[]): void;
}
interface CallbackFunction {
(err?: Error, result?: any, ...args: any[]): void;
}
}
export = Tapable