/** * ZUI Component * Base component class for all ZUI components */ import type { BaseProps, ComponentInstance, LayoutProps, Rect, Widget, WidgetOptions, WidgetType, Padding, PaddingInput, EventCallback } from './types'; import { EventEmitter } from './EventEmitter'; /** * Normalize padding input to full Padding object */ export declare function normalizePadding(input?: PaddingInput): Padding; /** * Abstract base component class */ export declare abstract class Component

implements ComponentInstance { readonly id: string; abstract readonly type: string; protected _props: P; protected _children: Component[]; protected _parent: Component | null; protected _widgets: Widget[]; protected _rect: Rect; protected _mounted: boolean; protected _events: EventEmitter; constructor(props: P); /** * Get default props for the component */ protected getDefaultProps(): Partial

; /** * Get current props */ get props(): P; /** * Get child components */ get children(): Component[]; /** * Get parent component */ get parent(): Component | null; /** * Get underlying widgets */ get widgets(): Widget[]; /** * Check if component is mounted */ get isMounted(): boolean; /** * Get computed layout rect */ getRect(): Rect; /** * Set component rect */ setRect(rect: Partial): void; /** * Update component props */ setProps(newProps: Partial

): void; /** * Add a child component */ addChild(child: Component): void; /** * Remove a child component */ removeChild(child: Component): void; /** * Remove all children */ clearChildren(): void; /** * Mount the component and its children */ mount(parentRect?: Rect): void; /** * Update the component */ update(): void; /** * Destroy and cleanup component */ destroy(): void; /** * Subscribe to component events */ on(event: string, callback: EventCallback): () => void; /** * Emit a component event */ protected emit(event: string, data?: T): void; /** * Calculate component layout based on props and parent rect */ protected abstract calculateLayout(parentRect?: Rect): void; /** * Create ZeppOS widgets for this component */ protected abstract createWidgets(): void; /** * Update existing widgets with new prop values */ protected abstract updateWidgets(): void; /** * Destroy ZeppOS widgets */ protected abstract destroyWidgets(): void; /** * Called when component is mounted */ protected onMount(): void; /** * Called when component is destroyed */ protected onDestroy(): void; /** * Called when props change */ protected onPropsChanged(_newProps: P, _prevProps: P): void; /** * Called when a child is added */ protected onChildAdded(_child: Component): void; /** * Called when a child is removed */ protected onChildRemoved(_child: Component): void; /** * Update widget positions after rect change */ protected updateWidgetPositions(): void; } /** * Props interface for components with layout capabilities */ export interface LayoutComponentProps extends BaseProps, LayoutProps { children?: Component[]; } /** * Base class for layout components */ export declare abstract class LayoutComponent

extends Component

{ constructor(props: P); protected getDefaultProps(): Partial

; } /** * Widget type mapping */ export declare const WIDGET_TYPES: Record; /** * Create a ZeppOS widget */ export declare function createWidget(type: WidgetType, options: WidgetOptions): Widget; /** * Delete a ZeppOS widget */ export declare function deleteWidget(widget: Widget): void; //# sourceMappingURL=Component.d.ts.map