UNPKG

567 BTypeScriptView Raw
1/**
2 * Binds methods of an object to the object itself, overwriting the existing method.
3 * @export
4 * @param {string[]} [methods=[]]
5 * @returns {ClassDecorator}
6 * @example
7 *
8 * @BindAll()
9 * class MyClass {
10 * bound() {
11 * return this;
12 * }
13 *
14 * unbound() {
15 * return this;
16 * }
17 * }
18 *
19 * const myClass = new MyClass();
20 *
21 * myClass.bound.call(null); // => MyClass {}
22 * myClass.unbound.call(null); // => MyClass {}
23 */
24export declare function BindAll(methods?: string[]): ClassDecorator;
25export { BindAll as bindAll };
26export default BindAll;