jodit
Version:
Jodit is an awesome and useful wysiwyg editor with filebrowser
25 lines (24 loc) • 876 B
TypeScript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* Decorator that automatically binds a method to its class instance.
* This is useful when passing methods as callbacks to preserve the correct `this` context.
*
* @example
* ```typescript
* class MyComponent {
* @autobind
* handleClick() {
* console.log(this); // Always refers to MyComponent instance
* }
* }
*
* const component = new MyComponent();
* const button = document.createElement('button');
* button.addEventListener('click', component.handleClick); // `this` is correctly bound
* ```
*/
export declare function autobind(_target: object, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;