import { type DbtManifest } from '../types/dbt';
export type CombineManifestsResult = {
    manifest: DbtManifest;
    addedModelIds: string[];
};
/**
 * One dbt source feeding the multi-source merge. `precedence` orders sources
 * (lower wins on key collision; the primary source is precedence 0); `name`
 * tie-breaks equal precedence and labels collisions in the report.
 */
export type ManifestSource = {
    name: string;
    precedence: number;
    manifest: DbtManifest;
};
/**
 * Sections where a repeated key is surfaced as a collision. `macros` and `docs`
 * are deliberately absent: dbt namespaces their unique_ids by package (`dbt`,
 * `dbt_postgres`, `dbt_utils`, …), so any two projects on the same adapter
 * share hundreds of byte-identical built-in ids (`macro.dbt.*`,
 * `doc.dbt.__overview__`). Those are unioned silently — lowest precedence
 * wins — because a duplicate definition there loses no user data.
 */
export type ManifestCollisionSection = 'nodes' | 'metrics' | 'sources' | 'semantic_models';
/**
 * A key present in more than one source. The lower-precedence source's entry
 * is kept (`winningSource`); the other is dropped (`supersededSource`). Surfaced
 * non-blocking so we no longer drop siblings silently like the CLI does today.
 */
export type ManifestCollision = {
    section: ManifestCollisionSection;
    key: string;
    winningSource: string;
    supersededSource: string;
};
export type CombineManifestSourcesResult = {
    manifest: DbtManifest;
    addedModelIds: string[];
    collisions: ManifestCollision[];
};
/**
 * Merge N dbt manifests into one combined manifest for compilation.
 *
 * Sources are sorted by `precedence` ASC then `name` ASC; the lowest-precedence
 * source is treated as primary. All sources' `nodes` are merged (lower precedence
 * wins on collision) so name-based ref/join lookups resolve across sources during
 * compile — this is what lets a model from one source join to a model from another.
 * Only nodes that are already `compiled === true` become explores downstream, so
 * non-compiled nodes still help reference resolution without producing explores.
 *
 * `metrics`, `docs`, `sources`, `macros` and `semantic_models` are unioned across
 * sources (lower precedence wins on collision) — unlike the legacy two-manifest
 * merge which took them from the primary only. `macros` and `docs` collide
 * silently (see {@link ManifestCollisionSection}); the other sections report
 * collisions. `metadata` (a single object, not a keyed record) comes from the
 * primary source.
 *
 * `addedModelIds` lists compiled model unique_ids contributed by non-primary
 * sources (not present in the primary). Server-side the node's own `compiled`
 * flag drives explore creation, so this is returned for CLI parity, where it is
 * appended to the locally-compiled model id list.
 */
export declare const combineManifestSources: (sources: ManifestSource[]) => CombineManifestSourcesResult;
/**
 * Merge model nodes from `external` into `primary`. Thin two-manifest wrapper
 * over {@link combineManifestSources} (primary = precedence 0, external = 1),
 * kept for the CLI `--combine-manifest` flag. Nodes already present in `primary`
 * keep their primary version (primary wins on conflict). Returns the combined
 * manifest and the unique_ids of compiled model nodes pulled in from `external`.
 *
 * Note: unlike the original CLI-only implementation, metrics and docs are now
 * unioned across both manifests (not taken from `primary` only); `metadata`
 * still comes from `primary`.
 */
export declare const combineManifests: (primary: DbtManifest, external: DbtManifest) => CombineManifestsResult;
//# sourceMappingURL=manifest.d.ts.map