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 PackageSpec = {
    raw: string;
    name: string;
    scope: string;
    type: 'git' | 'hosted' | 'tag' | 'version' | 'range' | 'local' | 'remote';
    spec: string;
    rawSpec: string;
};
export declare type HostedPackageSpec = PackageSpec & {
    hosted: {
        type: string;
        shortcut: string;
        sshUrl: string;
    };
};
export declare type ResolveOptions = {
    loggedPkg: LoggedPkg;
    got: Got;
    localRegistry: string;
    metaCache: Map<string, PackageMeta>;
    root: string;
    tag: string;
};
/**
 * 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>;
