import type { Compiler } from '../Compiler';
type BrowserRequire = typeof Compiler.prototype.__internal_browser_require;
/**
 * Represents the runtime context for CommonJS modules in a browser environment.
 */
interface CommonJsRuntime {
    module: any;
    exports: any;
    require: BrowserRequire;
}
interface BrowserRequirePluginOptions {
    /**
     * This function defines how to execute CommonJS code.
     */
    execute?: (code: string, runtime: CommonJsRuntime) => void;
    /**
     * This option provides a direct mapping from the module specifier to the module content, similar to the mechanism of a virtual module.
     * If this option is not provided or the mapping result is undefined, it will fallback to resolving from memfs and run `execute`.
     */
    modules?: Record<string, unknown> | ((id: string) => unknown);
}
/**
 * This plugin inject browser-compatible `require` function to the `Compiler`.
 * 1. This plugin makes it possible to use custom loaders in browser by providing a virtual module mechanism.
 * 2. This plugin resolves the JavaScript in the memfs with Node.js resolution algorithm rather than in the host filesystem.
 * 3. This plugin transform ESM to CommonJS which will be executed with a user-defined `execute` function.
 */
export declare class BrowserRequirePlugin {
    private options;
    /**
     * This is an unsafe way to execute code in the browser using `new Function`.
     * It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
     */
    static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
    constructor(options: BrowserRequirePluginOptions);
    apply(compiler: Compiler): void;
}
export {};
