import type { ProgressReporter } from './install-progress.js';
export type { ProgressEvent, ProgressPhase, ProgressReporter } from './install-progress.js';
export { makeProgressReporter } from './install-progress.js';
export interface InstallOptions {
    /** Directory to install into (npm `--prefix`). Created by caller. */
    prefix: string;
    /** npm-resolvable specs: `name`, `name@version`, `git+https://...`, tarball URL, ... */
    specs: string[];
    /** Verbose logging passes through `--loglevel verbose`. */
    verbose?: boolean;
    /** Optional registry override (writes a temp `.npmrc` in prefix). */
    registry?: string;
    /**
     * Native backend only: write `<prefix>/gjsify-lock.json` after a successful
     * resolve. When the file exists on next call AND `frozen: true`, the
     * resolver is skipped and downloads use the pinned tarball URL + integrity.
     */
    lockfile?: boolean;
    /** Use `<prefix>/gjsify-lock.json` as the source of truth — fail if missing. */
    frozen?: boolean;
    /**
     * Per-package version overrides — `<name> → <range>`. Applied to every
     * edge during dependency resolution, irrespective of the requester.
     * Mirrors npm's top-level `overrides` field and yarn's `resolutions`
     * (the simple, name-only flavour; pattern keys like `typescript@*` are
     * normalised to bare `typescript` by the caller before passing in).
     *
     * Lets a workspace root pin a transitive dep version when the
     * deduplicated tree would otherwise pick a different one — e.g. for
     * forcing `typescript@~5.9` across every `typescript@*` devDep.
     */
    overrides?: Record<string, string>;
    /**
     * Native backend only: skip transitive dependency resolution and only
     * install the top-level requested packages. Use this when the packages
     * are self-contained bundles whose declared `dependencies` are either
     * bundled into the artifact (e.g. `@gjsify/cli`'s GJS bundle) or
     * workspace-only packages not published to npm separately. Setting this
     * avoids spurious packument fetches for workspace-internal packages.
     *
     * Has no effect when `frozen: true` (the lockfile already contains the
     * full resolved tree and is used verbatim) or when `GJSIFY_INSTALL_BACKEND=npm`
     * (npm does its own resolution and does not consult this flag).
     */
    skipDeps?: boolean;
    /**
     * Native backend only: overall wall-clock budget for the install. When
     * fired, in-flight packument + tarball fetches are aborted via their
     * AbortSignals (the resolver/extractor surface the abort as a normal
     * AbortError), so the user gets a clean failure instead of a silent
     * hang. Zero or undefined disables the overall budget — per-request
     * timeouts in @gjsify/npm-registry still apply.
     */
    signal?: AbortSignal;
    /**
     * Native backend only: progress reporter for resolve / download / extract /
     * link phases. The CLI auto-creates a TTY-aware reporter by default; pass
     * a custom reporter (or the `NOOP` from `makeProgressReporter({enabled:false})`)
     * to override.
     */
    progress?: ProgressReporter;
}
export interface InstallResult {
    /** Top-level packages that were requested, with the version each
     *  resolved to. Empty for the npm backend (parsing npm's stdout would
     *  be unreliable; callers that need this should set
     *  GJSIFY_INSTALL_BACKEND=native). */
    installed: Array<{
        name: string;
        version: string;
    }>;
}
export declare function installPackages(opts: InstallOptions): Promise<InstallResult>;
