devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
51 lines (41 loc) • 1.76 kB
TypeScript
/**
* DevExtreme (core/component.d.ts)
* Version: 20.1.7
* Build date: Tue Aug 25 2020
*
* Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
dxElement
} from './element';
/** Warning! This type is used for internal purposes. Do not import it directly. */
export interface ComponentOptions<T = Component> {
/** A function that is executed before the widget is disposed of. */
onDisposing?: ((e: { component?: T }) => any);
/** A function used in JavaScript frameworks to save the widget instance. */
onInitialized?: ((e: { component?: T, element?: dxElement }) => any);
/** A function that is executed after a widget option is changed. */
onOptionChanged?: ((e: { component?: T, name?: string, fullName?: string, value?: any }) => any);
}
/** Warning! This type is used for internal purposes. Do not import it directly. */
/** A base class for all components and widgets. */
export default class Component {
constructor(options?: ComponentOptions);
beginUpdate(): void;
endUpdate(): void;
instance(): this;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
option(): any;
option(optionName: string): any;
option(optionName: string, optionValue: any): void;
option(options: any): void;
resetOption(optionName: string): void;
}