/**
* JQHTML SSR Preload Data System
*
* Captures component data during SSR rendering and replays it on the client
* to skip redundant on_load() calls during hydration.
*
* Server-side: start_data_capture() → render → get_captured_data()
* Client-side: set_preload_data(entries) → components boot with preloaded data → clear_preload_data()
*/
export interface PreloadEntry {
component: string;
args: Record;
data: Record;
/**
* The exact cache key the capturing component was keyed under (from
* generate_cache_key()). Emitted by get_captured_data() and honoured by
* set_preload_data(). Without it a cache_id() component could never match:
* its key is `::`, a shape no amount of arg serialization
* on the client can reproduce. Absent when the component had no key.
*/
key?: string;
}
/**
* Enable data capture mode. After this call, every component that completes
* on_load() has its final this.data recorded.
*
* Idempotent — calling twice is fine.
*/
export declare function start_data_capture(): void;
/**
* Record a component's data after on_load() completes.
* Called internally from _apply_load_result().
*
* @param component_name - Component name
* @param args - Component args at time of on_load()
* @param data - this.data after on_load() completed
* @param cache_key - The cache key for deduplication (null = always capture)
*/
export declare function capture_component_data(component_name: string, args: Record, data: Record, cache_key: string | null): void;
/**
* Returns all captured component data and resets the capture buffer.
* One-shot: calling clears the buffer.
*/
export declare function get_captured_data(): PreloadEntry[];
/**
* Check if data capture is currently enabled.
*/
export declare function is_capture_enabled(): boolean;
/**
* Stop data capture and clear all state.
*/
export declare function stop_data_capture(): void;
/**
* Seed the preload cache with SSR-captured data.
* Must be called before any component _load() runs.
*
* @param entries - Array of { component, args, data } entries from get_captured_data()
*/
export declare function set_preload_data(entries: PreloadEntry[] | null): void;
/**
* Check if preloaded data exists for a given cache key.
* If found, returns the data and removes the entry (one-shot).
*
* @param cache_key - The cache key (same format as Load Coordinator)
* @returns The preloaded data, or null if no match
*/
export declare function consume_preload_data(cache_key: string): Record | null;
/**
* Clear any remaining unconsumed preload entries.
* Call after initial page hydration is complete.
*/
export declare function clear_preload_data(): void;
/**
* Check if any preload data is available (for fast early exit in _load).
*/
export declare function has_preload_data(): boolean;
//# sourceMappingURL=preload-data.d.ts.map