import type { SourceData } from '../../../../../components/PipelineForm/PipelineForm.types'; export interface ActiveSourceRoute { sources: Array<{ id: string; } & SourceData>; /** Id of the source the rail should highlight as active. */ activeSourceId: string; /** Selects a source by id. */ selectSource: (id: string) => void; } /** * Binds the active source to the URL for the per-source Manage tabs. * * The in-memory active source (the RHF field id tracked by `ActiveSourceProvider`) * is **authoritative** — selecting a source switches it immediately, so the * dataset/config re-render regardless of the host's navigation service. The * `?source=` query param is a best-effort *reflection* so the selection is * shareable across tabs and survives browser back/forward. * * We deliberately do NOT re-derive the active source from the URL on every * render. Some host `NavigationService` implementations don't round-trip a * programmatic `navigate()` back through `getPath()` (e.g. a react-router setup * whose `subscribe` only fires on `popstate`, so a `replace()` never notifies). * The old "URL wins + revert to match it" design left the selection stuck on the * first source there: the param stayed stale and an effect reverted every click. * Instead we adopt the param only when it *transitions* to a new value (deep * link, back/forward) and otherwise let the in-memory selection win. */ export declare const useActiveSourceRoute: () => ActiveSourceRoute;