Implements prototype patching hot-reload

This commit is contained in:
Henning Dieterichs
2023-11-09 20:22:20 +01:00
committed by Henning Dieterichs
parent acff02431f
commit 48bd510125
5 changed files with 49 additions and 8 deletions

View File

@@ -15,8 +15,8 @@ interface IDisposable {
dispose(): void;
}
interface GlobalThisAddition extends globalThis {
$hotReload_applyNewExports?(oldExports: Record<string, unknown>): AcceptNewExportsFn | undefined;
interface GlobalThisAddition {
$hotReload_applyNewExports?(args: { oldExports: Record<string, unknown>; newSrc: string }): AcceptNewExportsFn | undefined;
}
type AcceptNewExportsFn = (newExports: Record<string, unknown>) => boolean;