import { LoggedPkg } from 'pnpm-logger';
import { Resolution, DirectoryResolution, PackageSpec, PackageMeta } from '../resolve';
import { Package } from '../types';
import { Got } from '../network/got';
import { PackageContentInfo } from '../api/install';
export declare type FetchedPackage = {
    isLocal: true;
    resolution: DirectoryResolution;
    pkg: Package;
    id: string;
} | {
    isLocal: false;
    fetchingPkg: Promise<Package>;
    fetchingFiles: Promise<PackageContentInfo>;
    calculatingIntegrity: Promise<void>;
    path: string;
    id: string;
    resolution: Resolution;
};
export default function fetch(spec: PackageSpec, options: {
    prefix: string;
    storePath: string;
    registry: string;
    metaCache: Map<string, PackageMeta>;
    got: Got;
    update?: boolean;
    shrinkwrapResolution?: Resolution;
    pkgId?: string;
    fetchingLocker: {
        [pkgId: string]: {
            fetchingFiles: Promise<PackageContentInfo>;
            fetchingPkg: Promise<Package>;
            calculatingIntegrity: Promise<void>;
        };
    };
    loggedPkg: LoggedPkg;
    offline: boolean;
}): Promise<FetchedPackage>;
