import { type IPackageJson } from '@rushstack/node-core-library';
/**
 * @public
 */
export declare enum DependencyType {
    Regular = "dependencies",
    Dev = "devDependencies",
    Optional = "optionalDependencies",
    Peer = "peerDependencies",
    YarnResolutions = "resolutions"
}
/**
 * @public
 */
export declare class PackageJsonDependency {
    private _version;
    private _onChange;
    readonly name: string;
    readonly dependencyType: DependencyType;
    constructor(name: string, version: string, type: DependencyType, onChange: () => void);
    get version(): string;
    setVersion(newVersion: string): void;
}
/**
 * @public
 */
export declare class PackageJsonDependencyMeta {
    private _injected;
    private _onChange;
    readonly name: string;
    constructor(name: string, injected: boolean, onChange: () => void);
    get injected(): boolean;
}
/**
 * @public
 */
export declare class PackageJsonEditor {
    private readonly _dependencies;
    private readonly _devDependencies;
    private readonly _dependenciesMeta;
    private readonly _resolutions;
    private _modified;
    private _sourceData;
    readonly filePath: string;
    /**
     * @internal
     */
    protected constructor(filepath: string, data: IPackageJson);
    /**
     * @deprecated Use {@link PackageJsonEditor.loadAsync} method instead.
     */
    static load(filePath: string): PackageJsonEditor;
    static loadAsync(filePath: string): Promise<PackageJsonEditor>;
    static fromObject(object: IPackageJson, filename: string): PackageJsonEditor;
    get name(): string;
    get version(): string;
    /**
     * The list of dependencies of type DependencyType.Regular, DependencyType.Optional, or DependencyType.Peer.
     */
    get dependencyList(): ReadonlyArray<PackageJsonDependency>;
    /**
     * The list of dependencies of type DependencyType.Dev.
     */
    get devDependencyList(): ReadonlyArray<PackageJsonDependency>;
    /**
     * The list of dependenciesMeta in package.json.
     */
    get dependencyMetaList(): ReadonlyArray<PackageJsonDependencyMeta>;
    /**
     * This field is a Yarn-specific feature that allows overriding of package resolution.
     *
     * @remarks
     * See the {@link https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-selective-versions-resolutions.md
     * | 0000-selective-versions-resolutions.md RFC} for details.
     */
    get resolutionsList(): ReadonlyArray<PackageJsonDependency>;
    tryGetDependency(packageName: string): PackageJsonDependency | undefined;
    tryGetDevDependency(packageName: string): PackageJsonDependency | undefined;
    addOrUpdateDependency(packageName: string, newVersion: string, dependencyType: DependencyType): void;
    removeDependency(packageName: string, dependencyType: DependencyType): void;
    /**
     * @deprecated Use {@link PackageJsonEditor.saveIfModifiedAsync} method instead.
     */
    saveIfModified(): boolean;
    saveIfModifiedAsync(): Promise<boolean>;
    /**
     * Get the normalized package.json that represents the current state of the
     * PackageJsonEditor. This method does not save any changes that were made to the
     * package.json, but instead returns the object representation of what would be saved
     * if saveIfModified() is called.
     */
    saveToObject(): IPackageJson;
    private _onChange;
    /**
     * Create a normalized shallow copy of the provided package.json without modifying the
     * original. If the result of this method is being returned via a public facing method,
     * it will still need to be deep-cloned to avoid propogating changes back to the
     * original dataset.
     */
    private _normalize;
}
//# sourceMappingURL=PackageJsonEditor.d.ts.map