@web-atoms/core
Version:
62 lines • 2.42 kB
TypeScript
import { App } from "../../App";
import { AtomComponent } from "../../core/AtomComponent";
import XNode from "../../core/XNode";
import { AtomStyle } from "../styles/AtomStyle";
import { AtomStyleSheet } from "../styles/AtomStyleSheet";
declare global {
export interface HTMLElement {
atomControl: AtomControl;
_logicalParent: HTMLElement;
_templateParent: AtomControl;
}
}
export interface ISetters {
[key: string | symbol]: (ctrl: AtomControl, e: HTMLElement, value: any) => void;
}
export declare const ElementValueSetters: ISetters;
export interface PropertyRegistration<T> {
(value: T): ({
[key: string]: T;
});
property: string;
}
/**
* AtomControl class represents UI Component for a web browser.
*/
export declare class AtomControl extends AtomComponent {
static from<T = AtomControl>(e1: Element | EventTarget): T;
static registerProperty<T = any>(attributeName: string, attributeValue: string, setter: (ctrl: AtomControl, element: HTMLElement, value: T) => void): PropertyRegistration<T>;
renderer: XNode;
defaultControlStyle: any;
private mControlStyle;
get controlStyle(): AtomStyle;
set controlStyle(v: AtomStyle);
private mTheme;
private mCachedTheme;
/**
* Represents associated AtomStyleSheet with this visual hierarchy. AtomStyleSheet is
* inherited by default.
*/
get theme(): AtomStyleSheet;
set theme(v: AtomStyleSheet);
/**
* Gets Parent AtomControl of this control.
*/
get parent(): AtomControl;
protected get factory(): typeof AtomControl;
constructor(app: App, e?: HTMLElement);
onPropertyChanged(name: string): void;
atomParent(e: HTMLElement): AtomControl;
append(element: AtomControl | HTMLElement | Text): AtomControl;
updateSize(): void;
protected rendererChanged(): void;
protected preCreate(): void;
protected setElementValue(element: HTMLElement, name: string, value: any): void;
protected setElementClass(element: HTMLElement, value: any, clear?: boolean): void;
protected onUpdateSize(): void;
protected removeAllChildren(e: HTMLElement): void;
protected createNode(app: any, e: any, iterator: any, creator: any): any;
protected toTemplate(app: any, iterator: any, creator: any): any;
protected dispatchClickEvent(e: MouseEvent, data: any): void;
}
//# sourceMappingURL=AtomControl.d.ts.map