2023-09-01 19:41:45 +08:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
2024-02-02 19:27:15 +08:00
|
|
|
type RunFunction =
|
|
|
|
| ((debugSession: IDebugSession, context: Context) => IDisposable)
|
|
|
|
| ((debugSession: IDebugSession, context: Context) => Promise<IDisposable>);
|
2023-09-01 19:41:45 +08:00
|
|
|
|
|
|
|
interface IDebugSession {
|
|
|
|
name: string;
|
2024-02-02 19:27:15 +08:00
|
|
|
eval(expression: string): Promise<unknown>;
|
|
|
|
evalJs<T extends any[], TResult>(
|
|
|
|
bodyFn: (...args: T) => TResult,
|
|
|
|
...args: T
|
|
|
|
): Promise<TResult>;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Context {
|
|
|
|
vscode: typeof import('vscode');
|
2023-09-01 19:41:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IDisposable {
|
|
|
|
dispose(): void;
|
|
|
|
}
|
|
|
|
|
2024-02-02 19:27:15 +08:00
|
|
|
interface HotReloadConfig {
|
|
|
|
mode?: 'patch-prototype' | undefined;
|
|
|
|
}
|
|
|
|
|
2023-11-10 03:22:20 +08:00
|
|
|
interface GlobalThisAddition {
|
2024-02-02 19:27:15 +08:00
|
|
|
$hotReload_applyNewExports?(args: { oldExports: Record<string, unknown>; newSrc: string; config?: HotReloadConfig }): AcceptNewExportsFn | undefined;
|
2023-09-01 19:41:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type AcceptNewExportsFn = (newExports: Record<string, unknown>) => boolean;
|