/** * adowire client — shared type definitions * Mirrors the relevant server-side types from src/types.ts for use in browser code. */ export interface WireSnapshot { state: Record; memo: WireMemo; checksum: string; } export interface WireMemo { name: string; id: string; children?: Record; errors: Record; locale?: string; lazy?: boolean; lazyLoaded?: boolean; path?: string; method?: string; scrollTo?: boolean; [key: string]: any; } export interface WireCall { method: string; params: any[]; } export interface WireEffect { html?: string; redirect?: string; dispatches?: WireDispatch[]; js?: string[]; streams?: WireStream[]; dirty?: string[]; download?: WireDownload; title?: string; xjs?: string[]; } export interface WireDispatch { name: string; params: any[]; to?: string; up?: boolean; self?: boolean; } export interface WireStream { name: string; content: string; replace?: boolean; } export interface WireDownload { name: string; url: string; } export interface WireRequestPayload { components: Array<{ snapshot: WireSnapshot; calls: WireCall[]; updates: Record; }>; } export interface WireComponentResponse { snapshot: WireSnapshot; effects: WireEffect; } export interface WireResponse { components: WireComponentResponse[]; } declare global { interface Window { Alpine?: any; Adowire?: { version: string; endpoint?: string; components: Map; init(): void; find(id: string): any | undefined; [key: string]: any; }; } }