import type { RushConfiguration } from './RushConfiguration';
/**
 * Part of the ICommonVersionsJson structure.
 */
export declare interface ICommonVersionsJsonVersionMap {
    /**
     * The key is the name of a dependency.  The value is a Semantic Versioning (SemVer)
     * range specifier.
     */
    [dependencyName: string]: string;
}
/**
 * Part of the ICommonVersionsJson structure.
 */
export declare interface ICommonVersionsJsonVersionsMap {
    /**
     * The key is the name of a dependency.  The value is a list of Semantic Versioning (SemVer)
     * range specifiers.
     */
    [dependencyName: string]: string[];
}
/**
 * Use this class to load and save the "common/config/rush/common-versions.json" config file.
 * This config file stores dependency version information that affects all projects in the repo.
 * @public
 */
export declare class CommonVersionsConfiguration {
    private static _jsonSchema;
    private _preferredVersions;
    private _allowedAlternativeVersions;
    private _modified;
    private _commonVersionsJsonHasEnsureConsistentVersionsProperty;
    /**
     * Get the absolute file path of the common-versions.json file.
     */
    readonly filePath: string;
    /**
     * When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions,
     * except in cases where different projects specify different version ranges for a given dependency.  For older
     * package managers, this tended to reduce duplication of indirect dependencies.  However, it can sometimes cause
     * trouble for indirect dependencies with incompatible peerDependencies ranges.
     *
     * If the value is `undefined`, then the default value is `true`.
     */
    readonly implicitlyPreferredVersions: boolean | undefined;
    /**
     * If true, then consistent version specifiers for dependencies will be enforced.
     * I.e. "rush check" is run before some commands.
     */
    readonly ensureConsistentVersions: boolean;
    /**
     * A table that specifies a "preferred version" for a given NPM package.  This feature is typically used
     * to hold back an indirect dependency to a specific older version, or to reduce duplication of indirect dependencies.
     *
     * @remarks
     * The "preferredVersions" value can be any SemVer range specifier (e.g. `~1.2.3`).  Rush injects these values into
     * the "dependencies" field of the top-level common/temp/package.json, which influences how the package manager
     * will calculate versions.  The specific effect depends on your package manager.  Generally it will have no
     * effect on an incompatible or already constrained SemVer range.  If you are using PNPM, similar effects can be
     * achieved using the pnpmfile.js hook.  See the Rush documentation for more details.
     *
     * After modifying this field, it's recommended to run `rush update --full` so that the package manager
     * will recalculate all version selections.
     */
    readonly preferredVersions: Map<string, string>;
    /**
     * A table that stores, for a given dependency, a list of SemVer ranges that will be accepted
     * by "rush check" in addition to the normal version range.
     *
     * @remarks
     * The "rush check" command can be used to enforce that every project in the repo
     * must specify the same SemVer range for a given dependency.  However, sometimes
     * exceptions are needed.  The allowedAlternativeVersions table allows you to list
     * other SemVer ranges that will be accepted by "rush check" for a given dependency.
     * Note that the normal version range (as inferred by looking at all projects in the repo)
     * should NOT be included in this list.
     */
    readonly allowedAlternativeVersions: Map<string, ReadonlyArray<string>>;
    private constructor();
    /**
     * @deprecated Use {@link CommonVersionsConfiguration.loadFromFileAsync} method instead.
     */
    static loadFromFile(jsonFilePath: string, rushConfiguration?: RushConfiguration): CommonVersionsConfiguration;
    /**
     * Loads the common-versions.json data from the specified file path.
     * If the file has not been created yet, then an empty object is returned.
     */
    static loadFromFileAsync(jsonFilePath: string, rushConfiguration?: RushConfiguration): Promise<CommonVersionsConfiguration>;
    private static _deserializeTable;
    private static _serializeTable;
    /**
     * Get a sha1 hash of the preferred versions.
     */
    getPreferredVersionsHash(): string;
    /**
     * @deprecated Use {@link CommonVersionsConfiguration.saveAsync} method instead.
     */
    save(): boolean;
    /**
     * Writes the "common-versions.json" file to disk, using the filename that was passed to loadFromFile().
     */
    saveAsync(): Promise<boolean>;
    /**
     * Returns preferredVersions.
     */
    getAllPreferredVersions(): Map<string, string>;
    private _onSetPreferredVersions;
    private _onSetAllowedAlternativeVersions;
    private _serialize;
}
//# sourceMappingURL=CommonVersionsConfiguration.d.ts.map