import { ChartData, DataFormat } from "../charts/types.js"; import { WarehouseStatus } from "./types.js"; //#region src/react/hooks/use-chart-data.d.ts interface UseChartDataOptions { /** Analytics query key */ queryKey: string; /** Query parameters */ parameters?: Record; /** * Data format preference * - "json": Force JSON format * - "arrow": Force Arrow format * - "auto": Auto-select based on heuristics * @default "auto" */ format?: DataFormat; /** Transform data after fetching */ transformer?: (data: T) => T; } interface UseChartDataResult { /** The fetched data (Arrow Table or JSON array) */ data: ChartData | null; /** Whether the data is in Arrow format */ isArrow: boolean; /** Loading state */ loading: boolean; /** Error message if any */ error: string | null; /** Whether the data is empty */ isEmpty: boolean; /** * Latest warehouse readiness status from SSE. Retains the last value * (including `RUNNING`) until the next `start()`; `null` only before * the first event. Use with `loading` to distinguish warehouse warm-up * from in-flight SQL fetch. */ warehouseStatus: WarehouseStatus | null; } /** * Hook for fetching chart data in either JSON or Arrow format. * Automatically selects the best format based on query hints. * * @example * ```tsx * // Auto-select format * const { data, isArrow, loading } = useChartData({ * queryKey: "spend_data", * parameters: { limit: 1000 } * }); * * // Force Arrow format * const { data } = useChartData({ * queryKey: "big_query", * format: "arrow" * }); * ``` */ declare function useChartData(options: UseChartDataOptions): UseChartDataResult; //#endregion export { UseChartDataOptions, UseChartDataResult, useChartData }; //# sourceMappingURL=use-chart-data.d.ts.map