import type { Workspace } from '../../../pm/index.ts';
import type { CheckPackageParams } from './checkPackageTypes.ts';
export interface PeerSource {
    /** Dependency chain for transitive peers, e.g. ['direct-dep', 'transitive-dep'] */
    chain?: string[];
    isRuntimeDep: boolean;
    requiredBy: string;
}
export interface UnsatisfiedPeer {
    hasRuntimeSource: boolean;
    installedVersion?: string;
    /** Sources (requiring deps) whose declared peer range the installed version
     * does not satisfy. Populated only for `reason: 'version-mismatch'`. */
    mismatchedSources?: PeerSource[];
    peer: string;
    reason: 'missing' | 'version-mismatch' | 'under-exposed';
    sources: PeerSource[];
    versionRange: string;
}
/**
 * Returns true when every requiring source declares this peer as optional in
 * its own `peerDependenciesMeta`. Empty sources is vacuously true; callers
 * that promote without a known source set should not rely on this signal.
 */
export declare function isPeerOptionalInAll(location: string, peer: string, sources: PeerSource[]): boolean;
/**
 * Returns the full set of peer dependency names required by all deps and devDeps.
 * Used to prevent the unused-dependency checks from removing deps that satisfy
 * transitive peer requirements.
 */
export declare function getRequiredTransitivePeers(location: string, { dependencies, devDependencies, peerDependencies, }: CheckPackageParams): Set<string>;
/**
 * Like `getRequiredTransitivePeers` but excludes peers that every requiring
 * source marks optional. Use this when deciding whether a devDependency is
 * "unused" — an all-optional transitive peer is not actually needed, so it
 * should be eligible for removal if it isn't directly imported.
 */
export declare function getRequiredNonOptionalTransitivePeers(location: string, { dependencies, devDependencies, peerDependencies, }: CheckPackageParams): Set<string>;
/**
 * Like `getRequiredNonOptionalTransitivePeers` but only counts peers reachable
 * through at least one **runtime** (non-dev) dependency chain. Use this for
 * `peerDependencies` retention: a peer reached only via devDep chains has no
 * runtime contract to forward to consumers, so it should not be kept in
 * `peerDependencies` even if some devDep happens to require it.
 */
export declare function getRuntimeRootedNonOptionalTransitivePeers(location: string, { dependencies, devDependencies, peerDependencies, }: CheckPackageParams): Set<string>;
export declare function findUnsatisfiedPeers({ name, location }: Workspace, { dependencies, devDependencies, peerDependencies, peerDependencyVersions, }: CheckPackageParams, exclude?: Set<string>, isTerminal?: boolean, forcePeerOptional?: Map<string, boolean>, forceDevs?: Set<string>): UnsatisfiedPeer[];
/**
 * For terminal packages (apps): runtime peers → dependencies, dev-only → devDependencies.
 * For library packages: runtime peers → peerDependencies + devDependencies (peer passes
 * the requirement to consumers, devDep satisfies it for the library's own development).
 * Dev-only peers → devDependencies only.
 */
export declare function resolvePeerTargetSections(hasRuntimeSource: boolean, isTerminal: boolean): string[];
//# sourceMappingURL=getUnsatisfiedPeerDependencies.d.ts.map