devtools-tracing 1.2.1 → 1.2.2

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 (335) hide show
  1. package/dist/lib/front_end/core/common/App.d.ts +3 -0
  2. package/dist/lib/front_end/core/common/AppProvider.d.ts +12 -0
  3. package/dist/lib/front_end/core/common/Base64.d.ts +11 -0
  4. package/dist/lib/front_end/core/common/CharacterIdMap.d.ts +5 -0
  5. package/dist/lib/front_end/core/common/Color.d.ts +383 -0
  6. package/dist/lib/front_end/core/common/ColorConverter.d.ts +24 -0
  7. package/dist/lib/front_end/core/common/ColorUtils.d.ts +45 -0
  8. package/dist/lib/front_end/core/common/Console.d.ts +54 -0
  9. package/dist/lib/front_end/core/common/Debouncer.d.ts +6 -0
  10. package/dist/lib/front_end/core/common/EventTarget.d.ts +23 -0
  11. package/dist/lib/front_end/core/common/Gzip.d.ts +21 -0
  12. package/dist/lib/front_end/core/common/JavaScriptMetaData.d.ts +20 -0
  13. package/dist/lib/front_end/core/common/Lazy.d.ts +4 -0
  14. package/dist/lib/front_end/core/common/MapWithDefault.d.ts +9 -0
  15. package/dist/lib/front_end/core/common/Mutex.d.ts +13 -0
  16. package/dist/lib/front_end/core/common/Object.d.ts +25 -0
  17. package/dist/lib/front_end/core/common/ParsedURL.d.ts +87 -0
  18. package/dist/lib/front_end/core/common/Progress.d.ts +47 -0
  19. package/dist/lib/front_end/core/common/ResolverBase.d.ts +29 -0
  20. package/dist/lib/front_end/core/common/ResourceType.d.ts +89 -0
  21. package/dist/lib/front_end/core/common/ReturnToPanel.d.ts +10 -0
  22. package/dist/lib/front_end/core/common/Revealer.d.ts +79 -0
  23. package/dist/lib/front_end/core/common/Runnable.d.ts +14 -0
  24. package/dist/lib/front_end/core/common/SegmentedRange.d.ts +14 -0
  25. package/dist/lib/front_end/core/common/SettingRegistration.d.ts +175 -0
  26. package/dist/lib/front_end/core/common/Settings.d.ts +168 -0
  27. package/dist/lib/front_end/core/common/SimpleHistoryManager.d.ts +20 -0
  28. package/dist/lib/front_end/core/common/Srcset.d.ts +16 -0
  29. package/dist/lib/front_end/core/common/StringOutputStream.d.ts +10 -0
  30. package/dist/lib/front_end/core/common/TextDictionary.d.ts +11 -0
  31. package/dist/lib/front_end/core/common/Throttler.d.ts +12 -0
  32. package/dist/lib/front_end/core/common/Trie.d.ts +24 -0
  33. package/dist/lib/front_end/core/common/VersionController.d.ts +80 -0
  34. package/dist/lib/front_end/core/common/common.d.ts +35 -0
  35. package/dist/lib/front_end/core/host/AidaClient.d.ts +369 -0
  36. package/dist/lib/front_end/core/host/AidaGcaTranslation.d.ts +9 -0
  37. package/dist/lib/front_end/core/host/DispatchHttpRequestClient.d.ts +14 -0
  38. package/dist/lib/front_end/core/host/GcaTypes.d.ts +405 -0
  39. package/dist/lib/front_end/core/host/GdpClient.d.ts +84 -0
  40. package/dist/lib/front_end/core/host/InspectorFrontendHost.d.ts +29 -0
  41. package/dist/lib/front_end/core/host/InspectorFrontendHostAPI.d.ts +414 -0
  42. package/dist/lib/front_end/core/host/InspectorFrontendHostStub.d.ts +151 -0
  43. package/dist/lib/front_end/core/host/Platform.d.ts +11 -0
  44. package/dist/lib/front_end/core/host/ResourceLoader.d.ts +15 -0
  45. package/dist/lib/front_end/core/host/UserMetrics.d.ts +935 -0
  46. package/dist/lib/front_end/core/host/host.d.ts +12 -0
  47. package/dist/lib/front_end/core/i18n/ByteUtilities.d.ts +11 -0
  48. package/dist/lib/front_end/core/i18n/DevToolsLocale.d.ts +41 -0
  49. package/dist/lib/front_end/core/i18n/NumberFormatter.d.ts +11 -0
  50. package/dist/lib/front_end/core/i18n/i18n.d.ts +6 -0
  51. package/dist/lib/front_end/core/i18n/i18nImpl.d.ts +64 -0
  52. package/dist/lib/front_end/core/i18n/i18nTypes.d.ts +5 -0
  53. package/dist/lib/front_end/core/i18n/time-utilities.d.ts +16 -0
  54. package/dist/lib/front_end/core/platform/ArrayUtilities.d.ts +69 -0
  55. package/dist/lib/front_end/core/platform/Brand.d.ts +21 -0
  56. package/dist/lib/front_end/core/platform/Constructor.d.ts +3 -0
  57. package/dist/lib/front_end/core/platform/DateUtilities.d.ts +2 -0
  58. package/dist/lib/front_end/core/platform/DevToolsPath.d.ts +44 -0
  59. package/dist/lib/front_end/core/platform/HostRuntime.d.ts +3 -0
  60. package/dist/lib/front_end/core/platform/KeyboardUtilities.d.ts +21 -0
  61. package/dist/lib/front_end/core/platform/MapUtilities.d.ts +19 -0
  62. package/dist/lib/front_end/core/platform/MimeType.d.ts +28 -0
  63. package/dist/lib/front_end/core/platform/NumberUtilities.d.ts +14 -0
  64. package/dist/lib/front_end/core/platform/StringUtilities.d.ts +77 -0
  65. package/dist/lib/front_end/core/platform/Timing.d.ts +6 -0
  66. package/dist/lib/front_end/core/platform/TypedArrayUtilities.d.ts +34 -0
  67. package/dist/lib/front_end/core/platform/TypescriptUtilities.d.ts +66 -0
  68. package/dist/lib/front_end/core/platform/UIString.d.ts +3 -0
  69. package/dist/lib/front_end/core/platform/UserVisibleError.d.ts +12 -0
  70. package/dist/lib/front_end/core/platform/api/HostRuntime.d.ts +33 -0
  71. package/dist/lib/front_end/core/platform/api/api.d.ts +2 -0
  72. package/dist/lib/front_end/core/platform/platform.d.ts +18 -0
  73. package/dist/lib/front_end/core/protocol_client/CDPConnection.d.ts +77 -0
  74. package/dist/lib/front_end/core/protocol_client/ConnectionTransport.d.ts +9 -0
  75. package/dist/lib/front_end/core/protocol_client/DevToolsCDPConnection.d.ts +19 -0
  76. package/dist/lib/front_end/core/protocol_client/InspectorBackend.d.ts +221 -0
  77. package/dist/lib/front_end/core/protocol_client/protocol_client.d.ts +5 -0
  78. package/dist/lib/front_end/core/root/DevToolsContext.d.ts +34 -0
  79. package/dist/lib/front_end/core/root/ExperimentNames.d.ts +19 -0
  80. package/dist/lib/front_end/core/root/Runtime.d.ts +339 -0
  81. package/dist/lib/front_end/core/root/root.d.ts +4 -0
  82. package/dist/lib/front_end/core/sdk/AccessibilityModel.d.ts +68 -0
  83. package/dist/lib/front_end/core/sdk/AnimationModel.d.ts +161 -0
  84. package/dist/lib/front_end/core/sdk/AutofillModel.d.ts +23 -0
  85. package/dist/lib/front_end/core/sdk/CPUProfilerModel.d.ts +42 -0
  86. package/dist/lib/front_end/core/sdk/CPUThrottlingManager.d.ts +57 -0
  87. package/dist/lib/front_end/core/sdk/CSSContainerQuery.d.ts +41 -0
  88. package/dist/lib/front_end/core/sdk/CSSFontFace.d.ts +10 -0
  89. package/dist/lib/front_end/core/sdk/CSSLayer.d.ts +9 -0
  90. package/dist/lib/front_end/core/sdk/CSSMatchedStyles.d.ts +116 -0
  91. package/dist/lib/front_end/core/sdk/CSSMedia.d.ts +36 -0
  92. package/dist/lib/front_end/core/sdk/CSSMetadata.d.ts +85 -0
  93. package/dist/lib/front_end/core/sdk/CSSModel.d.ts +186 -0
  94. package/dist/lib/front_end/core/sdk/CSSNavigation.d.ts +10 -0
  95. package/dist/lib/front_end/core/sdk/CSSProperty.d.ts +53 -0
  96. package/dist/lib/front_end/core/sdk/CSSPropertyParser.d.ts +140 -0
  97. package/dist/lib/front_end/core/sdk/CSSPropertyParserMatchers.d.ts +599 -0
  98. package/dist/lib/front_end/core/sdk/CSSQuery.d.ts +21 -0
  99. package/dist/lib/front_end/core/sdk/CSSRule.d.ts +128 -0
  100. package/dist/lib/front_end/core/sdk/CSSScope.d.ts +9 -0
  101. package/dist/lib/front_end/core/sdk/CSSStartingStyle.d.ts +9 -0
  102. package/dist/lib/front_end/core/sdk/CSSStyleDeclaration.d.ts +38 -0
  103. package/dist/lib/front_end/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
  104. package/dist/lib/front_end/core/sdk/CSSSupports.d.ts +10 -0
  105. package/dist/lib/front_end/core/sdk/CategorizedBreakpoint.d.ts +43 -0
  106. package/dist/lib/front_end/core/sdk/ChildTargetManager.d.ts +40 -0
  107. package/dist/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
  108. package/dist/lib/front_end/core/sdk/Connections.d.ts +36 -0
  109. package/dist/lib/front_end/core/sdk/ConsoleModel.d.ts +124 -0
  110. package/dist/lib/front_end/core/sdk/ConsoleModelTypes.d.ts +6 -0
  111. package/dist/lib/front_end/core/sdk/Cookie.d.ts +68 -0
  112. package/dist/lib/front_end/core/sdk/CookieModel.d.ts +31 -0
  113. package/dist/lib/front_end/core/sdk/CookieParser.d.ts +14 -0
  114. package/dist/lib/front_end/core/sdk/DOMDebuggerModel.d.ts +123 -0
  115. package/dist/lib/front_end/core/sdk/DOMModel.d.ts +378 -0
  116. package/dist/lib/front_end/core/sdk/DebuggerModel.d.ts +269 -0
  117. package/dist/lib/front_end/core/sdk/EmulationModel.d.ts +92 -0
  118. package/dist/lib/front_end/core/sdk/EnhancedTracesParser.d.ts +105 -0
  119. package/dist/lib/front_end/core/sdk/EventBreakpointsModel.d.ts +63 -0
  120. package/dist/lib/front_end/core/sdk/FrameAssociated.d.ts +6 -0
  121. package/dist/lib/front_end/core/sdk/FrameManager.d.ts +68 -0
  122. package/dist/lib/front_end/core/sdk/HeapProfilerModel.d.ts +75 -0
  123. package/dist/lib/front_end/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
  124. package/dist/lib/front_end/core/sdk/IOModel.d.ts +10 -0
  125. package/dist/lib/front_end/core/sdk/IsolateManager.d.ts +52 -0
  126. package/dist/lib/front_end/core/sdk/IssuesModel.d.ts +28 -0
  127. package/dist/lib/front_end/core/sdk/LayerTreeBase.d.ts +70 -0
  128. package/dist/lib/front_end/core/sdk/LogModel.d.ts +20 -0
  129. package/dist/lib/front_end/core/sdk/NetworkManager.d.ts +414 -0
  130. package/dist/lib/front_end/core/sdk/NetworkRequest.d.ts +424 -0
  131. package/dist/lib/front_end/core/sdk/OverlayColorGenerator.d.ts +14 -0
  132. package/dist/lib/front_end/core/sdk/OverlayModel.d.ts +161 -0
  133. package/dist/lib/front_end/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
  134. package/dist/lib/front_end/core/sdk/PageLoad.d.ts +14 -0
  135. package/dist/lib/front_end/core/sdk/PageResourceLoader.d.ts +111 -0
  136. package/dist/lib/front_end/core/sdk/PaintProfiler.d.ts +43 -0
  137. package/dist/lib/front_end/core/sdk/PerformanceMetricsModel.d.ts +12 -0
  138. package/dist/lib/front_end/core/sdk/PreloadingModel.d.ts +146 -0
  139. package/dist/lib/front_end/core/sdk/RehydratingConnection.d.ts +57 -0
  140. package/dist/lib/front_end/core/sdk/RehydratingObject.d.ts +59 -0
  141. package/dist/lib/front_end/core/sdk/RemoteObject.d.ts +199 -0
  142. package/dist/lib/front_end/core/sdk/Resource.d.ts +34 -0
  143. package/dist/lib/front_end/core/sdk/ResourceTreeModel.d.ts +249 -0
  144. package/dist/lib/front_end/core/sdk/RuntimeModel.d.ts +158 -0
  145. package/dist/lib/front_end/core/sdk/SDKModel.d.ts +30 -0
  146. package/dist/lib/front_end/core/sdk/ScopeTreeCache.d.ts +21 -0
  147. package/dist/lib/front_end/core/sdk/ScreenCaptureModel.d.ts +69 -0
  148. package/dist/lib/front_end/core/sdk/Script.d.ts +125 -0
  149. package/dist/lib/front_end/core/sdk/SecurityOriginManager.d.ts +23 -0
  150. package/dist/lib/front_end/core/sdk/ServerSentEvents.d.ts +18 -0
  151. package/dist/lib/front_end/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
  152. package/dist/lib/front_end/core/sdk/ServerTiming.d.ts +24 -0
  153. package/dist/lib/front_end/core/sdk/ServiceWorkerCacheModel.d.ts +79 -0
  154. package/dist/lib/front_end/core/sdk/ServiceWorkerManager.d.ts +130 -0
  155. package/dist/lib/front_end/core/sdk/SourceMap.d.ts +173 -0
  156. package/dist/lib/front_end/core/sdk/SourceMapCache.d.ts +11 -0
  157. package/dist/lib/front_end/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
  158. package/dist/lib/front_end/core/sdk/SourceMapManager.d.ts +44 -0
  159. package/dist/lib/front_end/core/sdk/SourceMapScopeChainEntry.d.ts +20 -0
  160. package/dist/lib/front_end/core/sdk/SourceMapScopesInfo.d.ts +123 -0
  161. package/dist/lib/front_end/core/sdk/StorageBucketsModel.d.ts +56 -0
  162. package/dist/lib/front_end/core/sdk/StorageKeyManager.d.ts +38 -0
  163. package/dist/lib/front_end/core/sdk/Target.d.ts +71 -0
  164. package/dist/lib/front_end/core/sdk/TargetManager.d.ts +84 -0
  165. package/dist/lib/front_end/core/sdk/TraceObject.d.ts +37 -0
  166. package/dist/lib/front_end/core/sdk/WebAuthnModel.d.ts +29 -0
  167. package/dist/lib/front_end/core/sdk/WebMCPModel.d.ts +21 -0
  168. package/dist/lib/front_end/core/sdk/sdk.d.ts +90 -0
  169. package/dist/lib/front_end/entrypoints/formatter_worker/FormatterActions.d.ts +48 -0
  170. package/dist/lib/front_end/generated/InspectorBackendCommands.d.ts +14 -0
  171. package/dist/lib/front_end/generated/protocol.d.ts +21618 -0
  172. package/dist/lib/front_end/models/cpu_profile/CPUProfileDataModel.d.ts +104 -0
  173. package/dist/lib/front_end/models/cpu_profile/ProfileTreeModel.d.ts +29 -0
  174. package/dist/lib/front_end/models/cpu_profile/cpu_profile.d.ts +3 -0
  175. package/dist/lib/front_end/models/crux-manager/CrUXManager.d.ts +104 -0
  176. package/dist/lib/front_end/models/crux-manager/crux-manager.d.ts +1 -0
  177. package/dist/lib/front_end/models/emulation/DeviceModeModel.d.ts +135 -0
  178. package/dist/lib/front_end/models/emulation/EmulatedDevices.d.ts +680 -0
  179. package/dist/lib/front_end/models/emulation/emulation.d.ts +3 -0
  180. package/dist/lib/front_end/models/formatter/FormatterWorkerPool.d.ts +58 -0
  181. package/dist/lib/front_end/models/formatter/ScriptFormatter.d.ts +11 -0
  182. package/dist/lib/front_end/models/formatter/formatter.d.ts +3 -0
  183. package/dist/lib/front_end/models/geometry/GeometryImpl.d.ts +105 -0
  184. package/dist/lib/front_end/models/geometry/geometry.d.ts +1 -0
  185. package/dist/lib/front_end/models/text_utils/CodeMirrorUtils.d.ts +3 -0
  186. package/dist/lib/front_end/models/text_utils/ContentData.d.ts +74 -0
  187. package/dist/lib/front_end/models/text_utils/ContentProvider.d.ts +42 -0
  188. package/dist/lib/front_end/models/text_utils/StaticContentProvider.d.ts +13 -0
  189. package/dist/lib/front_end/models/text_utils/StreamingContentData.d.ts +49 -0
  190. package/dist/lib/front_end/models/text_utils/Text.d.ts +19 -0
  191. package/dist/lib/front_end/models/text_utils/TextCursor.d.ts +9 -0
  192. package/dist/lib/front_end/models/text_utils/TextRange.d.ts +80 -0
  193. package/dist/lib/front_end/models/text_utils/TextUtils.d.ts +97 -0
  194. package/dist/lib/front_end/models/text_utils/WasmDisassembly.d.ts +29 -0
  195. package/dist/lib/front_end/models/text_utils/text_utils.d.ts +11 -0
  196. package/dist/lib/front_end/models/trace/EntityMapper.d.ts +33 -0
  197. package/dist/lib/front_end/models/trace/EventsSerializer.d.ts +11 -0
  198. package/dist/lib/front_end/models/trace/LanternComputationData.d.ts +8 -0
  199. package/dist/lib/front_end/models/trace/ModelImpl.d.ts +103 -0
  200. package/dist/lib/front_end/models/trace/Name.d.ts +12 -0
  201. package/dist/lib/front_end/models/trace/Processor.d.ts +39 -0
  202. package/dist/lib/front_end/models/trace/Styles.d.ts +50 -0
  203. package/dist/lib/front_end/models/trace/extras/FilmStrip.d.ts +19 -0
  204. package/dist/lib/front_end/models/trace/extras/Initiators.d.ts +12 -0
  205. package/dist/lib/front_end/models/trace/extras/MainThreadActivity.d.ts +2 -0
  206. package/dist/lib/front_end/models/trace/extras/ScriptDuplication.d.ts +52 -0
  207. package/dist/lib/front_end/models/trace/extras/StackTraceForEvent.d.ts +12 -0
  208. package/dist/lib/front_end/models/trace/extras/ThirdParties.d.ts +22 -0
  209. package/dist/lib/front_end/models/trace/extras/TraceFilter.d.ts +21 -0
  210. package/dist/lib/front_end/models/trace/extras/TraceTree.d.ts +125 -0
  211. package/dist/lib/front_end/models/trace/extras/extras.d.ts +8 -0
  212. package/dist/lib/front_end/models/trace/handlers/AnimationFramesHandler.d.ts +12 -0
  213. package/dist/lib/front_end/models/trace/handlers/AnimationHandler.d.ts +8 -0
  214. package/dist/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.d.ts +20 -0
  215. package/dist/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.d.ts +8 -0
  216. package/dist/lib/front_end/models/trace/handlers/DOMStatsHandler.d.ts +8 -0
  217. package/dist/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.d.ts +106 -0
  218. package/dist/lib/front_end/models/trace/handlers/FlowsHandler.d.ts +7 -0
  219. package/dist/lib/front_end/models/trace/handlers/FramesHandler.d.ts +94 -0
  220. package/dist/lib/front_end/models/trace/handlers/GPUHandler.d.ts +10 -0
  221. package/dist/lib/front_end/models/trace/handlers/ImagePaintingHandler.d.ts +17 -0
  222. package/dist/lib/front_end/models/trace/handlers/InitiatorsHandler.d.ts +20 -0
  223. package/dist/lib/front_end/models/trace/handlers/InvalidationsHandler.d.ts +11 -0
  224. package/dist/lib/front_end/models/trace/handlers/LargestImagePaintHandler.d.ts +10 -0
  225. package/dist/lib/front_end/models/trace/handlers/LargestTextPaintHandler.d.ts +6 -0
  226. package/dist/lib/front_end/models/trace/handlers/LayerTreeHandler.d.ts +12 -0
  227. package/dist/lib/front_end/models/trace/handlers/LayoutShiftsHandler.d.ts +58 -0
  228. package/dist/lib/front_end/models/trace/handlers/MemoryHandler.d.ts +8 -0
  229. package/dist/lib/front_end/models/trace/handlers/MetaHandler.d.ts +82 -0
  230. package/dist/lib/front_end/models/trace/handlers/ModelHandlers.d.ts +30 -0
  231. package/dist/lib/front_end/models/trace/handlers/NetworkRequestsHandler.d.ts +56 -0
  232. package/dist/lib/front_end/models/trace/handlers/PageFramesHandler.d.ts +8 -0
  233. package/dist/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.d.ts +86 -0
  234. package/dist/lib/front_end/models/trace/handlers/RendererHandler.d.ts +100 -0
  235. package/dist/lib/front_end/models/trace/handlers/SamplesHandler.d.ts +46 -0
  236. package/dist/lib/front_end/models/trace/handlers/ScreenshotsHandler.d.ts +12 -0
  237. package/dist/lib/front_end/models/trace/handlers/ScriptsHandler.d.ts +43 -0
  238. package/dist/lib/front_end/models/trace/handlers/SelectorStatsHandler.d.ts +27 -0
  239. package/dist/lib/front_end/models/trace/handlers/Threads.d.ts +34 -0
  240. package/dist/lib/front_end/models/trace/handlers/UserInteractionsHandler.d.ts +78 -0
  241. package/dist/lib/front_end/models/trace/handlers/UserTimingsHandler.d.ts +54 -0
  242. package/dist/lib/front_end/models/trace/handlers/WarningsHandler.d.ts +14 -0
  243. package/dist/lib/front_end/models/trace/handlers/WorkersHandler.d.ts +10 -0
  244. package/dist/lib/front_end/models/trace/handlers/handlers.d.ts +4 -0
  245. package/dist/lib/front_end/models/trace/handlers/helpers.d.ts +21 -0
  246. package/dist/lib/front_end/models/trace/handlers/types.d.ts +54 -0
  247. package/dist/lib/front_end/models/trace/helpers/Extensions.d.ts +6 -0
  248. package/dist/lib/front_end/models/trace/helpers/Network.d.ts +26 -0
  249. package/dist/lib/front_end/models/trace/helpers/SamplesIntegrator.d.ts +62 -0
  250. package/dist/lib/front_end/models/trace/helpers/SyntheticEvents.d.ts +13 -0
  251. package/dist/lib/front_end/models/trace/helpers/Timing.d.ts +59 -0
  252. package/dist/lib/front_end/models/trace/helpers/Trace.d.ts +148 -0
  253. package/dist/lib/front_end/models/trace/helpers/TreeHelpers.d.ts +109 -0
  254. package/dist/lib/front_end/models/trace/helpers/helpers.d.ts +7 -0
  255. package/dist/lib/front_end/models/trace/insights/CLSCulprits.d.ts +137 -0
  256. package/dist/lib/front_end/models/trace/insights/Cache.d.ts +71 -0
  257. package/dist/lib/front_end/models/trace/insights/CharacterSet.d.ts +49 -0
  258. package/dist/lib/front_end/models/trace/insights/Common.d.ts +77 -0
  259. package/dist/lib/front_end/models/trace/insights/DOMSize.d.ts +71 -0
  260. package/dist/lib/front_end/models/trace/insights/DocumentLatency.d.ts +66 -0
  261. package/dist/lib/front_end/models/trace/insights/DuplicatedJavaScript.d.ts +29 -0
  262. package/dist/lib/front_end/models/trace/insights/FontDisplay.d.ts +28 -0
  263. package/dist/lib/front_end/models/trace/insights/ForcedReflow.d.ts +56 -0
  264. package/dist/lib/front_end/models/trace/insights/INPBreakdown.d.ts +50 -0
  265. package/dist/lib/front_end/models/trace/insights/ImageDelivery.d.ts +95 -0
  266. package/dist/lib/front_end/models/trace/insights/LCPBreakdown.d.ts +85 -0
  267. package/dist/lib/front_end/models/trace/insights/LCPDiscovery.d.ts +64 -0
  268. package/dist/lib/front_end/models/trace/insights/LegacyJavaScript.d.ts +35 -0
  269. package/dist/lib/front_end/models/trace/insights/Models.d.ts +19 -0
  270. package/dist/lib/front_end/models/trace/insights/ModernHTTP.d.ts +53 -0
  271. package/dist/lib/front_end/models/trace/insights/NetworkDependencyTree.d.ts +135 -0
  272. package/dist/lib/front_end/models/trace/insights/RenderBlocking.d.ts +34 -0
  273. package/dist/lib/front_end/models/trace/insights/SlowCSSSelector.d.ts +56 -0
  274. package/dist/lib/front_end/models/trace/insights/Statistics.d.ts +18 -0
  275. package/dist/lib/front_end/models/trace/insights/ThirdParties.d.ts +33 -0
  276. package/dist/lib/front_end/models/trace/insights/Viewport.d.ts +24 -0
  277. package/dist/lib/front_end/models/trace/insights/insights.d.ts +6 -0
  278. package/dist/lib/front_end/models/trace/insights/types.d.ts +143 -0
  279. package/dist/lib/front_end/models/trace/lantern/core/LanternError.d.ts +3 -0
  280. package/dist/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.d.ts +112 -0
  281. package/dist/lib/front_end/models/trace/lantern/core/core.d.ts +2 -0
  282. package/dist/lib/front_end/models/trace/lantern/graph/BaseNode.d.ts +98 -0
  283. package/dist/lib/front_end/models/trace/lantern/graph/CPUNode.d.ts +24 -0
  284. package/dist/lib/front_end/models/trace/lantern/graph/NetworkNode.d.ts +22 -0
  285. package/dist/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.d.ts +43 -0
  286. package/dist/lib/front_end/models/trace/lantern/graph/graph.d.ts +4 -0
  287. package/dist/lib/front_end/models/trace/lantern/lantern.d.ts +6 -0
  288. package/dist/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.d.ts +40 -0
  289. package/dist/lib/front_end/models/trace/lantern/metrics/Interactive.d.ts +12 -0
  290. package/dist/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.d.ts +17 -0
  291. package/dist/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.d.ts +14 -0
  292. package/dist/lib/front_end/models/trace/lantern/metrics/Metric.d.ts +44 -0
  293. package/dist/lib/front_end/models/trace/lantern/metrics/SpeedIndex.d.ts +25 -0
  294. package/dist/lib/front_end/models/trace/lantern/metrics/TBTUtils.d.ts +31 -0
  295. package/dist/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.d.ts +16 -0
  296. package/dist/lib/front_end/models/trace/lantern/metrics/metrics.d.ts +8 -0
  297. package/dist/lib/front_end/models/trace/lantern/simulation/ConnectionPool.d.ts +26 -0
  298. package/dist/lib/front_end/models/trace/lantern/simulation/Constants.d.ts +31 -0
  299. package/dist/lib/front_end/models/trace/lantern/simulation/DNSCache.d.ts +22 -0
  300. package/dist/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.d.ts +62 -0
  301. package/dist/lib/front_end/models/trace/lantern/simulation/Simulator.d.ts +84 -0
  302. package/dist/lib/front_end/models/trace/lantern/simulation/TCPConnection.d.ts +47 -0
  303. package/dist/lib/front_end/models/trace/lantern/simulation/simulation.d.ts +6 -0
  304. package/dist/lib/front_end/models/trace/lantern/types/Lantern.d.ts +196 -0
  305. package/dist/lib/front_end/models/trace/lantern/types/types.d.ts +1 -0
  306. package/dist/lib/front_end/models/trace/trace.d.ts +14 -0
  307. package/dist/lib/front_end/models/trace/types/Configuration.d.ts +87 -0
  308. package/dist/lib/front_end/models/trace/types/Extensions.d.ts +77 -0
  309. package/dist/lib/front_end/models/trace/types/File.d.ts +197 -0
  310. package/dist/lib/front_end/models/trace/types/Overlays.d.ts +116 -0
  311. package/dist/lib/front_end/models/trace/types/Timing.d.ts +20 -0
  312. package/dist/lib/front_end/models/trace/types/TraceEvents.d.ts +2452 -0
  313. package/dist/lib/front_end/models/trace/types/types.d.ts +6 -0
  314. package/dist/lib/front_end/third_party/i18n/i18n-impl.d.ts +25 -0
  315. package/dist/lib/front_end/third_party/i18n/i18n.d.ts +3 -0
  316. package/dist/lib/front_end/third_party/i18n/localized-string-set.d.ts +49 -0
  317. package/dist/lib/front_end/third_party/intl-messageformat/intl-messageformat.d.ts +2 -0
  318. package/dist/lib/front_end/third_party/legacy-javascript/legacy-javascript.d.ts +2 -0
  319. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
  320. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
  321. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
  322. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
  323. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
  324. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
  325. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
  326. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
  327. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
  328. package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
  329. package/dist/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
  330. package/dist/lib/front_end/third_party/third-party-web/third-party-web.d.ts +2 -0
  331. package/dist/src/init.d.ts +1 -0
  332. package/dist/src/timeline.d.ts +5 -0
  333. package/examples/inp.ts +34 -0
  334. package/examples/stats.ts +66 -0
  335. package/package.json +1 -1
