export type PatchedFile = { /** Path of the patched file relative to the package root. */ relativePath: string; source: string; }; /** * Reads every file a patch touches and returns their patched source. Nothing is * written to disk — the results are handed to the module loader hook, which * compiles them in place of the originals. * * Returns `null` when a hunk does not apply, which is the signal that upstream * has moved and the patch must be regenerated. */ export declare function readPatchedFiles(packageDir: string, patchFilePath: string): PatchedFile[] | null; /** * True when every hunk reverses cleanly, meaning the patch is already present — * the equivalent of `git apply --reverse --check`. Someone may have applied the * same diff through their own package manager, which is a supported outcome * rather than a conflict. */ export declare function isPatchApplied(packageDir: string, patchFilePath: string): boolean; /** * Applies whichever patch targets `absolutePath`, if any, returning the patched * source or `null` when the file is not a patch target. * * This is the loader-agnostic half of the system: Node's require hook and the * Jest transformer both funnel through it, so a patch means the same thing in * production and under test. */ export declare function patchSourceForPath(absolutePath: string, source: string): string | null;