@xcons/widget
Version:
XCon Studio widget utilities with advanced template rendering, reactive binding system and registry pattern support
28 lines (27 loc) • 1.04 kB
TypeScript
import { ReactiveModel } from "./reactive-core";
export interface PropertyOptions {
reflect?: boolean;
attribute?: string;
hasChanged?: (value: any, oldValue: any) => boolean;
}
/**
* Reactive property decorator - automatically adds ReactiveElementMixin
*/
export declare function xproperty(options?: PropertyOptions): PropertyDecorator;
/**
* Manual ReactiveElementMixin for explicit control
*/
export declare function ReactiveElementMixin<T extends new (...args: any[]) => {}>(Base: T): {
new (...args: any[]): {
[key: string]: any;
_widgetElement?: HTMLElement;
reactiveManager?: any;
reactiveUpdate(propertyKey?: string, oldValue?: any, newValue?: any): void;
reflectToAttribute(propertyKey: string, value: any, options: PropertyOptions): void;
onWidgetPropertyChanged?(propertyKey?: string, oldValue?: any, newValue?: any): void;
};
} & T;
/**
* Manual update trigger for non-reactive properties
*/
export declare function triggerUpdate(model: ReactiveModel): void;