@@ -0,0 +1,98 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ import type { CPUNode } from './CPUNode.js';
3
+ import type { NetworkNode } from './NetworkNode.js';
4
+ /**
5
+ * A union of all types derived from BaseNode, allowing type check discrimination
6
+ * based on `node.type`. If a new node type is created, it should be added here.
7
+ */
8
+ export type Node<T = Lantern.AnyNetworkObject> = CPUNode<T> | NetworkNode<T>;
9
+ /**
10
+ * @file This class encapsulates logic for handling resources and tasks used to model the
11
+ * execution dependency graph of the page. A node has a unique identifier and can depend on other
12
+ * nodes/be depended on. The construction of the graph maintains some important invariants that are
13
+ * inherent to the model:
14
+ *
15
+ * 1. The graph is a DAG, there are no cycles.
16
+ * 2. There is always a root node upon which all other nodes eventually depend.
17
+ *
18
+ * This allows particular optimizations in this class so that we do no need to check for cycles as
19
+ * these methods are called and we can always start traversal at the root node.
20
+ */
21
+ declare class BaseNode<T = Lantern.AnyNetworkObject> {
22
+ static types: {
23
+ readonly NETWORK: "network";
24
+ readonly CPU: "cpu";
25
+ };
26
+ _id: string;
27
+ _isMainDocument: boolean;
28
+ dependents: Node[];
29
+ dependencies: Node[];
30
+ constructor(id: string);
31
+ get id(): string;
32
+ get type(): 'network' | 'cpu';
33
+ /**
34
+ * In microseconds
35
+ */
36
+ get startTime(): number;
37
+ /**
38
+ * In microseconds
39
+ */
40
+ get endTime(): number;
41
+ setIsMainDocument(value: boolean): void;
42
+ isMainDocument(): boolean;
43
+ getDependents(): Node[];
44
+ getNumberOfDependents(): number;
45
+ getDependencies(): Node[];
46
+ getNumberOfDependencies(): number;
47
+ getRootNode(): Node<T>;
48
+ addDependent(node: Node): void;
49
+ addDependency(node: Node): void;
50
+ removeDependent(node: Node): void;
51
+ removeDependency(node: Node): void;
52
+ removeAllDependencies(): void;
53
+ /**
54
+ * Computes whether the given node is anywhere in the dependency graph of this node.
55
+ * While this method can prevent cycles, it walks the graph and should be used sparingly.
56
+ * Nodes are always considered dependent on themselves for the purposes of cycle detection.
57
+ */
58
+ isDependentOn(node: BaseNode<T>): boolean;
59
+ /**
60
+ * Clones the node's information without adding any dependencies/dependents.
61
+ */
62
+ cloneWithoutRelationships(): Node<T>;
63
+ /**
64
+ * Clones the entire graph connected to this node filtered by the optional predicate. If a node is
65
+ * included by the predicate, all nodes along the paths between the node and the root will be included. If the
66
+ * node this was called on is not included in the resulting filtered graph, the method will throw.
67
+ *
68
+ * This does not clone NetworkNode's `record` or `rawRecord` fields. It may be reasonable to clone the former,
69
+ * to assist in graph construction, but the latter should never be cloned as one constraint of Lantern is that
70
+ * the underlying data records are accessible for plain object reference equality checks.
71
+ */
72
+ cloneWithRelationships(predicate?: (arg0: Node) => boolean): Node;
73
+ /**
74
+ * Traverses all connected nodes in BFS order, calling `callback` exactly once
75
+ * on each. `traversalPath` is the shortest (though not necessarily unique)
76
+ * path from `node` to the root of the iteration.
77
+ *
78
+ * The `getNextNodes` function takes a visited node and returns which nodes to
79
+ * visit next. It defaults to returning the node's dependents.
80
+ */
81
+ traverse(callback: (node: Node<T>, traversalPath: Array<Node<T>>) => void, getNextNodes?: (arg0: Node<T>) => Array<Node<T>>): void;
82
+ /**
83
+ * @see BaseNode.traverse
84
+ */
85
+ traverseGenerator(getNextNodes?: (arg0: Node) => Node[]): Generator<{
86
+ node: Node;
87
+ traversalPath: Node[];
88
+ }, void, unknown>;
89
+ /**
90
+ * If the given node has a cycle, returns a path representing that cycle.
91
+ * Else returns null.
92
+ *
93
+ * Does a DFS on in its dependent graph.
94
+ */
95
+ static findCycle(node: Node, direction?: 'dependents' | 'dependencies' | 'both'): BaseNode[] | null;
96
+ canDependOn(node: Node): boolean;
97
+ }
98
+ export { BaseNode };
@@ -0,0 +1,24 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ import { BaseNode } from './BaseNode.js';
3
+ declare class CPUNode<T = Lantern.AnyNetworkObject> extends BaseNode<T> {
4
+ _event: Lantern.TraceEvent;
5
+ _childEvents: Lantern.TraceEvent[];
6
+ correctedEndTs: number | undefined;
7
+ constructor(parentEvent: Lantern.TraceEvent, childEvents?: Lantern.TraceEvent[], correctedEndTs?: number);
8
+ get type(): 'cpu';
9
+ get startTime(): number;
10
+ get endTime(): number;
11
+ get duration(): number;
12
+ get event(): Lantern.TraceEvent;
13
+ get childEvents(): Lantern.TraceEvent[];
14
+ /**
15
+ * Returns true if this node contains a Layout task.
16
+ */
17
+ didPerformLayout(): boolean;
18
+ /**
19
+ * Returns the script URLs that had their EvaluateScript events occur in this task.
20
+ */
21
+ getEvaluateScriptURLs(): Set<string>;
22
+ cloneWithoutRelationships(): CPUNode;
23
+ }
24
+ export { CPUNode };
@@ -0,0 +1,22 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ import { BaseNode } from './BaseNode.js';
3
+ declare class NetworkNode<T = Lantern.AnyNetworkObject> extends BaseNode<T> {
4
+ _request: Lantern.NetworkRequest<T>;
5
+ constructor(networkRequest: Lantern.NetworkRequest<T>);
6
+ get type(): 'network';
7
+ get startTime(): number;
8
+ get endTime(): number;
9
+ get rawRequest(): Readonly<T>;
10
+ get request(): Lantern.NetworkRequest<T>;
11
+ get initiatorType(): string;
12
+ get fromDiskCache(): boolean;
13
+ get isNonNetworkProtocol(): boolean;
14
+ /**
15
+ * Returns whether this network request can be downloaded without a TCP connection.
16
+ * During simulation we treat data coming in over a network connection separately from on-device data.
17
+ */
18
+ get isConnectionless(): boolean;
19
+ hasRenderBlockingPriority(): boolean;
20
+ cloneWithoutRelationships(): NetworkNode<T>;
21
+ }
22
+ export { NetworkNode };
@@ -0,0 +1,43 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ import type { Node } from './BaseNode.js';
3
+ import { CPUNode } from './CPUNode.js';
4
+ import { NetworkNode } from './NetworkNode.js';
5
+ interface NetworkNodeOutput {
6
+ nodes: NetworkNode[];
7
+ idToNodeMap: Map<string, NetworkNode>;
8
+ urlToNodeMap: Map<string, NetworkNode[]>;
9
+ frameIdToNodeMap: Map<string, NetworkNode | null>;
10
+ }
11
+ declare class PageDependencyGraph {
12
+ static getNetworkInitiators(request: Lantern.NetworkRequest): string[];
13
+ static getNetworkNodeOutput(networkRequests: Lantern.NetworkRequest[]): NetworkNodeOutput;
14
+ static isScheduleableTask(evt: Lantern.TraceEvent): boolean;
15
+ /**
16
+ * There should *always* be at least one top level event, having 0 typically means something is
17
+ * drastically wrong with the trace and we should just give up early and loudly.
18
+ */
19
+ static assertHasToplevelEvents(events: Lantern.TraceEvent[]): void;
20
+ static getCPUNodes(mainThreadEvents: Lantern.TraceEvent[]): CPUNode[];
21
+ static linkNetworkNodes(rootNode: NetworkNode, networkNodeOutput: NetworkNodeOutput): void;
22
+ static linkCPUNodes(rootNode: Node, networkNodeOutput: NetworkNodeOutput, cpuNodes: CPUNode[]): void;
23
+ /**
24
+ * Removes the given node from the graph, but retains all paths between its dependencies and
25
+ * dependents.
26
+ */
27
+ static pruneNode(node: Node): void;
28
+ /**
29
+ * TODO: remove when CDT backend in Lighthouse is gone. Until then, this is a useful debugging tool
30
+ * to find delta between using CDP or the trace to create the network requests.
31
+ *
32
+ * When a test fails using the trace backend, I enabled this debug method and copied the network
33
+ * requests when CDP was used, then when trace is used, and diff'd them. This method helped
34
+ * remove non-logical differences from the comparison (order of properties, slight rounding
35
+ * discrepancies, removing object cycles, etc).
36
+ *
37
+ * When using for a unit test, make sure to do `.only` so you are getting what you expect.
38
+ */
39
+ static debugNormalizeRequests(lanternRequests: Lantern.NetworkRequest[]): void;
40
+ static createGraph(mainThreadEvents: Lantern.TraceEvent[], networkRequests: Lantern.NetworkRequest[], url: Lantern.Simulation.URL): Node;
41
+ static printGraph(rootNode: Node, widthInCharacters?: number): void;
42
+ }
43
+ export { PageDependencyGraph };
@@ -0,0 +1,4 @@
1
+ export * from './BaseNode.js';
2
+ export * from './CPUNode.js';
3
+ export * from './NetworkNode.js';
4
+ export * from './PageDependencyGraph.js';
@@ -0,0 +1,6 @@
1
+ import * as Core from './core/core.js';
2
+ import * as Graph from './graph/graph.js';
3
+ import * as Metrics from './metrics/metrics.js';
4
+ import * as Simulation from './simulation/simulation.js';
5
+ import * as Types from './types/types.js';
6
+ export { Core, Graph, Metrics, Simulation, Types, };
@@ -0,0 +1,40 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Types from '../types/types.js';
3
+ import { Metric, type MetricCoefficients } from './Metric.js';
4
+ interface FirstPaintBasedGraphOpts<T> {
5
+ /**
6
+ * The timestamp used to filter out tasks that occurred after our paint of interest.
7
+ * Typically this is First Contentful Paint or First Meaningful Paint.
8
+ */
9
+ cutoffTimestamp: number;
10
+ /**
11
+ * The function that determines which resources should be considered *possibly*
12
+ * render-blocking.
13
+ */
14
+ treatNodeAsRenderBlocking: (node: Graph.NetworkNode<T>) => boolean;
15
+ /**
16
+ * The function that determines which CPU nodes should also be included in our
17
+ * blocking node IDs set, beyond what getRenderBlockingNodeData() already includes.
18
+ */
19
+ additionalCpuNodesToTreatAsRenderBlocking?: (node: Graph.CPUNode) => boolean;
20
+ }
21
+ declare class FirstContentfulPaint extends Metric {
22
+ static get coefficients(): MetricCoefficients;
23
+ /**
24
+ * Computes the set of URLs that *appeared* to be render-blocking based on our filter,
25
+ * *but definitely were not* render-blocking based on the timing of their EvaluateScript task.
26
+ * It also computes the set of corresponding CPU node ids that were needed for the paint at the
27
+ * given timestamp.
28
+ */
29
+ static getRenderBlockingNodeData<T = unknown>(graph: Graph.Node, { cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking }: FirstPaintBasedGraphOpts<T>): {
30
+ definitelyNotRenderBlockingScriptUrls: Set<string>;
31
+ renderBlockingCpuNodeIds: Set<string>;
32
+ };
33
+ /**
34
+ * Computes the graph required for the first paint of interest.
35
+ */
36
+ static getFirstPaintBasedGraph<T>(dependencyGraph: Graph.Node, { cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking }: FirstPaintBasedGraphOpts<T>): Graph.Node<T>;
37
+ static getOptimisticGraph<T>(dependencyGraph: Graph.Node<T>, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node<T>;
38
+ static getPessimisticGraph<T>(dependencyGraph: Graph.Node<T>, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node<T>;
39
+ }
40
+ export { FirstContentfulPaint };
@@ -0,0 +1,12 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import { type Extras, Metric, type MetricCoefficients, type MetricComputationDataInput, type MetricResult } from './Metric.js';
4
+ declare class Interactive extends Metric {
5
+ static get coefficients(): MetricCoefficients;
6
+ static getOptimisticGraph<T>(dependencyGraph: Graph.Node<T>): Graph.Node<T>;
7
+ static getPessimisticGraph<T>(dependencyGraph: Graph.Node<T>): Graph.Node<T>;
8
+ static getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result;
9
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
10
+ static getLastLongTaskEndTime(nodeTimings: Simulation.Result['nodeTimings'], duration?: number): number;
11
+ }
12
+ export { Interactive };
@@ -0,0 +1,17 @@
1
+ import type * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import type * as Types from '../types/types.js';
4
+ import { type Extras, Metric, type MetricCoefficients, type MetricComputationDataInput, type MetricResult } from './Metric.js';
5
+ declare class LargestContentfulPaint extends Metric {
6
+ static get coefficients(): MetricCoefficients;
7
+ /**
8
+ * Low priority image nodes are usually offscreen and very unlikely to be the
9
+ * resource that is required for LCP. Our LCP graphs include everything except for these images.
10
+ */
11
+ static isNotLowPriorityImageNode(node: Graph.Node): boolean;
12
+ static getOptimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node;
13
+ static getPessimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node;
14
+ static getEstimateFromSimulation(simulationResult: Simulation.Result): Simulation.Result;
15
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
16
+ }
17
+ export { LargestContentfulPaint };
@@ -0,0 +1,14 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import { type Extras, Metric, type MetricCoefficients, type MetricComputationDataInput, type MetricResult } from './Metric.js';
4
+ declare class MaxPotentialFID extends Metric {
5
+ static get coefficients(): MetricCoefficients;
6
+ static getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
7
+ static getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
8
+ static getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result;
9
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
10
+ static getTimingsAfterFCP(nodeTimings: Simulation.Result['nodeTimings'], fcpTimeInMs: number): Array<{
11
+ duration: number;
12
+ }>;
13
+ }
14
+ export { MaxPotentialFID };
@@ -0,0 +1,44 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import type * as Types from '../types/types.js';
4
+ export interface MetricComputationDataInput {
5
+ simulator: Simulation.Simulator;
6
+ graph: Graph.Node<unknown>;
7
+ processedNavigation: Types.Simulation.ProcessedNavigation;
8
+ }
9
+ export interface MetricCoefficients {
10
+ intercept: number;
11
+ optimistic: number;
12
+ pessimistic: number;
13
+ }
14
+ export interface MetricResult<T = Types.AnyNetworkObject> {
15
+ timing: number;
16
+ timestamp?: never;
17
+ optimisticEstimate: Simulation.Result<T>;
18
+ pessimisticEstimate: Simulation.Result<T>;
19
+ optimisticGraph: Graph.Node<T>;
20
+ pessimisticGraph: Graph.Node;
21
+ }
22
+ export interface Extras {
23
+ optimistic: boolean;
24
+ fcpResult?: MetricResult;
25
+ lcpResult?: MetricResult;
26
+ interactiveResult?: MetricResult;
27
+ observedSpeedIndex?: number;
28
+ }
29
+ declare class Metric {
30
+ static getScriptUrls(dependencyGraph: Graph.Node, treatNodeAsRenderBlocking?: (node: Graph.NetworkNode) => boolean): Set<string>;
31
+ static get coefficients(): MetricCoefficients;
32
+ /**
33
+ * Returns the coefficients, scaled by the throttling settings if needed by the metric.
34
+ * Some lantern metrics (speed-index) use components in their estimate that are not
35
+ * from the simulator. In this case, we need to adjust the coefficients as the target throttling
36
+ * settings change.
37
+ */
38
+ static getScaledCoefficients(_rttMs: number): MetricCoefficients;
39
+ static getOptimisticGraph(_dependencyGraph: Graph.Node, _processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node;
40
+ static getPessimisticGraph(_dependencyGraph: Graph.Node, _processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node;
41
+ static getEstimateFromSimulation(simulationResult: Simulation.Result, _extras: Extras): Simulation.Result;
42
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
43
+ }
44
+ export { Metric };
@@ -0,0 +1,25 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import { type Extras, Metric, type MetricCoefficients, type MetricComputationDataInput, type MetricResult } from './Metric.js';
4
+ declare class SpeedIndex extends Metric {
5
+ static get coefficients(): MetricCoefficients;
6
+ static getScaledCoefficients(rttMs: number): MetricCoefficients;
7
+ static getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
8
+ static getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
9
+ static getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result;
10
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
11
+ /**
12
+ * Approximate speed index using layout events from the simulated node timings.
13
+ * The layout-based speed index is the weighted average of the endTime of CPU nodes that contained
14
+ * a 'Layout' task. log(duration) is used as the weight to stand for "significance" to the page.
15
+ *
16
+ * If no layout events can be found or the endTime of a CPU task is too early, FCP is used instead.
17
+ *
18
+ * This approach was determined after evaluating the accuracy/complexity tradeoff of many
19
+ * different methods. Read more in the evaluation doc.
20
+ *
21
+ * @see https://docs.google.com/document/d/1qJWXwxoyVLVadezIp_Tgdk867G3tDNkkVRvUJSH3K1E/edit#
22
+ */
23
+ static computeLayoutBasedSpeedIndex(nodeTimings: Simulation.Result['nodeTimings'], fcpTimeInMs: number): number;
24
+ }
25
+ export { SpeedIndex };
@@ -0,0 +1,31 @@
1
+ declare const BLOCKING_TIME_THRESHOLD = 50;
2
+ /**
3
+ * For TBT, We only want to consider tasks that fall in our time range
4
+ * - FCP and TTI for navigation mode
5
+ * - Trace start and trace end for timespan mode
6
+ *
7
+ * FCP is picked as `startTimeMs` because there is little risk of user input happening
8
+ * before FCP so Long Queuing Qelay regions do not harm user experience. Developers should be
9
+ * optimizing to reach FCP as fast as possible without having to worry about task lengths.
10
+ *
11
+ * TTI is picked as `endTimeMs` because we want a well defined end point for page load.
12
+ *
13
+ * @param startTimeMs Should be FCP in navigation mode and the trace start time in timespan mode
14
+ * @param endTimeMs Should be TTI in navigation mode and the trace end time in timespan mode
15
+ * @param topLevelEvent Leave unset if `event` is top level. Has no effect if `event` has the same duration as `topLevelEvent`.
16
+ */
17
+ declare function calculateTbtImpactForEvent(event: {
18
+ start: number;
19
+ end: number;
20
+ duration: number;
21
+ }, startTimeMs: number, endTimeMs: number, topLevelEvent?: {
22
+ start: number;
23
+ end: number;
24
+ duration: number;
25
+ }): number;
26
+ declare function calculateSumOfBlockingTime(topLevelEvents: Array<{
27
+ start: number;
28
+ end: number;
29
+ duration: number;
30
+ }>, startTimeMs: number, endTimeMs: number): number;
31
+ export { BLOCKING_TIME_THRESHOLD, calculateSumOfBlockingTime, calculateTbtImpactForEvent, };
@@ -0,0 +1,16 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Simulation from '../simulation/simulation.js';
3
+ import { type Extras, Metric, type MetricCoefficients, type MetricComputationDataInput, type MetricResult } from './Metric.js';
4
+ declare class TotalBlockingTime extends Metric {
5
+ static get coefficients(): MetricCoefficients;
6
+ static getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
7
+ static getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
8
+ static getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result;
9
+ static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
10
+ static getTopLevelEvents(nodeTimings: Simulation.Result['nodeTimings'], minDurationMs: number): Array<{
11
+ start: number;
12
+ end: number;
13
+ duration: number;
14
+ }>;
15
+ }
16
+ export { TotalBlockingTime };
@@ -0,0 +1,8 @@
1
+ export * from './FirstContentfulPaint.js';
2
+ export * from './Interactive.js';
3
+ export * from './LargestContentfulPaint.js';
4
+ export * from './MaxPotentialFID.js';
5
+ export * from './Metric.js';
6
+ export * from './SpeedIndex.js';
7
+ export * from './TotalBlockingTime.js';
8
+ export * as TBTUtils from './TBTUtils.js';
@@ -0,0 +1,26 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ import { TCPConnection } from './TCPConnection.js';
3
+ export declare class ConnectionPool {
4
+ options: Required<Lantern.Simulation.Options>;
5
+ records: Lantern.NetworkRequest[];
6
+ connectionsByOrigin: Map<string, TCPConnection[]>;
7
+ connectionsByRequest: Map<Lantern.NetworkRequest, TCPConnection>;
8
+ _connectionsInUse: Set<TCPConnection>;
9
+ connectionReusedByRequestId: Map<string, boolean>;
10
+ constructor(records: Lantern.NetworkRequest[], options: Required<Lantern.Simulation.Options>);
11
+ connectionsInUse(): TCPConnection[];
12
+ initializeConnections(): void;
13
+ findAvailableConnectionWithLargestCongestionWindow(connections: TCPConnection[]): TCPConnection | null;
14
+ /**
15
+ * This method finds an available connection to the origin specified by the network request or null
16
+ * if no connection was available. If returned, connection will not be available for other network
17
+ * records until release is called.
18
+ */
19
+ acquire(request: Lantern.NetworkRequest): TCPConnection | null;
20
+ /**
21
+ * Return the connection currently being used to fetch a request. If no connection
22
+ * currently being used for this request, an error will be thrown.
23
+ */
24
+ acquireActiveConnectionFromRequest(request: Lantern.NetworkRequest): TCPConnection;
25
+ release(request: Lantern.NetworkRequest): void;
26
+ }
@@ -0,0 +1,31 @@
1
+ declare const Constants: {
2
+ throttling: {
3
+ DEVTOOLS_RTT_ADJUSTMENT_FACTOR: number;
4
+ DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR: number;
5
+ mobileSlow4G: {
6
+ rttMs: number;
7
+ throughputKbps: number;
8
+ requestLatencyMs: number;
9
+ downloadThroughputKbps: number;
10
+ uploadThroughputKbps: number;
11
+ cpuSlowdownMultiplier: number;
12
+ };
13
+ mobileRegular3G: {
14
+ rttMs: number;
15
+ throughputKbps: number;
16
+ requestLatencyMs: number;
17
+ downloadThroughputKbps: number;
18
+ uploadThroughputKbps: number;
19
+ cpuSlowdownMultiplier: number;
20
+ };
21
+ desktopDense4G: {
22
+ rttMs: number;
23
+ throughputKbps: number;
24
+ cpuSlowdownMultiplier: number;
25
+ requestLatencyMs: number;
26
+ downloadThroughputKbps: number;
27
+ uploadThroughputKbps: number;
28
+ };
29
+ };
30
+ };
31
+ export { Constants };
@@ -0,0 +1,22 @@
1
+ import type * as Lantern from '../types/types.js';
2
+ declare class DNSCache {
3
+ static rttMultiplier: number;
4
+ rtt: number;
5
+ resolvedDomainNames: Map<string, {
6
+ resolvedAt: number;
7
+ }>;
8
+ constructor({ rtt }: {
9
+ rtt: number;
10
+ });
11
+ getTimeUntilResolution(request: Lantern.NetworkRequest, options?: {
12
+ requestedAt?: number;
13
+ shouldUpdateCache?: boolean;
14
+ }): number;
15
+ updateCacheResolvedAtIfNeeded(request: Lantern.NetworkRequest, resolvedAt: number): void;
16
+ /**
17
+ * Forcefully sets the DNS resolution time for a request.
18
+ * Useful for testing and alternate execution simulations.
19
+ */
20
+ setResolvedAt(domain: string, resolvedAt: number): void;
21
+ }
22
+ export { DNSCache };
@@ -0,0 +1,62 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ interface NodeTimingComplete {
3
+ startTime: number;
4
+ endTime: number;
5
+ queuedTime: number;
6
+ estimatedTimeElapsed: number;
7
+ timeElapsed: number;
8
+ timeElapsedOvershoot: number;
9
+ bytesDownloaded: number;
10
+ }
11
+ type NodeTimingQueued = Pick<NodeTimingComplete, 'queuedTime'>;
12
+ type CpuNodeTimingStarted = NodeTimingQueued & Pick<NodeTimingComplete, 'startTime' | 'timeElapsed'>;
13
+ type NetworkNodeTimingStarted = CpuNodeTimingStarted & Pick<NodeTimingComplete, 'timeElapsedOvershoot' | 'bytesDownloaded'>;
14
+ type CpuNodeTimingInProgress = CpuNodeTimingStarted & Pick<NodeTimingComplete, 'estimatedTimeElapsed'>;
15
+ type NetworkNodeTimingInProgress = NetworkNodeTimingStarted & Pick<NodeTimingComplete, 'estimatedTimeElapsed'>;
16
+ export type CpuNodeTimingComplete = CpuNodeTimingInProgress & Pick<NodeTimingComplete, 'endTime'>;
17
+ export type NetworkNodeTimingComplete = NetworkNodeTimingInProgress & Pick<NodeTimingComplete, 'endTime'> & {
18
+ connectionTiming: ConnectionTiming;
19
+ };
20
+ export type CompleteNodeTiming = CpuNodeTimingComplete | NetworkNodeTimingComplete;
21
+ type NodeTimingData = NodeTimingQueued | CpuNodeTimingStarted | NetworkNodeTimingStarted | CpuNodeTimingInProgress | NetworkNodeTimingInProgress | CpuNodeTimingComplete | NetworkNodeTimingComplete;
22
+ export interface ConnectionTiming {
23
+ dnsResolutionTime?: number;
24
+ connectionTime?: number;
25
+ sslTime?: number;
26
+ timeToFirstByte: number;
27
+ }
28
+ declare class SimulatorTimingMap {
29
+ nodeTimings: Map<Graph.Node, NodeTimingData>;
30
+ constructor();
31
+ getNodes(): Graph.Node[];
32
+ setReadyToStart(node: Graph.Node, values: {
33
+ queuedTime: number;
34
+ }): void;
35
+ setInProgress(node: Graph.Node, values: {
36
+ startTime: number;
37
+ }): void;
38
+ setCompleted(node: Graph.Node, values: {
39
+ endTime: number;
40
+ connectionTiming?: ConnectionTiming;
41
+ }): void;
42
+ setCpu(node: Graph.CPUNode, values: {
43
+ timeElapsed: number;
44
+ }): void;
45
+ setCpuEstimated(node: Graph.CPUNode, values: {
46
+ estimatedTimeElapsed: number;
47
+ }): void;
48
+ setNetwork(node: Graph.NetworkNode, values: {
49
+ timeElapsed: number;
50
+ timeElapsedOvershoot: number;
51
+ bytesDownloaded: number;
52
+ }): void;
53
+ setNetworkEstimated(node: Graph.NetworkNode, values: {
54
+ estimatedTimeElapsed: number;
55
+ }): void;
56
+ getQueued(node: Graph.Node): NodeTimingData;
57
+ getCpuStarted(node: Graph.CPUNode): CpuNodeTimingStarted;
58
+ getNetworkStarted(node: Graph.NetworkNode): NetworkNodeTimingStarted;
59
+ getInProgress(node: Graph.Node): CpuNodeTimingInProgress | NetworkNodeTimingInProgress;
60
+ getCompleted(node: Graph.Node): CpuNodeTimingComplete | NetworkNodeTimingComplete;
61
+ }
62
+ export { SimulatorTimingMap };
@@ -0,0 +1,84 @@
1
+ import * as Graph from '../graph/graph.js';
2
+ import type * as Lantern from '../types/types.js';
3
+ import { ConnectionPool } from './ConnectionPool.js';
4
+ import { DNSCache } from './DNSCache.js';
5
+ import { type CompleteNodeTiming, type ConnectionTiming, SimulatorTimingMap } from './SimulationTimingMap.js';
6
+ import { TCPConnection } from './TCPConnection.js';
7
+ export interface Result<T = Lantern.AnyNetworkObject> {
8
+ timeInMs: number;
9
+ nodeTimings: Map<Graph.Node<T>, Lantern.Simulation.NodeTiming>;
10
+ }
11
+ declare class Simulator<T = Lantern.AnyNetworkObject> {
12
+ static createSimulator(settings: Lantern.Simulation.Settings): Simulator;
13
+ options: Required<Lantern.Simulation.Options>;
14
+ _rtt: number;
15
+ throughput: number;
16
+ maximumConcurrentRequests: number;
17
+ cpuSlowdownMultiplier: number;
18
+ layoutTaskMultiplier: number;
19
+ cachedNodeListByStartPosition: Graph.Node[];
20
+ nodeTimings: SimulatorTimingMap;
21
+ numberInProgressByType: Map<string, number>;
22
+ nodes: Record<number, Set<Graph.Node>>;
23
+ dns: DNSCache;
24
+ connectionPool: ConnectionPool;
25
+ constructor(options?: Lantern.Simulation.Options);
26
+ get rtt(): number;
27
+ initializeConnectionPool(graph: Graph.Node): void;
28
+ /**
29
+ * Initializes the various state data structures such _nodeTimings and the _node Sets by state.
30
+ */
31
+ initializeAuxiliaryData(): void;
32
+ numberInProgress(type: string): number;
33
+ markNodeAsReadyToStart(node: Graph.Node, queuedTime: number): void;
34
+ markNodeAsInProgress(node: Graph.Node, startTime: number): void;
35
+ markNodeAsComplete(node: Graph.Node, endTime: number, connectionTiming?: ConnectionTiming): void;
36
+ acquireConnection(request: Lantern.NetworkRequest): TCPConnection | null;
37
+ getNodesSortedByStartPosition(): Graph.Node[];
38
+ startNodeIfPossible(node: Graph.Node, totalElapsedTime: number): void;
39
+ /**
40
+ * Updates each connection in use with the available throughput based on the number of network requests
41
+ * currently in flight.
42
+ */
43
+ updateNetworkCapacity(): void;
44
+ /**
45
+ * Estimates the number of milliseconds remaining given current conditions before the node is complete.
46
+ */
47
+ estimateTimeRemaining(node: Graph.Node): number;
48
+ estimateCPUTimeRemaining(cpuNode: Graph.CPUNode): number;
49
+ estimateNetworkTimeRemaining(networkNode: Graph.NetworkNode): number;
50
+ /**
51
+ * Computes and returns the minimum estimated completion time of the nodes currently in progress.
52
+ */
53
+ findNextNodeCompletionTime(): number;
54
+ /**
55
+ * Given a time period, computes the progress toward completion that the node made during that time.
56
+ */
57
+ updateProgressMadeInTimePeriod(node: Graph.Node, timePeriodLength: number, totalElapsedTime: number): void;
58
+ computeFinalNodeTimings(): {
59
+ nodeTimings: Map<Graph.Node, Lantern.Simulation.NodeTiming>;
60
+ completeNodeTimings: Map<Graph.Node, CompleteNodeTiming>;
61
+ };
62
+ getOptions(): Required<Lantern.Simulation.Options>;
63
+ /**
64
+ * Estimates the time taken to process all of the graph's nodes, returns the overall time along with
65
+ * each node annotated by start/end times.
66
+ *
67
+ * Simulator/connection pool are allowed to deviate from what was
68
+ * observed in the trace/devtoolsLog and start requests as soon as they are queued (i.e. do not
69
+ * wait around for a warm connection to be available if the original request was fetched on a warm
70
+ * connection).
71
+ */
72
+ simulate(graph: Graph.Node, options?: {
73
+ label?: string;
74
+ }): Result<T>;
75
+ computeWastedMsFromWastedBytes(wastedBytes: number): number;
76
+ static get allNodeTimings(): Map<string, Map<Graph.Node, CompleteNodeTiming>>;
77
+ /**
78
+ * We attempt to start nodes by their observed start time using the request priority as a tie breaker.
79
+ * When simulating, just because a low priority image started 5ms before a high priority image doesn't mean
80
+ * it would have happened like that when the network was slower.
81
+ */
82
+ static computeNodeStartPosition(node: Graph.Node): number;
83
+ }
84
+ export { Simulator };