/** * ZUI Core Types * Base type definitions for the ZUI component library */ export interface DeviceInfo { /** Screen width in pixels */ screenWidth: number; /** Screen height in pixels */ screenHeight: number; /** Whether the device has a circular screen */ isCircular: boolean; /** Pixels per inch */ ppi: number; /** Whether device has a digital crown */ hasCrown: boolean; /** Number of physical buttons */ buttonCount: number; } export interface ScreenConfig { width: number; height: number; safeArea: { top: number; right: number; bottom: number; left: number; }; } export type Size = number | 'auto' | '100%'; export interface Rect { x: number; y: number; w: number; h: number; } export interface Point { x: number; y: number; } export interface Padding { top: number; right: number; bottom: number; left: number; } export type PaddingInput = number | Partial; export type Alignment = 'start' | 'center' | 'end' | 'stretch'; export type JustifyContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around'; export type Direction = 'vertical' | 'horizontal'; export type TextAlign = 'left' | 'center' | 'right'; export interface BaseProps { /** Unique identifier for the component */ id?: string; /** Whether the component is visible */ visible?: boolean; /** Custom styles to apply */ style?: Partial; /** Test ID for testing purposes */ testID?: string; /** Index signature for additional properties */ [key: string]: unknown; } export interface StyleProps { x: number; y: number; w: number; h: number; alpha: number; color: number; background: number; radius: number; } export interface LayoutProps { width?: Size; height?: Size; x?: number; y?: number; padding?: PaddingInput; margin?: PaddingInput; } export type EventCallback = (data: T) => void; export interface TouchEvent { x: number; y: number; timestamp: number; } export interface GestureEvent extends TouchEvent { type: 'tap' | 'longPress' | 'swipe' | 'pan'; direction?: 'up' | 'down' | 'left' | 'right'; velocity?: number; } export interface ScrollEvent { offset: number; direction: 'up' | 'down'; velocity: number; } export interface CrownEvent { delta: number; direction: 'up' | 'down'; } export type WidgetType = 'TEXT' | 'IMG' | 'ARC' | 'FILL_RECT' | 'STROKE_RECT' | 'CIRCLE' | 'BUTTON' | 'IMG_ANIM' | 'GRADIENT_POLYLINE' | 'SCROLL_LIST' | 'VIEW_CONTAINER'; export interface WidgetOptions { x?: number; y?: number; w?: number; h?: number; [key: string]: unknown; } export interface Widget { setProperty(key: number, value: unknown): void; getProperty(key: number): unknown; addEventListener(event: number, callback: EventCallback): void; removeEventListener(event: number): void; } export interface ComponentInstance { /** Unique component ID */ readonly id: string; /** Component type name */ readonly type: string; /** Current props */ readonly props: Record; /** Child components */ readonly children: ComponentInstance[]; /** Parent component */ readonly parent: ComponentInstance | null; /** Underlying ZeppOS widgets */ readonly widgets: Widget[]; /** Get computed layout rect */ getRect(): Rect; /** Update component props */ setProps(props: Record): void; /** Destroy and cleanup component */ destroy(): void; /** Trigger re-render */ update(): void; } export interface StateSubscription { unsubscribe(): void; } export type StateSelector = (state: T) => R; export type StateUpdater = (state: T) => Partial; export type EasingFunction = (t: number) => number; export type EasingName = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'; export interface AnimationConfig { property: keyof StyleProps | string; from: number; to: number; duration: number; easing?: EasingName | EasingFunction; delay?: number; onComplete?: () => void; } export interface TransitionConfig { enter?: Partial; exit?: Partial; } export interface ThemeColors { primary: { blue: string; green: string; red: string; orange: string; yellow: string; }; text: { title: string; subtitle: string; body: string; caption: string; disabled: string; }; background: { primary: string; elevated: string; secondary: string; tertiary: string; }; states: { pressed: number; disabled: number; }; } export interface ThemeTypography { fonts: { primary: string; number: string; condensed: string; }; sizes: Record; weights: Record; } export interface ThemeSpacing { xxs: number; xs: number; sm: number; md: number; lg: number; xl: number; xxl: number; [key: string]: number; } export interface Theme { colors: ThemeColors; typography: ThemeTypography; spacing: ThemeSpacing; iconSizes: Record; borderRadius: Record; } export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; }; export type RequireAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; export type Prettify = { [K in keyof T]: T[K]; } & {}; //# sourceMappingURL=types.d.ts.map