devtools-tracing 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +4 -0
  2. package/generate.ts +32 -26
  3. package/index.ts +2 -1
  4. package/lib/extension-api/ExtensionAPI.d.ts +357 -0
  5. package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +318 -0
  6. package/lib/front_end/models/bindings/CompilerScriptMapping.ts +536 -0
  7. package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +187 -0
  8. package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +1197 -0
  9. package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +733 -0
  10. package/lib/front_end/models/bindings/DefaultScriptMapping.ts +141 -0
  11. package/lib/front_end/models/bindings/FileUtils.ts +228 -0
  12. package/lib/front_end/models/bindings/LiveLocation.ts +81 -0
  13. package/lib/front_end/models/bindings/NetworkProject.ts +157 -0
  14. package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +312 -0
  15. package/lib/front_end/models/bindings/ResourceMapping.ts +539 -0
  16. package/lib/front_end/models/bindings/ResourceScriptMapping.ts +491 -0
  17. package/lib/front_end/models/bindings/ResourceUtils.ts +103 -0
  18. package/lib/front_end/models/bindings/SASSSourceMapping.ts +222 -0
  19. package/lib/front_end/models/bindings/StylesSourceMapping.ts +316 -0
  20. package/lib/front_end/models/bindings/TempFile.ts +67 -0
  21. package/lib/front_end/models/bindings/bindings.ts +39 -0
  22. package/lib/front_end/models/source_map_scopes/NamesResolver.ts +765 -0
  23. package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +84 -0
  24. package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +11 -0
  25. package/lib/front_end/models/stack_trace/StackTrace.ts +53 -0
  26. package/lib/front_end/models/stack_trace/StackTraceImpl.ts +85 -0
  27. package/lib/front_end/models/stack_trace/StackTraceModel.ts +128 -0
  28. package/lib/front_end/models/stack_trace/Trie.ts +163 -0
  29. package/lib/front_end/models/stack_trace/stack_trace.ts +9 -0
  30. package/lib/front_end/models/stack_trace/stack_trace_impl.ts +13 -0
  31. package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +240 -0
  32. package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +5 -0
  33. package/lib/front_end/models/workspace/FileManager.ts +97 -0
  34. package/lib/front_end/models/workspace/IgnoreListManager.ts +628 -0
  35. package/lib/front_end/models/workspace/SearchConfig.ts +149 -0
  36. package/lib/front_end/models/workspace/UISourceCode.ts +698 -0
  37. package/lib/front_end/models/workspace/WorkspaceImpl.ts +339 -0
  38. package/lib/front_end/models/workspace/workspace.ts +17 -0
  39. package/lib/front_end/panels/timeline/TimelineUIUtils.ts +1029 -0
  40. package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +49 -0
  41. package/lib/front_end/panels/timeline/extensions/extensions.ts +9 -0
  42. package/lib/front_end/third_party/codemirror.next/LICENSE +21 -0
  43. package/lib/front_end/third_party/codemirror.next/README.chromium +30 -0
  44. package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +24 -0
  45. package/lib/front_end/third_party/codemirror.next/bundle.ts +135 -0
  46. package/lib/front_end/third_party/codemirror.next/chunk/angular.js +2 -0
  47. package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -0
  48. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +2 -0
  49. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -0
  50. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +2 -0
  51. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -0
  52. package/lib/front_end/third_party/codemirror.next/chunk/css.js +2 -0
  53. package/lib/front_end/third_party/codemirror.next/chunk/html.js +4 -0
  54. package/lib/front_end/third_party/codemirror.next/chunk/java.js +2 -0
  55. package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +1 -0
  56. package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +2 -0
  57. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +2 -0
  58. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -0
  59. package/lib/front_end/third_party/codemirror.next/chunk/less.js +2 -0
  60. package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +1 -0
  61. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +2 -0
  62. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -0
  63. package/lib/front_end/third_party/codemirror.next/chunk/php.js +2 -0
  64. package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +1 -0
  65. package/lib/front_end/third_party/codemirror.next/chunk/python.js +2 -0
  66. package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +1 -0
  67. package/lib/front_end/third_party/codemirror.next/chunk/sass.js +2 -0
  68. package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -0
  69. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +2 -0
  70. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -0
  71. package/lib/front_end/third_party/codemirror.next/chunk/vue.js +2 -0
  72. package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -0
  73. package/lib/front_end/third_party/codemirror.next/chunk/wast.js +2 -0
  74. package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -0
  75. package/lib/front_end/third_party/codemirror.next/chunk/xml.js +2 -0
  76. package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -0
  77. package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +8057 -0
  78. package/lib/front_end/third_party/codemirror.next/codemirror.next.js +2 -0
  79. package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +1 -0
  80. package/lib/front_end/third_party/codemirror.next/package.json +43 -0
  81. package/lib/front_end/third_party/codemirror.next/rebuild.sh +6 -0
  82. package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +49 -0
  83. package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +26 -0
  84. package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +31 -0
  85. package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +33 -0
  86. package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +26 -0
  87. package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +64 -0
  88. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +62 -0
  89. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -0
  90. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +37 -0
  91. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -0
  92. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +29 -0
  93. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -0
  94. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +8 -0
  95. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -0
  96. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +6 -0
  97. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -0
  98. package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +21 -0
  99. package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +14 -0
  100. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +196 -0
  101. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +1 -0
  102. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +262 -0
  103. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +235 -0
  104. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +1 -0
  105. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +359 -0
  106. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +39 -0
  107. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -0
  108. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +53 -0
  109. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +438 -0
  110. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -0
  111. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +539 -0
  112. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +23 -0
  113. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +1 -0
  114. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +35 -0
  115. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +257 -0
  116. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -0
  117. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +348 -0
  118. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +8 -0
  119. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +1 -0
  120. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +20 -0
  121. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +8 -0
  122. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +184 -0
  123. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +9 -0
  124. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +1 -0
  125. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +12 -0
  126. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +82 -0
  127. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +1 -0
  128. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +99 -0
  129. package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +5 -0
  130. package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +222 -0
  131. package/lib/front_end/ui/legacy/theme_support/theme_support.ts +5 -0
  132. package/package.json +11 -5
  133. package/patches/chrome-devtools-frontend+1.0.1533544.patch +1549 -20
