import type { PartialResolvedId } from 'rollup';
import type { Plugin } from '../plugin';
import type { DepsOptimizer } from '../optimizer';
import type { SSROptions } from '..';
import type { PackageCache, PackageData } from '../packages';
export declare const browserExternalId = "__vite-browser-external";
export interface ResolveOptions {
    mainFields?: string[];
    conditions?: string[];
    extensions?: string[];
    dedupe?: string[];
    preserveSymlinks?: boolean;
}
export interface InternalResolveOptions extends ResolveOptions {
    root: string;
    isBuild: boolean;
    isProduction: boolean;
    ssrConfig?: SSROptions;
    packageCache?: PackageCache;
    /**
     * src code mode also attempts the following:
     * - resolving /xxx as URLs
     * - resolving bare imports from optimized deps
     */
    asSrc?: boolean;
    tryIndex?: boolean;
    tryPrefix?: string;
    skipPackageJson?: boolean;
    preferRelative?: boolean;
    preserveSymlinks?: boolean;
    isRequire?: boolean;
    isFromTsImporter?: boolean;
    tryEsmOnly?: boolean;
    scan?: boolean;
    getDepsOptimizer?: () => DepsOptimizer | undefined;
}
export declare function resolvePlugin(baseOptions: InternalResolveOptions): Plugin;
export declare const idToPkgMap: Map<string, PackageData>;
export declare function tryNodeResolve(id: string, importer: string | null | undefined, options: InternalResolveOptions, targetWeb: boolean, depsOptimizer?: DepsOptimizer, ssr?: boolean): PartialResolvedId | undefined;
export declare function tryOptimizedResolve(depsOptimizer: DepsOptimizer, id: string, importer?: string): Promise<string | undefined>;
export declare function resolvePackageEntry(id: string, { dir, data, setResolvedCache, getResolvedCache }: PackageData, targetWeb: boolean, options: InternalResolveOptions): string | undefined;
