-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathdebugger-scripts-api.d.ts
35 lines (28 loc) · 1.12 KB
/
debugger-scripts-api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
type RunFunction =
| ((debugSession: IDebugSession, context: Context) => IDisposable)
| ((debugSession: IDebugSession, context: Context) => Promise<IDisposable>);
interface IDebugSession {
name: string;
eval(expression: string): Promise<unknown>;
evalJs<T extends any[], TResult>(
bodyFn: (...args: T) => TResult,
...args: T
): Promise<TResult>;
}
interface Context {
vscode: typeof import('vscode');
}
interface IDisposable {
dispose(): void;
}
interface HotReloadConfig {
mode?: 'patch-prototype' | undefined;
}
interface GlobalThisAddition {
$hotReload_applyNewExports?(args: { oldExports: Record<string, unknown>; newSrc: string; config?: HotReloadConfig }): AcceptNewExportsFn | undefined;
}
type AcceptNewExportsFn = (newExports: Record<string, unknown>) => boolean;