import { AnalyticsFormat, InferParams, InferResultByFormat, QueryKey, UseAnalyticsQueryOptions, UseAnalyticsQueryResult } from "./types.js";

//#region src/react/hooks/use-analytics-query.d.ts

/**
 * Subscribe to an analytics query over SSE and returns its latest result.
 * Integration hook between client and analytics plugin.
 *
 * The return type is automatically inferred based on the format:
 * - `format: "JSON"` (default): Returns typed array from QueryRegistry
 * - `format: "ARROW"`: Returns TypedArrowTable with row type preserved
 *
 * Note: User context execution is determined by query file naming:
 * - `queryKey.obo.sql`: Executes as user (OBO = on-behalf-of / user delegation)
 * - `queryKey.sql`: Executes as service principal
 *
 * @param queryKey - Analytics query identifier
 * @param parameters - Query parameters (type-safe based on QueryRegistry)
 * @param options - Analytics query settings including format
 * @returns Query result state with format-appropriate data type
 *
 * @example JSON format (default)
 * ```typescript
 * const { data } = useAnalyticsQuery("spend_data", params);
 * // data: Array<{ group_key: string; cost_usd: number; ... }> | null
 * ```
 *
 * @example Arrow format
 * ```typescript
 * const { data } = useAnalyticsQuery("spend_data", params, { format: "ARROW" });
 * // data: TypedArrowTable<{ group_key: string; cost_usd: number; ... }> | null
 * ```
 */
declare function useAnalyticsQuery<T = unknown, K extends QueryKey = QueryKey, F extends AnalyticsFormat = "JSON">(queryKey: K, parameters?: InferParams<K> | null, options?: UseAnalyticsQueryOptions<F>): UseAnalyticsQueryResult<InferResultByFormat<T, K, F>>;
//#endregion
export { useAnalyticsQuery };
//# sourceMappingURL=use-analytics-query.d.ts.map