import { Accessor } from 'solid-js'; import type { ChartConfig } from '@/types/chart'; /** * Global state manager for chart configurations during streaming. * This singleton manages chart config state outside of the component tree, * preventing reactivity issues when charts complete during SSE streaming. * * The problem: When using render() from solid-js/web to mount ChartPlaceholder * components into DOM slots, the rendered components are in an isolated reactive * root that doesn't share the parent's reactive context. Props passed to these * components don't update reactively when the parent's signals change. * * The solution: Use a global manager with SolidJS signals that can be accessed * from any component, regardless of which reactive root it's in. */ declare class ChartConfigManager { private _configs; private _loadingStates; /** * Get or create a config signal for a chart */ getConfigSignal(chartId: string): Accessor; /** * Get or create a loading state signal for a chart */ getLoadingSignal(chartId: string): Accessor; /** * Set the config for a chart (called when chart streaming completes) */ setConfig(chartId: string, config: ChartConfig): void; /** * Set the loading state for a chart */ setLoading(chartId: string, loading: boolean): void; /** * Initialize a chart with optional initial config (for historical messages) */ initChart(chartId: string, config: ChartConfig | null, isLoading: boolean): void; /** * Check if a chart has a config */ hasConfig(chartId: string): boolean; /** * Clear all chart configs (useful for cleanup between conversations) */ clear(): void; /** * Remove a specific chart's config */ removeChart(chartId: string): void; } export declare const chartConfigManager: ChartConfigManager; export {}; //# sourceMappingURL=chartConfigManager.d.ts.map