package/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # devtools-tracing
2
+
3
+ Slightly trimmed down re-export of tracing related utilities from
4
+ [devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend).
package/generate.ts CHANGED
@@ -30,10 +30,35 @@ interface CopyItem {
30
30
  excludeCategories?: string[]; // Optional: exclude dependencies matching these path patterns
31
31
  }
32
32
 
33
+ const COMMON_EXCLUSION_CATEGORIES = [
34
+ // Conservative exclusions - only exclude what we're sure is not needed
35
+ 'models/emulation', // Device emulation
36
+ 'models/persistence', // File system features
37
+ 'models/ai_assistance', // AI features
38
+ 'models/live-metrics', // Live metrics
39
+ 'models/crux-manager', // CrUX data
40
+
41
+ // Panel exclusions - exclude other panels (this is safe)
42
+ 'panels/(?!timeline)', // All panels except timeline
43
+
44
+ // UI exclusions - exclude most UI components but keep essentials
45
+ 'ui/legacy/(?!components/linkifier|components/utils|legacy|theme_support|perf_ui)', // Keep essential components
46
+ 'ui/components/(?!code_highlighter)', // Keep only code highlighter
47
+
48
+ // Third-party exclusions - only clearly unused libraries
49
+ // 'third_party/marked', // Markdown rendering
50
+ // 'third_party/web-vitals', // Web vitals metrics
51
+ // 'third_party/acorn', // JavaScript parser
52
+ // 'third_party/lighthouse', // Lighthouse integration
53
+ 'third_party/(?!codemirror.next|i18n|intl-messageformat|legacy-javascript|source-map-scopes-codec|third-party-web)',
54
+
55
+ // Note: This is more aggressive - excluding all UI components
56
+ // May need to add back specific UI components if errors occur
57
+ ];
58
+
33
59
  // List of files and directories to copy
