DefinitelyTyped/types/auto-bind/index.d.ts
Sindre 91f8a6b7d1 auto-bind definitions (#27299)
* auto-bind definitions

* auto-bind: fix lint errors

* auto-bind: PR feedback, fix import syntax in tests
2018-07-16 11:09:10 -07:00

26 lines
725 B
TypeScript

// Type definitions for auto-bind 1.2
// Project: https://github.com/sindresorhus/auto-bind#readme
// Definitions by: Sindre Seppola <https://github.com/sseppola>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare namespace autoBind {
interface AutoBindOptions {
include?: Array<string | RegExp>;
exclude?: Array<string | RegExp>;
}
type AutoBindFunction<selfT = object> = (
self: selfT,
options?: AutoBindOptions
) => selfT;
}
interface AutoBindModule<selfT = object>
extends autoBind.AutoBindFunction<selfT> {
react: autoBind.AutoBindFunction<selfT>;
}
declare const autoBind: AutoBindModule;
export = autoBind;