lodash-decorators
Version:
A collection of decorators using lodash at it's core.
27 lines (26 loc) • 567 B
TypeScript
/**
* Binds methods of an object to the object itself, overwriting the existing method.
* @export
* @param {string[]} [methods=[]]
* @returns {ClassDecorator}
* @example
*
* @BindAll()
* class MyClass {
* bound() {
* return this;
* }
*
* unbound() {
* return this;
* }
* }
*
* const myClass = new MyClass();
*
* myClass.bound.call(null); // => MyClass {}
* myClass.unbound.call(null); // => MyClass {}
*/
export declare function BindAll(methods?: string[]): ClassDecorator;
export { BindAll as bindAll };
export default BindAll;