import { App, RefTreeNode } from "../app"; import { DOMElementComponent } from "../dom"; /** * The base class of all components. * * Each component should have a component class that extends this class. * * Register the component class to a plugin to make it available. */ export declare abstract class Component { constructor(); /** * The app that the component is installed on. */ $app: App; /** * The ref tree node of the component. */ $refTreeNode: RefTreeNode; /** * The primary element of the component. * If the component does not have a `HTMLElement` or `SVGElement`, it is `undefined`. * Set with `this.$main()` or be the first element of the component by default. */ $primaryEl: DOMElementComponent | undefined; /** * Call this method to set the next element as the primary element of this component. */ $primary(): void; /** * Trigger an `UPDATE` call. */ protected $update(): void; /** * Set the value of a model and trigger an `UPDATE` call if the value is changed. * * @param model The model. * @param v The new value. * @returns Whether the value is changed. */ protected $updateModel: App["updateModel"]; abstract $main(...args: any): any; } export declare function isComponentCtor(ctor: Function): ctor is new () => Component; export declare function toComponentFunc(name: string, ctor: new () => Component): (ckey: string, ...args: any) => unknown; export interface Components { } //# sourceMappingURL=component.d.ts.map