import { PackageJson } from '@pnpm/types';
import { Store } from './fs/storeController';
import { LoggedPkg } from './loggers';
import { Got } from './network/got';
import { DirectoryResolution, PackageMeta, PackageSpec, Resolution } from './resolve';
export interface PackageContentInfo {
    isNew: boolean;
    index: {};
}
export declare type FetchedPackage = {
    isLocal: true;
    resolution: DirectoryResolution;
    pkg: PackageJson;
    id: string;
} | {
    isLocal: false;
    fetchingPkg: Promise<PackageJson>;
    fetchingFiles: Promise<PackageContentInfo>;
    calculatingIntegrity: Promise<void>;
    path: string;
    id: string;
    resolution: Resolution;
    latest?: string;
};
export default function fetch(spec: PackageSpec, options: {
    downloadPriority: number;
    fetchingLocker: {
        [pkgId: string]: {
            calculatingIntegrity: Promise<void>;
            fetchingFiles: Promise<PackageContentInfo>;
            fetchingPkg: Promise<PackageJson>;
        };
    };
    got: Got;
    loggedPkg: LoggedPkg;
    metaCache: Map<string, PackageMeta>;
    offline: boolean;
    pkgId?: string;
    prefix: string;
    registry: string;
    shrinkwrapResolution?: Resolution;
    storeIndex: Store;
    storePath: string;
    update?: boolean;
    verifyStoreIntegrity: boolean;
}): Promise<FetchedPackage>;
