import type { PlaintextPatch, RegexReplacement, WebpackModule } from "src/types"; /** * Parses a given input and, if it is a regular expression, replaces all occurrences. * of the custom `\i` pattern with a regex pattern that matches valid identifier names. * @param input The input to parse. * @returns A new `RegExp` with the `\i` pattern replaced, or the original input if it is not a `RegExp` */ export declare function parseRegex(input: RegExp | T): RegExp | T; /** * Parses and replaces occurrences of the `$exports` placeholder in the provided input. * with a string referencing the exports of a plugin identified by the given `id`. * @param input The replacement input. * @param id The ID of the plugin whose exports are being referenced. * @returns The processed replacement input with `$exports` replaced by the appropriate plugin exports reference. */ export declare function parseReplace(input: RegexReplacement["replace"], id: string): RegexReplacement["replace"]; /** * Applies a series of plaintext patches to a Webpack module's source code. * @param mod The Webpack module to be patched. * @param id The unique identifier of the module being patched. * @returns The patched Webpack module if modifications were made, otherwise the original module. * @throws {Error} Will throw an error if there is a syntax error in the patched source code during evaluation. * @internal */ export declare function patchModuleSource(mod: WebpackModule, id: string): WebpackModule; /** * Adds plaintext patches to be applied to Webpack modules. * @param patches An array of plaintext patches to be applied. * @param id A unique identifier for the set of patches being applied. * @internal */ export declare function patchPlaintext(patches: PlaintextPatch[], id: string): void;