34
60
  const COPY_LIST: CopyItem[] = [
35
61
  {
36
- // source: 'front_end/panels/timeline/TimelineUIUtils.ts',
37
62
  source: 'front_end/models/trace/trace.ts',
38
63
  resolveDependencies: true,
39
64
  // Optional: specify which exports to trace (if not specified, traces all)
@@ -45,31 +70,12 @@ const COPY_LIST: CopyItem[] = [
45
70
  // // Add only the functions you actually need
46
71
  // ],
47
72
  // Optional: exclude certain dependency categories
48
- excludeCategories: [
49
- // Conservative exclusions - only exclude what we're sure is not needed
50
- 'models/emulation', // Device emulation
51
- 'models/persistence', // File system features
52
- 'models/ai_assistance', // AI features
53
- 'models/live-metrics', // Live metrics
54
- 'models/crux-manager', // CrUX data
55
-
56
- // Panel exclusions - exclude other panels (this is safe)
57
- 'panels/(?!timeline)', // All panels except timeline
58
-
59
- // UI exclusions - exclude most UI components but keep essentials
60
- 'ui/legacy/(?!components/linkifier|theme_support|utils|perf_ui)', // Keep essential components
61
- 'ui/components/(?!code_highlighter)', // Keep only code highlighter
62
-
63
- // Third-party exclusions - only clearly unused libraries
64
- // 'third_party/marked', // Markdown rendering
65
- // 'third_party/web-vitals', // Web vitals metrics
66
- // 'third_party/acorn', // JavaScript parser
67
- // 'third_party/lighthouse', // Lighthouse integration
68
- 'third_party/(?!i18n|intl-messageformat|legacy-javascript|third-party-web)',
69
-
70
- // Note: This is more aggressive - excluding all UI components
71
- // May need to add back specific UI components if errors occur
72
- ],
73
+ excludeCategories: COMMON_EXCLUSION_CATEGORIES,
74
+ },
75
+ {
76
+ source: 'front_end/panels/timeline/TimelineUIUtils.ts',
77
+ resolveDependencies: true,
78
+ excludeCategories: COMMON_EXCLUSION_CATEGORIES,
73
79
  },
74
80
  ];
75
81
 
package/index.ts CHANGED
@@ -13,4 +13,5 @@ export function initDevToolsTracing() {
13
13
  DevToolsLocale.instance({ create: true, data });
14
14
  }
15
15
 
16
- export * as trace from './lib/front_end/models/trace/trace';
16
+ export * as TimelineUIUtils from './lib/front_end/panels/timeline/TimelineUIUtils';
17
+ export * as Trace from './lib/front_end/models/trace/trace';
@@ -0,0 +1,357 @@
1
+ // Copyright 2021 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ export namespace Chrome {
6
+ export namespace DevTools {
7
+ export interface EventSink<ListenerT extends(...args: any[]) => void> {
8
+ addListener(listener: ListenerT): void;
9
+ removeListener(listener: ListenerT): void;
10
+ }
11
+
12
+ export interface Resource {
13
+ readonly url: string;
14
+ readonly type: string;
15
+
16
+ /**
17
+ * For WASM resources the content of the `build_id` custom section. For JavaScript resources the
18
+ * `debugId` magic comment.
19
+ */
20
+ readonly buildId?: string;
21
+
22
+ getContent(callback: (content: string, encoding: string) => unknown): void;
23
+ setContent(content: string, commit: boolean, callback?: (error?: Object) => unknown): void;
24
+ /**
25
+ * Augments this resource's scopes information based on the list of {@link NamedFunctionRange}s
26
+ * for improved debuggability and function naming.
27
+ *
28
+ * @throws
29
+ * If this resource was not produced by a sourcemap or if {@link ranges} are not nested properly.
30
+ * Concretely: For each range, start position must be less than end position, and
31
+ * there must be no "straddling" (i.e. partially overlapping ranges).
32
+ */
33
+ setFunctionRangesForScript(ranges: NamedFunctionRange[]): Promise<void>;
34
+ attachSourceMapURL(sourceMapURL: string): Promise<void>;
35
+ }
36
+
37
+ export interface InspectedWindow {
38
+ tabId: number;
39
+
40
+ onResourceAdded: EventSink<(resource: Resource) => unknown>;
41
+ onResourceContentCommitted: EventSink<(resource: Resource, content: string) => unknown>;
42
+
43
+ eval(
44
+ expression: string,
45
+ options?: {scriptExecutionContext?: string, frameURL?: string, useContentScriptContext?: boolean},
46
+ callback?: (result: unknown, exceptioninfo: {
47
+ code: string,
48
+ description: string,
49
+ details: unknown[],
50
+ isError: boolean,
51
+ isException: boolean,
52
+ value: string,
53
+ }) => unknown): void;
54
+ getResources(callback: (resources: Resource[]) => unknown): void;
55
+ reload(reloadOptions?: {ignoreCache?: boolean, injectedScript?: string, userAgent?: string}): void;
56
+ }
57
+
58
+ export interface Button {
59
+ onClicked: EventSink<() => unknown>;
60
+ update(iconPath?: string, tooltipText?: string, disabled?: boolean): void;
61
+ }
62
+
63
+ export interface ExtensionView {
64
+ onHidden: EventSink<() => unknown>;
65
+ onShown: EventSink<(window?: Window) => unknown>;
66
+ }
67
+
68
+ export interface ExtensionPanel extends ExtensionView {
69
+ show(): void;
70
+ onSearch: EventSink<(action: string, queryString?: string) => unknown>;
71
+ createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button;
72
+ }
73
+
74
+ export interface RecorderView extends ExtensionView {
75
+ show(): void;
76
+ }
77
+
78
+ export interface ExtensionSidebarPane extends ExtensionView {
79
+ setHeight(height: string): void;
80
+ setObject(jsonObject: string, rootTitle?: string, callback?: () => unknown): void;
81
+ setPage(path: string): void;
82
+ }
83
+
84
+ export interface PanelWithSidebar {
85
+ createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => unknown): void;
86
+ onSelectionChanged: EventSink<() => unknown>;
87
+ }
88
+
89
+ export interface Panels {
90
+ elements: PanelWithSidebar;
91
+ sources: PanelWithSidebar;
92
+ network: NetworkPanel;
93
+ themeName: string;
94
+
95
+ create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => unknown): void;
96
+ openResource(url: string, lineNumber: number, columnNumber?: number, callback?: () => unknown): void;
97
+
98
+ setOpenResourceHandler(
99
+ callback?: (resource: Resource, lineNumber: number, columnNumber: number) => void, scheme?: string): void;
100
+
101
+ /**
102
+ * Fired when the theme changes in DevTools.
103
+ *
104
+ * @param callback The handler callback to register and be invoked on theme changes.
105
+ */
106
+ setThemeChangeHandler(callback?: (themeName: string) => unknown): void;
107
+ }
108
+
109
+ export interface Request {
110
+ getContent(callback: (content: string, encoding: string) => unknown): void;
111
+ }
112
+
113
+ export interface Network {
114
+ onNavigated: EventSink<(url: string) => unknown>;
115
+ onRequestFinished: EventSink<(request: Request) => unknown>;
116
+
117
+ getHAR(callback: (harLog: object) => unknown): void;
118
+ }
119
+
120
+ export interface NetworkPanel {
121
+ show(options?: {filter: string}): Promise<void>;
122
+ }
123
+
124
+ export interface DevToolsAPI {
125
+ network: Network;
126
+ panels: Panels;
127
+ inspectedWindow: InspectedWindow;
128
+ languageServices: LanguageExtensions;
129
+ recorder: RecorderExtensions;
130
+ performance: Performance;
131
+ }
132
+
133
+ export interface ExperimentalDevToolsAPI {
134
+ inspectedWindow: InspectedWindow;
135
+ }
136
+
137
+ export interface RawModule {
138
+ url: string;
139
+ code?: ArrayBuffer;
140
+ }
141
+
142
+ export interface RawLocationRange {
143
+ rawModuleId: string;
144
+ startOffset: number;
145
+ endOffset: number;
146
+ }
147
+
148
+ export interface RawLocation {
149
+ rawModuleId: string;
150
+ codeOffset: number;
151
+ inlineFrameIndex: number;
152
+ }
153
+
154
+ export interface SourceLocation {
155
+ rawModuleId: string;
156
+ sourceFileURL: string;
157
+ lineNumber: number;
158
+ columnNumber: number;
159
+ }
160
+
161
+ export interface Variable {
162
+ scope: string;
163
+ name: string;
164
+ type: string;
165
+ nestedName?: string[];
166
+ }
167
+
168
+ export interface ScopeInfo {
169
+ type: string;
170
+ typeName: string;
171
+ icon?: string;
172
+ }
173
+
174
+ export interface FunctionInfo {
175
+ name: string;
176
+ }
177
+
178
+ export type RecorderExtensionPlugin = RecorderExtensionExportPlugin|RecorderExtensionReplayPlugin;
179
+
180
+ export interface RecorderExtensionExportPlugin {
181
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
182
+ stringify(recording: Record<string, any>): Promise<string>;
183
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
184
+ stringifyStep(step: Record<string, any>): Promise<string>;
185
+ }
186
+ export interface RecorderExtensionReplayPlugin {
187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
+ replay(recording: Record<string, any>): void;
189
+ }
190
+
191
+ export type RemoteObjectId = string;
192
+ export type RemoteObjectType = 'object'|'undefined'|'string'|'number'|'boolean'|'bigint'|'array'|'null';
193
+
194
+ export interface RemoteObject {
195
+ type: RemoteObjectType;
196
+ className?: string;
197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
+ value?: any;
199
+ description?: string;
200
+ objectId?: RemoteObjectId;
201
+ linearMemoryAddress?: number;
202
+ linearMemorySize?: number;
203
+ hasChildren: boolean;
204
+ }
205
+
206
+ /**
207
+ * This refers to a Javascript or a Wasm value of reference type
208
+ * in the V8 engine. We call it foreign object here to emphasize
209
+ * the difference with the remote objects managed by a language
210
+ * extension plugin.
211
+ */
212
+ export interface ForeignObject {
213
+ type: 'reftype';
214
+ valueClass: 'local'|'global'|'operand';
215
+ index: number;
216
+ }
217
+
218
+ export interface PropertyDescriptor {
219
+ name: string;
220
+ value: RemoteObject|ForeignObject;
221
+ }
222
+
223
+ export interface LanguageExtensionPlugin {
224
+ /**
225
+ * A new raw module has been loaded. If the raw wasm module references an external debug info module, its URL will be
226
+ * passed as symbolsURL.
227
+ */
228
+ addRawModule(rawModuleId: string, symbolsURL: string|undefined, rawModule: RawModule):
229
+ Promise<string[]|{missingSymbolFiles: string[]}>;
230
+
231
+ /**
232
+ * Find locations in raw modules from a location in a source file.
233
+ */
234
+ sourceLocationToRawLocation(sourceLocation: SourceLocation): Promise<RawLocationRange[]>;
235
+
236
+ /**
237
+ * Find locations in source files from a location in a raw module.
238
+ */
239
+ rawLocationToSourceLocation(rawLocation: RawLocation): Promise<SourceLocation[]>;
240
+
241
+ /**
242
+ * Return detailed information about a scope.
243
+ */
244
+ getScopeInfo(type: string): Promise<ScopeInfo>;
245
+
246
+ /**
247
+ * List all variables in lexical scope at a given location in a raw module.
248
+ */
249
+ listVariablesInScope(rawLocation: RawLocation): Promise<Variable[]>;
250
+
251
+ /**
252
+ * Notifies the plugin that a script is removed.
253
+ */
254
+ removeRawModule(rawModuleId: string): Promise<void>;
255
+
256
+ /**
257
+ * Retrieve function name(s) for the function(s) containing the rawLocation. This returns more than one entry if
258
+ * the location is inside of an inlined function with the innermost function at index 0.
259
+ */
260
+ getFunctionInfo(rawLocation: RawLocation): Promise<{frames: FunctionInfo[], missingSymbolFiles: string[]}|
261
+ {missingSymbolFiles: string[]}|{frames: FunctionInfo[]}>;
262
+
263
+ /**
264
+ * Find locations in raw modules corresponding to the inline function
265
+ * that rawLocation is in. Used for stepping out of an inline function.
266
+ */
267
+ getInlinedFunctionRanges(rawLocation: RawLocation): Promise<RawLocationRange[]>;
268
+
269
+ /**
270
+ * Find locations in raw modules corresponding to inline functions
271
+ * called by the function or inline frame that rawLocation is in.
272
+ * Used for stepping over inline functions.
273
+ */
274
+ getInlinedCalleesRanges(rawLocation: RawLocation): Promise<RawLocationRange[]>;
275
+
276
+ /**
277
+ * Retrieve a list of line numbers in a file for which line-to-raw-location mappings exist.
278
+ */
279
+ getMappedLines(rawModuleId: string, sourceFileURL: string): Promise<number[]|undefined>;
280
+
281
+ /**
282
+ * Evaluate a source language expression in the context of a given raw location and a given stopId. stopId is an
283
+ * opaque key that should be passed to the APIs accessing wasm state, e.g., getWasmLinearMemory. A stopId is
284
+ * invalidated once the debugger resumes.
285
+ */
286
+ evaluate(expression: string, context: RawLocation, stopId: unknown): Promise<RemoteObject|ForeignObject|null>;
287
+
288
+ /**
289
+ * Retrieve properties of the remote object identified by the object id.
290
+ */
291
+ getProperties(objectId: RemoteObjectId): Promise<PropertyDescriptor[]>;
292
+
293
+ /**
294
+ * Permanently release the remote object identified by the object id.
295
+ */
296
+ releaseObject(objectId: RemoteObjectId): Promise<void>;
297
+ }
298
+
299
+ export interface SupportedScriptTypes {
300
+ language: string;
301
+ // eslint-disable-next-line @typescript-eslint/naming-convention
302
+ symbol_types: string[];
303
+ }
304
+
305
+ export type WasmValue = {type: 'i32'|'f32'|'f64', value: number}|{type: 'i64', value: bigint}|
306
+ {type: 'v128', value: string}|ForeignObject;
307
+
308
+ export interface LanguageExtensions {
309
+ registerLanguageExtensionPlugin(
310
+ plugin: LanguageExtensionPlugin, pluginName: string,
311
+ supportedScriptTypes: SupportedScriptTypes): Promise<void>;
312
+ unregisterLanguageExtensionPlugin(plugin: LanguageExtensionPlugin): Promise<void>;
313
+
314
+ getWasmLinearMemory(offset: number, length: number, stopId: unknown): Promise<ArrayBuffer>;
315
+ getWasmLocal(local: number, stopId: unknown): Promise<WasmValue>;
316
+ getWasmGlobal(global: number, stopId: unknown): Promise<WasmValue>;
317
+ getWasmOp(op: number, stopId: unknown): Promise<WasmValue>;
318
+
319
+ reportResourceLoad(resourceUrl: string, status: {success: boolean, errorMessage?: string, size?: number}):
320
+ Promise<void>;
321
+ }
322
+
323
+ export interface Position {
324
+ line: number;
325
+ column: number;
326
+ }
327
+
328
+ export interface NamedFunctionRange {
329
+ readonly name: string;
330
+ readonly start: Position;
331
+ readonly end: Position;
332
+ }
333
+
334
+ export interface RecorderExtensions {
335
+ registerRecorderExtensionPlugin(plugin: RecorderExtensionPlugin, pluginName: string, mediaType?: string):
336
+ Promise<void>;
337
+ unregisterRecorderExtensionPlugin(plugin: RecorderExtensionPlugin): Promise<void>;
338
+ createView(title: string, pagePath: string): Promise<RecorderView>;
339
+ }
340
+
341
+ export interface Performance {
342
+ onProfilingStarted: EventSink<() => unknown>;
343
+ onProfilingStopped: EventSink<() => unknown>;
344
+ }
345
+
346
+ export interface Chrome {
347
+ devtools: DevToolsAPI;
348
+ experimental: {devtools: ExperimentalDevToolsAPI};
349
+ }
350
+ }
351
+ }
352
+
353
+ declare global {
354
+ interface Window {
355
+ chrome: Chrome.DevTools.Chrome;
356
+ }
357
+ }