import { ResolveResult } from '../resolve';
import { InstallContext } from '../api/install';
import { Package } from '../types';
export declare type PackageMeta = {
    rawSpec: string;
    optional: boolean;
};
export declare type InstallationOptions = {
    optional?: boolean;
    keypath?: string[];
    parentRoot?: string;
    linkLocal: boolean;
    force: boolean;
    root: string;
    storePath: string;
    depth: number;
    tag: string;
};
export declare type PackageSpec = {
    raw: string;
    name: string;
    scope: string;
    type: string;
    spec: string;
    rawSpec: string;
};
export declare type InstalledPackage = {
    pkg: Package;
    optional: boolean;
    id: string;
    keypath: string[];
    name: string;
    fromCache: boolean;
    dependencies: InstalledPackage[];
};
export declare type PackageContext = ResolveResult & {
    optional: boolean;
    linkLocal: boolean;
    keypath: string[];
    id: string;
    installationRoot: string;
    storePath: string;
    force: boolean;
    depth: number;
    tag: string;
};
export declare type InstallLog = (msg: string, data?: Object) => void;
/**
 * Installs a package.
 *
 * What it does:
 *
 * - resolve() - resolve from registry.npmjs.org
 * - fetch() - download tarball into node_modules/.store/{name}@{version}
 * - recurse into its dependencies
 * - symlink node_modules/{name}
 *
 * @param {Object} ctx - the context.
 * @param {Object} pkgMeta - meta info about the package to install.
 *
 * @example
 *     install(ctx, 'rimraf@2', './node_modules')
 */
export default function install(ctx: InstallContext, pkgMeta: PackageMeta, modules: string, options: InstallationOptions): Promise<InstalledPackage>;
