import { PackageMeta } from './npm';
import { Got } from '../network/got';
import { Package } from '../types';
import { LoggedPkg } from 'pnpm-logger';
export { PackageMeta };
/**
 * tarball hosted remotely
 */
export declare type TarballResolution = {
    type?: undefined;
    tarball: string;
    shasum?: string;
};
/**
 * directory on a file system
 */
export declare type DirectoryResolution = {
    type: 'directory';
    root: string;
};
/**
 * Git repository
 */
export declare type GitRepositoryResolution = {
    type: 'git-repo';
    repo: string;
    commitId: string;
};
export declare type Resolution = TarballResolution | GitRepositoryResolution | DirectoryResolution;
export declare type ResolveResult = {
    id: string;
    resolution: Resolution;
    package?: Package;
};
export declare type HostedPackageSpec = PackageSpecBase & {
    type: 'git';
    registry: false;
    gitCommittish: string;
    hosted?: {
        type: string;
        shortcut: string;
        sshUrl: string;
        user: string;
        project: string;
        committish: string;
    };
};
export declare type RegistryPackageSpec = PackageSpecBase & {
    type: 'tag' | 'version' | 'range';
    registry: true;
};
export declare type PackageSpecBase = {
    raw: string;
    rawSpec: string;
    name: string;
    scope: string;
    saveSpec: string;
    fetchSpec: string;
};
export declare type PackageSpec = HostedPackageSpec | RegistryPackageSpec | PackageSpecBase & {
    type: 'directory' | 'file' | 'remote';
    registry: false;
};
export declare type ResolveOptions = {
    loggedPkg: LoggedPkg;
    got: Got;
    localRegistry: string;
    registry: string;
    metaCache: Map<string, PackageMeta>;
    root: string;
    offline: boolean;
};
/**
 * Resolves a package in the NPM registry. Done as part of `install()`.
 *
 * @example
 *     var npa = require('npm-package-arg')
 *     resolve(npa('rimraf@2'))
 *       .then((res) => {
 *         res.id == 'rimraf@2.5.1'
 *         res.dist == {
 *           shasum: '0a1b2c...'
 *           tarball: 'http://...'
 *         }
 *       })
 */
export default function (spec: PackageSpec, opts: ResolveOptions): Promise<ResolveResult>;
