import type { PreparedRoutePreload } from './prepared-preload.js'; declare global { interface WebUIRuntimeGlobal { chain?: unknown[]; inventory?: string; nonce?: string; css?: string[]; styles?: string[]; state?: Record; templateHostExclusions?: Set; componentStyles?: ComponentStyles; } interface Window { __webui?: WebUIRuntimeGlobal; __webuiRegisterComponentStyles?: (value: unknown) => Promise | undefined; } } export type ComponentStyleResource = ({ kind: 'link'; href: string; } | { kind: 'style'; css: string; } | { kind: 'module'; specifier: string; css: string; }) & { members?: string[]; }; export interface ComponentStyles { version: 1; strategy: 'link' | 'style' | 'module'; resources: Record; closures: Record; } export interface RouterConfig { loaders?: Record Promise>; dev?: boolean; templateEndpoint?: string; preload?: boolean | PreparedRoutePreload; actions?: boolean; excludePaths?: string[]; cache?: CacheConfig; ssrFresh?: boolean; } export interface RouteLoaderContext { params: Record; query: Record; signal: AbortSignal; } export interface NavigationEvent { component: string; params: Record; query: Record; path: string; } export interface CacheConfig { staleTime?: number; gcTime?: number; maxEntries?: number; } export interface RouteActionContext { formData: FormData; params: Record; signal: AbortSignal; } export interface RouteActionResult { invalidateTags?: string[]; state?: Record; } export interface ActionCompleteEvent { component: string; invalidatedTags: string[]; path: string; } export interface StatefulElement extends HTMLElement { setState(state: Record): void; } export declare function isStateful(el: Element): el is StatefulElement;