import type { ReactNode } from 'react'; import type { FieldPath } from 'react-hook-form'; import type { PipelineFormData, SourceData } from '../../../components/PipelineForm/PipelineForm.types'; /** * Wraps `sources` in a `useFieldArray` and tracks which one is "active" by * its stable RHF field id — not array index, so the active source stays * correct once sources can be reordered/removed. * * `datasets` is kept as a second, parallel field array — same length, same * order as `sources`, appended to in lockstep so `datasets[i]` always belongs * to `sources[i]`. Each dataset's `sourceName` is a denormalized label (kept * in sync elsewhere, see useFormSideEffects), not the lookup key. */ interface ActiveSourceProviderProps { children: ReactNode; /** * Called after a source is appended via `append`. The create wizard uses * this to re-lock downstream steps (a fresh source hasn't passed them yet). */ onSourceAdded?: () => void; /** * Name (`details.name`) of the source to select once the form has seeded, * instead of the first one — e.g. resuming a specific pending source. Applied once. */ initialActiveSourceName?: string; } export declare const ActiveSourceProvider: ({ children, onSourceAdded, initialActiveSourceName }: ActiveSourceProviderProps) => import("react/jsx-runtime").JSX.Element; export declare const useActiveSource: () => { activeIndex: number; activeSourceId: string; sources: ({ id: string; } & SourceData)[]; setActiveSourceId: (id: string) => void; append: (source: SourceData) => void; remove: (id: string) => void; }; /** * Resolves `suffix` against the currently active source, e.g. `'connectivity.connectivityType'` -> `'sources.2.connectivity.connectivityType'`. * Pass `indexOverride` to resolve against a specific source instead of the active one — used to * render a read-only summary for every source (e.g. the Review step) without changing which * source is "active" for the rest of the wizard. */ export declare const useActiveSourcePath: (suffix: string, indexOverride?: number) => FieldPath; /** Resolves `suffix` against the dataset paired with the currently active source, e.g. `'selection.schemas'` -> `'datasets.2.selection.schemas'`. Accepts the same `indexOverride` as `useActiveSourcePath`. */ export declare const useActiveDatasetPath: (suffix: string, indexOverride?: number) => FieldPath; export {};