import type { PipelineComponentStatus, PipelineStateValueV1 } from '../sdk/pipeline/types'; import type { SourceHealthState } from './usePipelineStatus.types'; export interface CollectorState { /** * Rolled-up run state — the least-advanced collector across the sources that * are supposed to be running. Sources stored `active: false` are excluded, so * one being added does not drag the aggregate to `not-running`. Undefined * while resolving. */ state?: PipelineStateValueV1; /** * Run state per source, keyed by source name (v2 only). Undefined while * resolving or when the server reports no collector metrics. */ collectorStates?: Record; /** Component availability reported by the pipeline-status endpoint. */ components?: PipelineComponentStatus[]; /** Undefined when the pipeline isn't running or no connections are reported. */ sourceHealth?: SourceHealthState; /** True while any of the underlying queries are still resolving. */ isLoading: boolean; } /** * Collector-domain view model. Single source of truth for "what is the * collector doing?" — consumed by every surface that visualizes collector * state (header status pill, dashboard health card, …) so they cannot drift. * * Three queries feed this hook: * - {@link useGetPipelineStatusQuery} — provides the run `state` * (`cdc` / `initial-sync` / `not-running`) plus `collectorStates`, the same * value per source (the rolled-up `state` is the least-advanced of those). * - {@link useGetPipelineQuery} — provides `config.sources`, the declared * list of source connections (the source of truth for which connections * are expected to exist). * - {@link useMonitoringStatisticsQuery} — polls every 5s and provides the * actual reported status per connection. The poll is what makes * `sourceHealth` track live failures. * * `sourceHealth` is computed only when the collector is active (`cdc` or * `initial-sync`); see {@link mapPipelineHealth} for the full decision table. */ export declare const useCollectorState: () => CollectorState;