microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/debugger/nodeDebugAdapter.d.ts
102lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | // These typings do not reflect the typings as intended to be used |
| 5 | // but rather as they exist in truth, so we can reach into the internals |
| 6 | // and access what we need. |
| 7 | declare module VSCodeDebugAdapterPackage { |
| 8 | |
| 9 | class Event { |
| 10 | public event: string; |
| 11 | public body: any; |
| 12 | } |
| 13 | |
| 14 | class DebugSession { |
| 15 | public static run(debugSession: typeof DebugSession): void; |
| 16 | // This is actually inherited from protocol server but we'll put it here |
| 17 | public start(inStream: NodeJS.ReadableStream, outStream: NodeJS.WritableStream): void; |
| 18 | public sendEvent(event: Event): void; |
| 19 | } |
| 20 | class InitializedEvent extends Event { |
| 21 | constructor(); |
| 22 | } |
| 23 | class OutputEvent extends Event { |
| 24 | constructor(message: string, destination?: string); |
| 25 | } |
| 26 | class TerminatedEvent extends Event { |
| 27 | constructor(); |
| 28 | } |
| 29 | |
| 30 | class ContinuedEvent extends Event { |
| 31 | public seq: number; |
| 32 | /** Must be 'event'. */ |
| 33 | public type: string; |
| 34 | public body: { |
| 35 | threadId: number; |
| 36 | }; |
| 37 | } |
| 38 | interface Request { |
| 39 | command: string; |
| 40 | arguments?: any; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | declare module ChromeDebuggerCorePackage { |
| 45 | abstract class ChromeDebugAdapter { |
| 46 | protected _attachMode: boolean; |
| 47 | protected doAttach(port: number, targetUrl?: string, address?: string, timeout?: number): Promise<void>; |
| 48 | } |
| 49 | |
| 50 | interface IChromeDebugSessionOpts { |
| 51 | logFilePath?: string; |
| 52 | adapter: typeof ChromeDebugAdapter; |
| 53 | extensionName: string; |
| 54 | } |
| 55 | |
| 56 | class ChromeDebugSession extends VSCodeDebugAdapterPackage.DebugSession { |
| 57 | protected _debugAdapter: any; |
| 58 | constructor(debuggerLinesAndColumnsStartAt1?: boolean, isServer?: boolean, opts?: IChromeDebugSessionOpts); |
| 59 | protected dispatchRequest(request: { command: string }): void; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | declare module Node2DebugAdapterPackage { |
| 64 | |
| 65 | type ChecksumAlgorithm = "MD5" | "SHA1" | "SHA256" | "timestamp"; |
| 66 | |
| 67 | interface Checksum { |
| 68 | algorithm: ChecksumAlgorithm; |
| 69 | checksum: string; |
| 70 | } |
| 71 | |
| 72 | interface Source { |
| 73 | name?: string; |
| 74 | path?: string; |
| 75 | sourceReference?: number; |
| 76 | presentationHint?: "emphasize" | "deemphasize"; |
| 77 | origin?: string; |
| 78 | adapterData?: any; |
| 79 | checksums?: Checksum[]; |
| 80 | } |
| 81 | |
| 82 | interface Breakpoint { |
| 83 | id?: number; |
| 84 | verified: boolean; |
| 85 | message?: string; |
| 86 | source?: Source; |
| 87 | line?: number; |
| 88 | column?: number; |
| 89 | endLine?: number; |
| 90 | endColumn?: number; |
| 91 | } |
| 92 | |
| 93 | interface ISetBreakpointsResponseBody { |
| 94 | breakpoints: Breakpoint[]; |
| 95 | } |
| 96 | |
| 97 | class Node2DebugAdapter extends ChromeDebuggerCorePackage.ChromeDebugAdapter { |
| 98 | protected doAttach(port: number, targetUrl?: string, address?: string, timeout?: number): Promise<void>; |
| 99 | public setBreakpoints(args: any, requestSeq: number, ids?: number[]): Promise<ISetBreakpointsResponseBody>; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | |