import { PackageManifest, StoreIndex } from '@pnpm/types';
import { FetchFunction } from './fetchTypes';
import { LoggedPkg } from './loggers';
import { DirectoryResolution, Resolution, ResolveFunction, WantedDependency } from './resolveTypes';
export interface PackageFilesResponse {
    fromStore: boolean;
    filenames: string[];
}
export declare type PackageResponse = {
    body: {
        isLocal: true;
        resolution: DirectoryResolution;
        manifest: PackageManifest;
        id: string;
        normalizedPref?: string;
    };
} | ({
    fetchingFiles?: Promise<PackageFilesResponse>;
    finishing?: Promise<void>;
    body: {
        isLocal: false;
        inStoreLocation: string;
        cacheByEngine: Map<string, string>;
        id: string;
        resolution: Resolution;
        latest?: string;
        normalizedPref?: string;
    };
} & ({
    fetchingManifest: Promise<PackageManifest>;
} | {
    body: {
        manifest: PackageManifest;
    };
}));
export interface WantedDependency {
    alias?: string;
    pref: string;
}
export interface RequestPackageOptions {
    defaultTag?: string;
    skipFetch?: boolean;
    downloadPriority: number;
    loggedPkg: LoggedPkg;
    currentPkgId?: string;
    prefix: string;
    registry: string;
    shrinkwrapResolution?: Resolution;
    update?: boolean;
    verifyStoreIntegrity: boolean;
    preferredVersions: {
        [packageName: string]: {
            selector: string;
            type: 'version' | 'range' | 'tag';
        };
    };
    sideEffectsCache: boolean;
}
export declare type RequestPackageFunction = (wantedDependency: WantedDependency, options: RequestPackageOptions) => Promise<PackageResponse>;
export default function (resolve: ResolveFunction, fetchers: {
    [type: string]: FetchFunction;
}, opts: {
    networkConcurrency?: number;
    storePath: string;
    storeIndex: StoreIndex;
}): RequestPackageFunction;
