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.
- package/dist/lib/front_end/core/common/App.d.ts +3 -0
- package/dist/lib/front_end/core/common/AppProvider.d.ts +12 -0
- package/dist/lib/front_end/core/common/Base64.d.ts +11 -0
- package/dist/lib/front_end/core/common/CharacterIdMap.d.ts +5 -0
- package/dist/lib/front_end/core/common/Color.d.ts +383 -0
- package/dist/lib/front_end/core/common/ColorConverter.d.ts +24 -0
- package/dist/lib/front_end/core/common/ColorUtils.d.ts +45 -0
- package/dist/lib/front_end/core/common/Console.d.ts +54 -0
- package/dist/lib/front_end/core/common/Debouncer.d.ts +6 -0
- package/dist/lib/front_end/core/common/EventTarget.d.ts +23 -0
- package/dist/lib/front_end/core/common/Gzip.d.ts +21 -0
- package/dist/lib/front_end/core/common/JavaScriptMetaData.d.ts +20 -0
- package/dist/lib/front_end/core/common/Lazy.d.ts +4 -0
- package/dist/lib/front_end/core/common/MapWithDefault.d.ts +9 -0
- package/dist/lib/front_end/core/common/Mutex.d.ts +13 -0
- package/dist/lib/front_end/core/common/Object.d.ts +25 -0
- package/dist/lib/front_end/core/common/ParsedURL.d.ts +87 -0
- package/dist/lib/front_end/core/common/Progress.d.ts +47 -0
- package/dist/lib/front_end/core/common/ResolverBase.d.ts +29 -0
- package/dist/lib/front_end/core/common/ResourceType.d.ts +89 -0
- package/dist/lib/front_end/core/common/ReturnToPanel.d.ts +10 -0
- package/dist/lib/front_end/core/common/Revealer.d.ts +79 -0
- package/dist/lib/front_end/core/common/Runnable.d.ts +14 -0
- package/dist/lib/front_end/core/common/SegmentedRange.d.ts +14 -0
- package/dist/lib/front_end/core/common/SettingRegistration.d.ts +175 -0
- package/dist/lib/front_end/core/common/Settings.d.ts +168 -0
- package/dist/lib/front_end/core/common/SimpleHistoryManager.d.ts +20 -0
- package/dist/lib/front_end/core/common/Srcset.d.ts +16 -0
- package/dist/lib/front_end/core/common/StringOutputStream.d.ts +10 -0
- package/dist/lib/front_end/core/common/TextDictionary.d.ts +11 -0
- package/dist/lib/front_end/core/common/Throttler.d.ts +12 -0
- package/dist/lib/front_end/core/common/Trie.d.ts +24 -0
- package/dist/lib/front_end/core/common/VersionController.d.ts +80 -0
- package/dist/lib/front_end/core/common/common.d.ts +35 -0
- package/dist/lib/front_end/core/host/AidaClient.d.ts +369 -0
- package/dist/lib/front_end/core/host/AidaGcaTranslation.d.ts +9 -0
- package/dist/lib/front_end/core/host/DispatchHttpRequestClient.d.ts +14 -0
- package/dist/lib/front_end/core/host/GcaTypes.d.ts +405 -0
- package/dist/lib/front_end/core/host/GdpClient.d.ts +84 -0
- package/dist/lib/front_end/core/host/InspectorFrontendHost.d.ts +29 -0
- package/dist/lib/front_end/core/host/InspectorFrontendHostAPI.d.ts +414 -0
- package/dist/lib/front_end/core/host/InspectorFrontendHostStub.d.ts +151 -0
- package/dist/lib/front_end/core/host/Platform.d.ts +11 -0
- package/dist/lib/front_end/core/host/ResourceLoader.d.ts +15 -0
- package/dist/lib/front_end/core/host/UserMetrics.d.ts +935 -0
- package/dist/lib/front_end/core/host/host.d.ts +12 -0
- package/dist/lib/front_end/core/i18n/ByteUtilities.d.ts +11 -0
- package/dist/lib/front_end/core/i18n/DevToolsLocale.d.ts +41 -0
- package/dist/lib/front_end/core/i18n/NumberFormatter.d.ts +11 -0
- package/dist/lib/front_end/core/i18n/i18n.d.ts +6 -0
- package/dist/lib/front_end/core/i18n/i18nImpl.d.ts +64 -0
- package/dist/lib/front_end/core/i18n/i18nTypes.d.ts +5 -0
- package/dist/lib/front_end/core/i18n/time-utilities.d.ts +16 -0
- package/dist/lib/front_end/core/platform/ArrayUtilities.d.ts +69 -0
- package/dist/lib/front_end/core/platform/Brand.d.ts +21 -0
- package/dist/lib/front_end/core/platform/Constructor.d.ts +3 -0
- package/dist/lib/front_end/core/platform/DateUtilities.d.ts +2 -0
- package/dist/lib/front_end/core/platform/DevToolsPath.d.ts +44 -0
- package/dist/lib/front_end/core/platform/HostRuntime.d.ts +3 -0
- package/dist/lib/front_end/core/platform/KeyboardUtilities.d.ts +21 -0
- package/dist/lib/front_end/core/platform/MapUtilities.d.ts +19 -0
- package/dist/lib/front_end/core/platform/MimeType.d.ts +28 -0
- package/dist/lib/front_end/core/platform/NumberUtilities.d.ts +14 -0
- package/dist/lib/front_end/core/platform/StringUtilities.d.ts +77 -0
- package/dist/lib/front_end/core/platform/Timing.d.ts +6 -0
- package/dist/lib/front_end/core/platform/TypedArrayUtilities.d.ts +34 -0
- package/dist/lib/front_end/core/platform/TypescriptUtilities.d.ts +66 -0
- package/dist/lib/front_end/core/platform/UIString.d.ts +3 -0
- package/dist/lib/front_end/core/platform/UserVisibleError.d.ts +12 -0
- package/dist/lib/front_end/core/platform/api/HostRuntime.d.ts +33 -0
- package/dist/lib/front_end/core/platform/api/api.d.ts +2 -0
- package/dist/lib/front_end/core/platform/platform.d.ts +18 -0
- package/dist/lib/front_end/core/protocol_client/CDPConnection.d.ts +77 -0
- package/dist/lib/front_end/core/protocol_client/ConnectionTransport.d.ts +9 -0
- package/dist/lib/front_end/core/protocol_client/DevToolsCDPConnection.d.ts +19 -0
- package/dist/lib/front_end/core/protocol_client/InspectorBackend.d.ts +221 -0
- package/dist/lib/front_end/core/protocol_client/protocol_client.d.ts +5 -0
- package/dist/lib/front_end/core/root/DevToolsContext.d.ts +34 -0
- package/dist/lib/front_end/core/root/ExperimentNames.d.ts +19 -0
- package/dist/lib/front_end/core/root/Runtime.d.ts +339 -0
- package/dist/lib/front_end/core/root/root.d.ts +4 -0
- package/dist/lib/front_end/core/sdk/AccessibilityModel.d.ts +68 -0
- package/dist/lib/front_end/core/sdk/AnimationModel.d.ts +161 -0
- package/dist/lib/front_end/core/sdk/AutofillModel.d.ts +23 -0
- package/dist/lib/front_end/core/sdk/CPUProfilerModel.d.ts +42 -0
- package/dist/lib/front_end/core/sdk/CPUThrottlingManager.d.ts +57 -0
- package/dist/lib/front_end/core/sdk/CSSContainerQuery.d.ts +41 -0
- package/dist/lib/front_end/core/sdk/CSSFontFace.d.ts +10 -0
- package/dist/lib/front_end/core/sdk/CSSLayer.d.ts +9 -0
- package/dist/lib/front_end/core/sdk/CSSMatchedStyles.d.ts +116 -0
- package/dist/lib/front_end/core/sdk/CSSMedia.d.ts +36 -0
- package/dist/lib/front_end/core/sdk/CSSMetadata.d.ts +85 -0
- package/dist/lib/front_end/core/sdk/CSSModel.d.ts +186 -0
- package/dist/lib/front_end/core/sdk/CSSNavigation.d.ts +10 -0
- package/dist/lib/front_end/core/sdk/CSSProperty.d.ts +53 -0
- package/dist/lib/front_end/core/sdk/CSSPropertyParser.d.ts +140 -0
- package/dist/lib/front_end/core/sdk/CSSPropertyParserMatchers.d.ts +599 -0
- package/dist/lib/front_end/core/sdk/CSSQuery.d.ts +21 -0
- package/dist/lib/front_end/core/sdk/CSSRule.d.ts +128 -0
- package/dist/lib/front_end/core/sdk/CSSScope.d.ts +9 -0
- package/dist/lib/front_end/core/sdk/CSSStartingStyle.d.ts +9 -0
- package/dist/lib/front_end/core/sdk/CSSStyleDeclaration.d.ts +38 -0
- package/dist/lib/front_end/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
- package/dist/lib/front_end/core/sdk/CSSSupports.d.ts +10 -0
- package/dist/lib/front_end/core/sdk/CategorizedBreakpoint.d.ts +43 -0
- package/dist/lib/front_end/core/sdk/ChildTargetManager.d.ts +40 -0
- package/dist/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
- package/dist/lib/front_end/core/sdk/Connections.d.ts +36 -0
- package/dist/lib/front_end/core/sdk/ConsoleModel.d.ts +124 -0
- package/dist/lib/front_end/core/sdk/ConsoleModelTypes.d.ts +6 -0
- package/dist/lib/front_end/core/sdk/Cookie.d.ts +68 -0
- package/dist/lib/front_end/core/sdk/CookieModel.d.ts +31 -0
- package/dist/lib/front_end/core/sdk/CookieParser.d.ts +14 -0
- package/dist/lib/front_end/core/sdk/DOMDebuggerModel.d.ts +123 -0
- package/dist/lib/front_end/core/sdk/DOMModel.d.ts +378 -0
- package/dist/lib/front_end/core/sdk/DebuggerModel.d.ts +269 -0
- package/dist/lib/front_end/core/sdk/EmulationModel.d.ts +92 -0
- package/dist/lib/front_end/core/sdk/EnhancedTracesParser.d.ts +105 -0
- package/dist/lib/front_end/core/sdk/EventBreakpointsModel.d.ts +63 -0
- package/dist/lib/front_end/core/sdk/FrameAssociated.d.ts +6 -0
- package/dist/lib/front_end/core/sdk/FrameManager.d.ts +68 -0
- package/dist/lib/front_end/core/sdk/HeapProfilerModel.d.ts +75 -0
- package/dist/lib/front_end/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
- package/dist/lib/front_end/core/sdk/IOModel.d.ts +10 -0
- package/dist/lib/front_end/core/sdk/IsolateManager.d.ts +52 -0
- package/dist/lib/front_end/core/sdk/IssuesModel.d.ts +28 -0
- package/dist/lib/front_end/core/sdk/LayerTreeBase.d.ts +70 -0
- package/dist/lib/front_end/core/sdk/LogModel.d.ts +20 -0
- package/dist/lib/front_end/core/sdk/NetworkManager.d.ts +414 -0
- package/dist/lib/front_end/core/sdk/NetworkRequest.d.ts +424 -0
- package/dist/lib/front_end/core/sdk/OverlayColorGenerator.d.ts +14 -0
- package/dist/lib/front_end/core/sdk/OverlayModel.d.ts +161 -0
- package/dist/lib/front_end/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
- package/dist/lib/front_end/core/sdk/PageLoad.d.ts +14 -0
- package/dist/lib/front_end/core/sdk/PageResourceLoader.d.ts +111 -0
- package/dist/lib/front_end/core/sdk/PaintProfiler.d.ts +43 -0
- package/dist/lib/front_end/core/sdk/PerformanceMetricsModel.d.ts +12 -0
- package/dist/lib/front_end/core/sdk/PreloadingModel.d.ts +146 -0
- package/dist/lib/front_end/core/sdk/RehydratingConnection.d.ts +57 -0
- package/dist/lib/front_end/core/sdk/RehydratingObject.d.ts +59 -0
- package/dist/lib/front_end/core/sdk/RemoteObject.d.ts +199 -0
- package/dist/lib/front_end/core/sdk/Resource.d.ts +34 -0
- package/dist/lib/front_end/core/sdk/ResourceTreeModel.d.ts +249 -0
- package/dist/lib/front_end/core/sdk/RuntimeModel.d.ts +158 -0
- package/dist/lib/front_end/core/sdk/SDKModel.d.ts +30 -0
- package/dist/lib/front_end/core/sdk/ScopeTreeCache.d.ts +21 -0
- package/dist/lib/front_end/core/sdk/ScreenCaptureModel.d.ts +69 -0
- package/dist/lib/front_end/core/sdk/Script.d.ts +125 -0
- package/dist/lib/front_end/core/sdk/SecurityOriginManager.d.ts +23 -0
- package/dist/lib/front_end/core/sdk/ServerSentEvents.d.ts +18 -0
- package/dist/lib/front_end/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
- package/dist/lib/front_end/core/sdk/ServerTiming.d.ts +24 -0
- package/dist/lib/front_end/core/sdk/ServiceWorkerCacheModel.d.ts +79 -0
- package/dist/lib/front_end/core/sdk/ServiceWorkerManager.d.ts +130 -0
- package/dist/lib/front_end/core/sdk/SourceMap.d.ts +173 -0
- package/dist/lib/front_end/core/sdk/SourceMapCache.d.ts +11 -0
- package/dist/lib/front_end/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
- package/dist/lib/front_end/core/sdk/SourceMapManager.d.ts +44 -0
- package/dist/lib/front_end/core/sdk/SourceMapScopeChainEntry.d.ts +20 -0
- package/dist/lib/front_end/core/sdk/SourceMapScopesInfo.d.ts +123 -0
- package/dist/lib/front_end/core/sdk/StorageBucketsModel.d.ts +56 -0
- package/dist/lib/front_end/core/sdk/StorageKeyManager.d.ts +38 -0
- package/dist/lib/front_end/core/sdk/Target.d.ts +71 -0
- package/dist/lib/front_end/core/sdk/TargetManager.d.ts +84 -0
- package/dist/lib/front_end/core/sdk/TraceObject.d.ts +37 -0
- package/dist/lib/front_end/core/sdk/WebAuthnModel.d.ts +29 -0
- package/dist/lib/front_end/core/sdk/WebMCPModel.d.ts +21 -0
- package/dist/lib/front_end/core/sdk/sdk.d.ts +90 -0
- package/dist/lib/front_end/entrypoints/formatter_worker/FormatterActions.d.ts +48 -0
- package/dist/lib/front_end/generated/InspectorBackendCommands.d.ts +14 -0
- package/dist/lib/front_end/generated/protocol.d.ts +21618 -0
- package/dist/lib/front_end/models/cpu_profile/CPUProfileDataModel.d.ts +104 -0
- package/dist/lib/front_end/models/cpu_profile/ProfileTreeModel.d.ts +29 -0
- package/dist/lib/front_end/models/cpu_profile/cpu_profile.d.ts +3 -0
- package/dist/lib/front_end/models/crux-manager/CrUXManager.d.ts +104 -0
- package/dist/lib/front_end/models/crux-manager/crux-manager.d.ts +1 -0
- package/dist/lib/front_end/models/emulation/DeviceModeModel.d.ts +135 -0
- package/dist/lib/front_end/models/emulation/EmulatedDevices.d.ts +680 -0
- package/dist/lib/front_end/models/emulation/emulation.d.ts +3 -0
- package/dist/lib/front_end/models/formatter/FormatterWorkerPool.d.ts +58 -0
- package/dist/lib/front_end/models/formatter/ScriptFormatter.d.ts +11 -0
- package/dist/lib/front_end/models/formatter/formatter.d.ts +3 -0
- package/dist/lib/front_end/models/geometry/GeometryImpl.d.ts +105 -0
- package/dist/lib/front_end/models/geometry/geometry.d.ts +1 -0
- package/dist/lib/front_end/models/text_utils/CodeMirrorUtils.d.ts +3 -0
- package/dist/lib/front_end/models/text_utils/ContentData.d.ts +74 -0
- package/dist/lib/front_end/models/text_utils/ContentProvider.d.ts +42 -0
- package/dist/lib/front_end/models/text_utils/StaticContentProvider.d.ts +13 -0
- package/dist/lib/front_end/models/text_utils/StreamingContentData.d.ts +49 -0
- package/dist/lib/front_end/models/text_utils/Text.d.ts +19 -0
- package/dist/lib/front_end/models/text_utils/TextCursor.d.ts +9 -0
- package/dist/lib/front_end/models/text_utils/TextRange.d.ts +80 -0
- package/dist/lib/front_end/models/text_utils/TextUtils.d.ts +97 -0
- package/dist/lib/front_end/models/text_utils/WasmDisassembly.d.ts +29 -0
- package/dist/lib/front_end/models/text_utils/text_utils.d.ts +11 -0
- package/dist/lib/front_end/models/trace/EntityMapper.d.ts +33 -0
- package/dist/lib/front_end/models/trace/EventsSerializer.d.ts +11 -0
- package/dist/lib/front_end/models/trace/LanternComputationData.d.ts +8 -0
- package/dist/lib/front_end/models/trace/ModelImpl.d.ts +103 -0
- package/dist/lib/front_end/models/trace/Name.d.ts +12 -0
- package/dist/lib/front_end/models/trace/Processor.d.ts +39 -0
- package/dist/lib/front_end/models/trace/Styles.d.ts +50 -0
- package/dist/lib/front_end/models/trace/extras/FilmStrip.d.ts +19 -0
- package/dist/lib/front_end/models/trace/extras/Initiators.d.ts +12 -0
- package/dist/lib/front_end/models/trace/extras/MainThreadActivity.d.ts +2 -0
- package/dist/lib/front_end/models/trace/extras/ScriptDuplication.d.ts +52 -0
- package/dist/lib/front_end/models/trace/extras/StackTraceForEvent.d.ts +12 -0
- package/dist/lib/front_end/models/trace/extras/ThirdParties.d.ts +22 -0
- package/dist/lib/front_end/models/trace/extras/TraceFilter.d.ts +21 -0
- package/dist/lib/front_end/models/trace/extras/TraceTree.d.ts +125 -0
- package/dist/lib/front_end/models/trace/extras/extras.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/AnimationFramesHandler.d.ts +12 -0
- package/dist/lib/front_end/models/trace/handlers/AnimationHandler.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.d.ts +20 -0
- package/dist/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/DOMStatsHandler.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.d.ts +106 -0
- package/dist/lib/front_end/models/trace/handlers/FlowsHandler.d.ts +7 -0
- package/dist/lib/front_end/models/trace/handlers/FramesHandler.d.ts +94 -0
- package/dist/lib/front_end/models/trace/handlers/GPUHandler.d.ts +10 -0
- package/dist/lib/front_end/models/trace/handlers/ImagePaintingHandler.d.ts +17 -0
- package/dist/lib/front_end/models/trace/handlers/InitiatorsHandler.d.ts +20 -0
- package/dist/lib/front_end/models/trace/handlers/InvalidationsHandler.d.ts +11 -0
- package/dist/lib/front_end/models/trace/handlers/LargestImagePaintHandler.d.ts +10 -0
- package/dist/lib/front_end/models/trace/handlers/LargestTextPaintHandler.d.ts +6 -0
- package/dist/lib/front_end/models/trace/handlers/LayerTreeHandler.d.ts +12 -0
- package/dist/lib/front_end/models/trace/handlers/LayoutShiftsHandler.d.ts +58 -0
- package/dist/lib/front_end/models/trace/handlers/MemoryHandler.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/MetaHandler.d.ts +82 -0
- package/dist/lib/front_end/models/trace/handlers/ModelHandlers.d.ts +30 -0
- package/dist/lib/front_end/models/trace/handlers/NetworkRequestsHandler.d.ts +56 -0
- package/dist/lib/front_end/models/trace/handlers/PageFramesHandler.d.ts +8 -0
- package/dist/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.d.ts +86 -0
- package/dist/lib/front_end/models/trace/handlers/RendererHandler.d.ts +100 -0
- package/dist/lib/front_end/models/trace/handlers/SamplesHandler.d.ts +46 -0
- package/dist/lib/front_end/models/trace/handlers/ScreenshotsHandler.d.ts +12 -0
- package/dist/lib/front_end/models/trace/handlers/ScriptsHandler.d.ts +43 -0
- package/dist/lib/front_end/models/trace/handlers/SelectorStatsHandler.d.ts +27 -0
- package/dist/lib/front_end/models/trace/handlers/Threads.d.ts +34 -0
- package/dist/lib/front_end/models/trace/handlers/UserInteractionsHandler.d.ts +78 -0
- package/dist/lib/front_end/models/trace/handlers/UserTimingsHandler.d.ts +54 -0
- package/dist/lib/front_end/models/trace/handlers/WarningsHandler.d.ts +14 -0
- package/dist/lib/front_end/models/trace/handlers/WorkersHandler.d.ts +10 -0
- package/dist/lib/front_end/models/trace/handlers/handlers.d.ts +4 -0
- package/dist/lib/front_end/models/trace/handlers/helpers.d.ts +21 -0
- package/dist/lib/front_end/models/trace/handlers/types.d.ts +54 -0
- package/dist/lib/front_end/models/trace/helpers/Extensions.d.ts +6 -0
- package/dist/lib/front_end/models/trace/helpers/Network.d.ts +26 -0
- package/dist/lib/front_end/models/trace/helpers/SamplesIntegrator.d.ts +62 -0
- package/dist/lib/front_end/models/trace/helpers/SyntheticEvents.d.ts +13 -0
- package/dist/lib/front_end/models/trace/helpers/Timing.d.ts +59 -0
- package/dist/lib/front_end/models/trace/helpers/Trace.d.ts +148 -0
- package/dist/lib/front_end/models/trace/helpers/TreeHelpers.d.ts +109 -0
- package/dist/lib/front_end/models/trace/helpers/helpers.d.ts +7 -0
- package/dist/lib/front_end/models/trace/insights/CLSCulprits.d.ts +137 -0
- package/dist/lib/front_end/models/trace/insights/Cache.d.ts +71 -0
- package/dist/lib/front_end/models/trace/insights/CharacterSet.d.ts +49 -0
- package/dist/lib/front_end/models/trace/insights/Common.d.ts +77 -0
- package/dist/lib/front_end/models/trace/insights/DOMSize.d.ts +71 -0
- package/dist/lib/front_end/models/trace/insights/DocumentLatency.d.ts +66 -0
- package/dist/lib/front_end/models/trace/insights/DuplicatedJavaScript.d.ts +29 -0
- package/dist/lib/front_end/models/trace/insights/FontDisplay.d.ts +28 -0
- package/dist/lib/front_end/models/trace/insights/ForcedReflow.d.ts +56 -0
- package/dist/lib/front_end/models/trace/insights/INPBreakdown.d.ts +50 -0
- package/dist/lib/front_end/models/trace/insights/ImageDelivery.d.ts +95 -0
- package/dist/lib/front_end/models/trace/insights/LCPBreakdown.d.ts +85 -0
- package/dist/lib/front_end/models/trace/insights/LCPDiscovery.d.ts +64 -0
- package/dist/lib/front_end/models/trace/insights/LegacyJavaScript.d.ts +35 -0
- package/dist/lib/front_end/models/trace/insights/Models.d.ts +19 -0
- package/dist/lib/front_end/models/trace/insights/ModernHTTP.d.ts +53 -0
- package/dist/lib/front_end/models/trace/insights/NetworkDependencyTree.d.ts +135 -0
- package/dist/lib/front_end/models/trace/insights/RenderBlocking.d.ts +34 -0
- package/dist/lib/front_end/models/trace/insights/SlowCSSSelector.d.ts +56 -0
- package/dist/lib/front_end/models/trace/insights/Statistics.d.ts +18 -0
- package/dist/lib/front_end/models/trace/insights/ThirdParties.d.ts +33 -0
- package/dist/lib/front_end/models/trace/insights/Viewport.d.ts +24 -0
- package/dist/lib/front_end/models/trace/insights/insights.d.ts +6 -0
- package/dist/lib/front_end/models/trace/insights/types.d.ts +143 -0
- package/dist/lib/front_end/models/trace/lantern/core/LanternError.d.ts +3 -0
- package/dist/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.d.ts +112 -0
- package/dist/lib/front_end/models/trace/lantern/core/core.d.ts +2 -0
- package/dist/lib/front_end/models/trace/lantern/graph/BaseNode.d.ts +98 -0
- package/dist/lib/front_end/models/trace/lantern/graph/CPUNode.d.ts +24 -0
- package/dist/lib/front_end/models/trace/lantern/graph/NetworkNode.d.ts +22 -0
- package/dist/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.d.ts +43 -0
- package/dist/lib/front_end/models/trace/lantern/graph/graph.d.ts +4 -0
- package/dist/lib/front_end/models/trace/lantern/lantern.d.ts +6 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.d.ts +40 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/Interactive.d.ts +12 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.d.ts +17 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.d.ts +14 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/Metric.d.ts +44 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/SpeedIndex.d.ts +25 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/TBTUtils.d.ts +31 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.d.ts +16 -0
- package/dist/lib/front_end/models/trace/lantern/metrics/metrics.d.ts +8 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/ConnectionPool.d.ts +26 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/Constants.d.ts +31 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/DNSCache.d.ts +22 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.d.ts +62 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/Simulator.d.ts +84 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/TCPConnection.d.ts +47 -0
- package/dist/lib/front_end/models/trace/lantern/simulation/simulation.d.ts +6 -0
- package/dist/lib/front_end/models/trace/lantern/types/Lantern.d.ts +196 -0
- package/dist/lib/front_end/models/trace/lantern/types/types.d.ts +1 -0
- package/dist/lib/front_end/models/trace/trace.d.ts +14 -0
- package/dist/lib/front_end/models/trace/types/Configuration.d.ts +87 -0
- package/dist/lib/front_end/models/trace/types/Extensions.d.ts +77 -0
- package/dist/lib/front_end/models/trace/types/File.d.ts +197 -0
- package/dist/lib/front_end/models/trace/types/Overlays.d.ts +116 -0
- package/dist/lib/front_end/models/trace/types/Timing.d.ts +20 -0
- package/dist/lib/front_end/models/trace/types/TraceEvents.d.ts +2452 -0
- package/dist/lib/front_end/models/trace/types/types.d.ts +6 -0
- package/dist/lib/front_end/third_party/i18n/i18n-impl.d.ts +25 -0
- package/dist/lib/front_end/third_party/i18n/i18n.d.ts +3 -0
- package/dist/lib/front_end/third_party/i18n/localized-string-set.d.ts +49 -0
- package/dist/lib/front_end/third_party/intl-messageformat/intl-messageformat.d.ts +2 -0
- package/dist/lib/front_end/third_party/legacy-javascript/legacy-javascript.d.ts +2 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
- package/dist/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
- package/dist/lib/front_end/third_party/third-party-web/third-party-web.d.ts +2 -0
- package/dist/src/init.d.ts +1 -0
- package/dist/src/timeline.d.ts +5 -0
- package/examples/inp.ts +34 -0
- package/examples/stats.ts +66 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as AidaClient from './AidaClient.js';
|
|
2
|
+
import * as AidaGcaTranslation from './AidaGcaTranslation.js';
|
|
3
|
+
import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
|
|
4
|
+
import * as GcaTypes from './GcaTypes.js';
|
|
5
|
+
import * as GdpClient from './GdpClient.js';
|
|
6
|
+
import * as InspectorFrontendHost from './InspectorFrontendHost.js';
|
|
7
|
+
import * as InspectorFrontendHostAPI from './InspectorFrontendHostAPI.js';
|
|
8
|
+
import * as Platform from './Platform.js';
|
|
9
|
+
import * as ResourceLoader from './ResourceLoader.js';
|
|
10
|
+
import * as UserMetrics from './UserMetrics.js';
|
|
11
|
+
export { AidaClient, AidaGcaTranslation, DispatchHttpRequestClient, GcaTypes, GdpClient, InspectorFrontendHost, InspectorFrontendHostAPI, Platform, ResourceLoader, UserMetrics, };
|
|
12
|
+
export declare const userMetrics: UserMetrics.UserMetrics;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns string for bytes with legible units.
|
|
3
|
+
* If necessary, can convert bytes to Kb or MB.
|
|
4
|
+
*/
|
|
5
|
+
export declare const bytesToString: (bytes: number) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a string for bytes converted to Kb.
|
|
8
|
+
* This is currently used on tables/rows to maintain consistency
|
|
9
|
+
* and avoid varying units.
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatBytesToKb: (bytes: number) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface DevToolsLocaleData {
|
|
2
|
+
settingLanguage: string;
|
|
3
|
+
navigatorLanguage: string;
|
|
4
|
+
lookupClosestDevToolsLocale: (locale: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export type DevToolsLocaleCreationOptions = {
|
|
7
|
+
create: true;
|
|
8
|
+
data: DevToolsLocaleData;
|
|
9
|
+
} | {
|
|
10
|
+
create: false;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Simple class that determines the DevTools locale based on:
|
|
14
|
+
* 1) navigator.language, which matches the Chrome UI
|
|
15
|
+
* 2) the value of the "language" Setting the user choses
|
|
16
|
+
* 3) available locales in DevTools.
|
|
17
|
+
*
|
|
18
|
+
* The DevTools locale is only determined once during startup and
|
|
19
|
+
* guaranteed to never change. Use this class when using
|
|
20
|
+
* `Intl` APIs.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DevToolsLocale {
|
|
23
|
+
readonly locale: string;
|
|
24
|
+
readonly lookupClosestDevToolsLocale: (locale: string) => string;
|
|
25
|
+
private constructor();
|
|
26
|
+
static instance(opts?: DevToolsLocaleCreationOptions): DevToolsLocale;
|
|
27
|
+
static removeInstance(): void;
|
|
28
|
+
forceFallbackLocale(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true iff DevTools supports the language of the passed locale.
|
|
31
|
+
* Note that it doesn't have to be a one-to-one match, e.g. if DevTools supports
|
|
32
|
+
* 'de', then passing 'de-AT' will return true.
|
|
33
|
+
*/
|
|
34
|
+
languageIsSupportedByDevTools(localeString: string): boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns true iff the two locales have matching languages. This means the
|
|
38
|
+
* passing 'de-AT' and 'de-DE' will return true, while 'de-DE' and 'en' will
|
|
39
|
+
* return false.
|
|
40
|
+
*/
|
|
41
|
+
export declare function localeLanguagesMatch(localeString1: string, localeString2: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface NumberFormatter {
|
|
2
|
+
format(value: number, separator?: string): string;
|
|
3
|
+
formatToParts(value: number): Intl.NumberFormatPart[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates an instance of NumberFormatter.
|
|
7
|
+
*
|
|
8
|
+
* Safe to call in top-level of a module, since the creation of Intl.NumberFormat is deferred
|
|
9
|
+
* until first usage.
|
|
10
|
+
*/
|
|
11
|
+
export declare function defineFormatter(options: Intl.NumberFormatOptions): NumberFormatter;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as ByteUtilities from './ByteUtilities.js';
|
|
2
|
+
import * as DevToolsLocale from './DevToolsLocale.js';
|
|
3
|
+
import * as i18n from './i18nImpl.js';
|
|
4
|
+
import * as NumberFormatter from './NumberFormatter.js';
|
|
5
|
+
import * as TimeUtilities from './time-utilities.js';
|
|
6
|
+
export { ByteUtilities, DevToolsLocale, i18n, NumberFormatter, TimeUtilities, };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as I18n from '../../third_party/i18n/i18n.js';
|
|
2
|
+
import type * as Platform from '../platform/platform.js';
|
|
3
|
+
import { DevToolsLocale } from './DevToolsLocale.js';
|
|
4
|
+
import type * as i18nTypes from './i18nTypes.js';
|
|
5
|
+
/**
|
|
6
|
+
* Look up the best available locale for the requested language through these fall backs:
|
|
7
|
+
* - exact match
|
|
8
|
+
* - progressively shorter prefixes (`de-CH-1996` -> `de-CH` -> `de`)
|
|
9
|
+
* - the default locale ('en-US') if no match is found
|
|
10
|
+
*
|
|
11
|
+
* If `locale` isn't provided, the default is used.
|
|
12
|
+
*/
|
|
13
|
+
export declare function lookupClosestSupportedDevToolsLocale(locale: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a list of all supported DevTools locales, including pseudo locales.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAllSupportedDevToolsLocales(): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Fetches the locale data of the specified locale.
|
|
20
|
+
* Callers have to ensure that `locale` is an officially supported locale.
|
|
21
|
+
* Depending whether a locale is present in `bundledLocales`, the data will be
|
|
22
|
+
* fetched locally or remotely.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchAndRegisterLocaleData(locale: Intl.UnicodeBCP47LocaleIdentifier, location?: string): Promise<void>;
|
|
25
|
+
export declare function hasLocaleDataForTest(locale: Intl.UnicodeBCP47LocaleIdentifier): boolean;
|
|
26
|
+
export declare function resetLocaleDataForTest(): void;
|
|
27
|
+
export declare function registerLocaleDataForTest(locale: Intl.UnicodeBCP47LocaleIdentifier, messages: I18n.I18n.LocalizedMessages): void;
|
|
28
|
+
/**
|
|
29
|
+
* Returns an anonymous function that wraps a call to retrieve a localized string.
|
|
30
|
+
* This is introduced so that localized strings can be declared in environments where
|
|
31
|
+
* the i18n system has not been configured and so, cannot be directly invoked. Instead,
|
|
32
|
+
* strings are lazily localized when they are used. This is used for instance in the
|
|
33
|
+
* meta files used to register module extensions.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getLazilyComputedLocalizedString(registeredStrings: I18n.LocalizedStringSet.RegisteredFileStrings, id: string, values?: i18nTypes.Values): () => Platform.UIString.LocalizedString;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve the localized string.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getLocalizedString(registeredStrings: I18n.LocalizedStringSet.RegisteredFileStrings, id: string, values?: i18nTypes.Values): Platform.UIString.LocalizedString;
|
|
40
|
+
/**
|
|
41
|
+
* Register a file's UIStrings with i18n, return function to generate the string ids.
|
|
42
|
+
*/
|
|
43
|
+
export declare function registerUIStrings(path: string, stringStructure: Record<string, string>): I18n.LocalizedStringSet.RegisteredFileStrings;
|
|
44
|
+
export declare function serializeUIString(string: string, values?: Record<string, Object>): string;
|
|
45
|
+
export declare function deserializeUIString(serializedMessage: string): i18nTypes.SerializedMessage;
|
|
46
|
+
/**
|
|
47
|
+
* Use this function in places where a `LocalizedString` is expected but the
|
|
48
|
+
* term/phrase you want to use does not require translation.
|
|
49
|
+
*/
|
|
50
|
+
export declare function lockedString(str: string): Platform.UIString.LocalizedString;
|
|
51
|
+
/**
|
|
52
|
+
* Same as `lockedString` but for places where `i18nLazyString` would be used otherwise.
|
|
53
|
+
*/
|
|
54
|
+
export declare function lockedLazyString(str: string): () => Platform.UIString.LocalizedString;
|
|
55
|
+
/**
|
|
56
|
+
* Returns a string of the form:
|
|
57
|
+
* "German (Austria) - Deutsch (Österreich)"
|
|
58
|
+
* where the former locale representation is written in the currently enabled DevTools
|
|
59
|
+
* locale and the latter locale representation is written in the locale of `localeString`.
|
|
60
|
+
*
|
|
61
|
+
* Should the two locales match (i.e. have the same language) then the latter locale
|
|
62
|
+
* representation is written in English.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getLocalizedLanguageRegion(localeString: Intl.UnicodeBCP47LocaleIdentifier, devtoolsLocale: DevToolsLocale): Platform.UIString.LocalizedString;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Uses Intl.NumberFormat.
|
|
3
|
+
* @see go/cpq:i18n-units-design
|
|
4
|
+
*/
|
|
5
|
+
import * as Platform from '../platform/platform.js';
|
|
6
|
+
export declare function formatMicroSecondsTime(time: Platform.Timing.MicroSeconds): string;
|
|
7
|
+
export declare function formatMicroSecondsAsSeconds(time: Platform.Timing.MicroSeconds): string;
|
|
8
|
+
export declare function formatMicroSecondsAsMillisFixed(time: Platform.Timing.MicroSeconds): string;
|
|
9
|
+
export declare function formatMicroSecondsAsMillisFixedExpanded(time: Platform.Timing.MicroSeconds): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param higherResolution if true, the output may show as microsends or as milliseconds with a fractional component
|
|
12
|
+
*/
|
|
13
|
+
export declare function millisToString(ms: number, higherResolution?: boolean): string;
|
|
14
|
+
export declare function preciseMillisToString(ms: number, precision?: number, separator?: string): string;
|
|
15
|
+
export declare function preciseSecondsToString(ms: number, precision?: number): string;
|
|
16
|
+
export declare function secondsToString(seconds: number, higherResolution?: boolean): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const removeElement: <T>(array: T[], element: T, firstOnly?: boolean) => boolean;
|
|
2
|
+
type NumberComparator = (a: number, b: number) => number;
|
|
3
|
+
export declare function swap<T>(array: T[], i1: number, i2: number): void;
|
|
4
|
+
export declare function sortRange(array: number[], comparator: NumberComparator, leftBound: number, rightBound: number, sortWindowLeft: number, sortWindowRight: number): number[];
|
|
5
|
+
export declare const binaryIndexOf: <T, S>(array: T[], value: S, comparator: (a: S, b: T) => number) => number;
|
|
6
|
+
export declare const intersectOrdered: <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number) => T[];
|
|
7
|
+
export declare const mergeOrdered: <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number) => T[];
|
|
8
|
+
export declare const DEFAULT_COMPARATOR: (a: string | number, b: string | number) => -1 | 0 | 1;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the index of the element closest to the needle that is equal to or
|
|
11
|
+
* greater than it. Assumes that the provided array is sorted.
|
|
12
|
+
*
|
|
13
|
+
* If no element is found, the right bound is returned.
|
|
14
|
+
*
|
|
15
|
+
* Uses the provided comparator function to determine if two items are equal or
|
|
16
|
+
* if one is greater than the other. If you are working with strings or
|
|
17
|
+
* numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you
|
|
18
|
+
* should define one that takes the needle element and an element from the
|
|
19
|
+
* array and returns a positive or negative number to indicate which is greater
|
|
20
|
+
* than the other.
|
|
21
|
+
*
|
|
22
|
+
* When specified, |left| (inclusive) and |right| (exclusive) indices
|
|
23
|
+
* define the search window.
|
|
24
|
+
*/
|
|
25
|
+
export declare function lowerBound<T>(array: Uint32Array | Int32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number, right?: number): number;
|
|
26
|
+
export declare function lowerBound<S, T>(array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;
|
|
27
|
+
export declare function lowerBound<S, T>(array: readonly S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the index of the element closest to the needle that is greater than
|
|
30
|
+
* it. Assumes that the provided array is sorted.
|
|
31
|
+
*
|
|
32
|
+
* If no element is found, the right bound is returned.
|
|
33
|
+
*
|
|
34
|
+
* Uses the provided comparator function to determine if two items are equal or
|
|
35
|
+
* if one is greater than the other. If you are working with strings or
|
|
36
|
+
* numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you
|
|
37
|
+
* should define one that takes the needle element and an element from the
|
|
38
|
+
* array and returns a positive or negative number to indicate which is greater
|
|
39
|
+
* than the other.
|
|
40
|
+
*
|
|
41
|
+
* When specified, |left| (inclusive) and |right| (exclusive) indices
|
|
42
|
+
* define the search window.
|
|
43
|
+
*/
|
|
44
|
+
export declare function upperBound<T>(array: Uint32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number, right?: number): number;
|
|
45
|
+
export declare function upperBound<S, T>(array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* Obtains the first item in the array that satisfies the predicate function.
|
|
48
|
+
* So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for
|
|
49
|
+
* the first item arr[i] such that arr[i] > 5 you would be returned 2, because
|
|
50
|
+
* array[2] is 6, the first item in the array that satisfies the
|
|
51
|
+
* predicate function.
|
|
52
|
+
*
|
|
53
|
+
* Please note: this presupposes that the array is already ordered.
|
|
54
|
+
*/
|
|
55
|
+
export declare function nearestIndexFromBeginning<T>(arr: T[], predicate: (arrayItem: T) => boolean): number | null;
|
|
56
|
+
/**
|
|
57
|
+
* Obtains the last item in the array that satisfies the predicate function.
|
|
58
|
+
* So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for
|
|
59
|
+
* the last item arr[i] such that arr[i] < 5 you would be returned 1, because
|
|
60
|
+
* arr[1] is 4, the last item in the array that satisfies the
|
|
61
|
+
* predicate function.
|
|
62
|
+
*
|
|
63
|
+
* Please note: this presupposes that the array is already ordered.
|
|
64
|
+
*/
|
|
65
|
+
export declare function nearestIndexFromEnd<T>(arr: readonly T[], predicate: (arrayItem: T) => boolean): number | null;
|
|
66
|
+
/** Type guard for ensuring that `arr` does not contain null or undefined **/
|
|
67
|
+
export declare function arrayDoesNotContainNullOrUndefined<T>(arr: Array<T | null | undefined>): arr is T[];
|
|
68
|
+
export declare function assertArrayIsSorted<T>(arr: readonly T[], compareFn?: (a: T, b: T) => number): void;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper type to introduce new branded types.
|
|
3
|
+
*
|
|
4
|
+
* `Base` is the underlying data type and `Tag` must be unique symbol/string.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```ts
|
|
8
|
+
* type LineNumber = Brand<number, "LineNumber">;
|
|
9
|
+
* type RawUrl = Brand<string, "RawUrl">;
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* We purposefully use the string index of `_tag` rather then creating a Symbol
|
|
13
|
+
* wrapper that would hide if in IDEs and fail build. This means that at build
|
|
14
|
+
* time if one uses `<branded-var>._tag`, it will build without error and have
|
|
15
|
+
* potentially having a runtime error. This allows us to have multiple places
|
|
16
|
+
* where we define the brands and they will overlap. Also a use case for reusing
|
|
17
|
+
* the type in other downstream projects is simplified.
|
|
18
|
+
*/
|
|
19
|
+
export type Brand<Base, Tag> = Base & {
|
|
20
|
+
_tag: Tag;
|
|
21
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Brand } from './Brand.js';
|
|
2
|
+
/**
|
|
3
|
+
* URLs are in DevTools are repsented as encoded URL strings.
|
|
4
|
+
*
|
|
5
|
+
* @example 'file:///Hello%20World/file/js'
|
|
6
|
+
*/
|
|
7
|
+
export type UrlString = Brand<string, 'UrlString'>;
|
|
8
|
+
export declare const EmptyUrlString: UrlString;
|
|
9
|
+
/**
|
|
10
|
+
* Tagged template helper to construct `UrlString`s in a more readable form,
|
|
11
|
+
* without having to sprinkle casts throughout the codebase. Primarily useful
|
|
12
|
+
* for writing unit tests.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```js
|
|
16
|
+
* const url1 = urlString`https://www.example.com/404.html`;
|
|
17
|
+
* const url2 = urlString`http://${host}/path/to/file.js`;
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* This is implemented as a wrapper around `String.raw` for convenience. This
|
|
21
|
+
* function doesn't perform any kind of validation that the returned string is
|
|
22
|
+
* really a valid `UrlString`.
|
|
23
|
+
*
|
|
24
|
+
* @param strings the string parts of the template.
|
|
25
|
+
* @param values the dynamic values of the template.
|
|
26
|
+
* @returns the string constructed from `strings` and `values` casted to an
|
|
27
|
+
* `UrlString`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const urlString: (strings: ArrayLike<string>, ...values: any[]) => UrlString;
|
|
30
|
+
/**
|
|
31
|
+
* File paths in DevTools that are represented as unencoded absolute
|
|
32
|
+
* or relative paths.
|
|
33
|
+
*
|
|
34
|
+
* @example '/Hello World/file.js'
|
|
35
|
+
*/
|
|
36
|
+
export type RawPathString = Brand<string, 'RawPathString'>;
|
|
37
|
+
export declare const EmptyRawPathString: RawPathString;
|
|
38
|
+
/**
|
|
39
|
+
* File paths in DevTools that are represented as encoded paths.
|
|
40
|
+
*
|
|
41
|
+
* @example '/Hello%20World/file.js'
|
|
42
|
+
*/
|
|
43
|
+
export type EncodedPathString = Brand<string, 'EncodedPathString'>;
|
|
44
|
+
export declare const EmptyEncodedPathString: EncodedPathString;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const enum ArrowKey {
|
|
2
|
+
UP = "ArrowUp",
|
|
3
|
+
DOWN = "ArrowDown",
|
|
4
|
+
LEFT = "ArrowLeft",
|
|
5
|
+
RIGHT = "ArrowRight"
|
|
6
|
+
}
|
|
7
|
+
export declare const enum PageKey {
|
|
8
|
+
UP = "PageUp",
|
|
9
|
+
DOWN = "PageDown"
|
|
10
|
+
}
|
|
11
|
+
export declare const ENTER_KEY = "Enter";
|
|
12
|
+
export declare const ESCAPE_KEY = "Escape";
|
|
13
|
+
export declare const TAB_KEY = "Tab";
|
|
14
|
+
export declare const ARROW_KEYS: Set<ArrowKey>;
|
|
15
|
+
export declare function keyIsArrowKey(key: string): key is ArrowKey;
|
|
16
|
+
export declare function isEscKey(event: {
|
|
17
|
+
readonly key: string;
|
|
18
|
+
}): boolean;
|
|
19
|
+
export declare function isEnterOrSpaceKey(event: {
|
|
20
|
+
readonly key: string;
|
|
21
|
+
}): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const inverse: <K, V>(map: Map<K, V>) => Multimap<V, K>;
|
|
2
|
+
export declare class Multimap<K, V> {
|
|
3
|
+
private map;
|
|
4
|
+
set(key: K, value: V): void;
|
|
5
|
+
get(key: K): Set<V>;
|
|
6
|
+
has(key: K): boolean;
|
|
7
|
+
hasValue(key: K, value: V): boolean;
|
|
8
|
+
get size(): number;
|
|
9
|
+
delete(key: K, value: V): boolean;
|
|
10
|
+
deleteAll(key: K): void;
|
|
11
|
+
keysArray(): K[];
|
|
12
|
+
keys(): IterableIterator<K>;
|
|
13
|
+
valuesArray(): V[];
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets value for key, assigning a default if value is falsy.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getWithDefault<K extends {}, V>(map: WeakMap<K, V> | Map<K, V>, key: K, defaultValueFactory: (key?: K) => V): V;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const enum MimeType {
|
|
2
|
+
HTML = "text/html",
|
|
3
|
+
XML = "text/xml",
|
|
4
|
+
PLAIN = "text/plain",
|
|
5
|
+
XHTML = "application/xhtml+xml",
|
|
6
|
+
SVG = "image/svg+xml",
|
|
7
|
+
CSS = "text/css",
|
|
8
|
+
XSL = "text/xsl",
|
|
9
|
+
VTT = "text/vtt",
|
|
10
|
+
PDF = "application/pdf",
|
|
11
|
+
EVENTSTREAM = "text/event-stream"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @returns true iff `mimeType` has textual content. Concretely we return true if:
|
|
15
|
+
* - `mimeType` starts with "text/" or "multipart/"
|
|
16
|
+
* - `mimeType` ends with "+xml"
|
|
17
|
+
* - `mimeType` contains "json"
|
|
18
|
+
* - if `mimeType` is one of a predefined list textual mime types.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isTextType(mimeType: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Port of net::HttpUtils::ParseContentType to extract mimeType and charset from
|
|
23
|
+
* the 'Content-Type' header.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseContentType(contentType: string): {
|
|
26
|
+
mimeType: string | null;
|
|
27
|
+
charset: string | null;
|
|
28
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const clamp: (num: number, min: number, max: number) => number;
|
|
2
|
+
export declare const mod: (m: number, n: number) => number;
|
|
3
|
+
export declare const toFixedIfFloating: (value: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Rounds a number (including float) down.
|
|
6
|
+
*/
|
|
7
|
+
export declare const floor: (value: number, precision?: number) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Computes the great common divisor for two numbers.
|
|
10
|
+
* If the numbers are floats, they will be rounded to an integer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const greatestCommonDivisor: (a: number, b: number) => number;
|
|
13
|
+
export declare const aspectRatio: (width: number, height: number) => string;
|
|
14
|
+
export declare const withThousandsSeparator: (num: number) => string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Brand } from './Brand.js';
|
|
2
|
+
export declare const escapeCharacters: (inputString: string, charsToEscape: string) => string;
|
|
3
|
+
export declare const formatAsJSLiteral: (content: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* This implements a subset of the sprintf() function described in the Single UNIX
|
|
6
|
+
* Specification. It supports the %s, %f, %d, and %% formatting specifiers, and
|
|
7
|
+
* understands the %m$d notation to select the m-th parameter for this substitution,
|
|
8
|
+
* as well as the optional precision for %s, %f, and %d.
|
|
9
|
+
*
|
|
10
|
+
* @param fmt format string.
|
|
11
|
+
* @param args parameters to the format string.
|
|
12
|
+
* @returns the formatted output string.
|
|
13
|
+
*/
|
|
14
|
+
export declare const sprintf: (fmt: string, ...args: unknown[]) => string;
|
|
15
|
+
export declare const toBase64: (inputString: string) => string;
|
|
16
|
+
export declare const findIndexesOfSubString: (inputString: string, searchString: string) => number[];
|
|
17
|
+
export declare const findLineEndingIndexes: (inputString: string) => number[];
|
|
18
|
+
export declare const isWhitespace: (inputString: string) => boolean;
|
|
19
|
+
export declare const trimURL: (url: string, baseURLDomain?: string) => string;
|
|
20
|
+
export declare const collapseWhitespace: (inputString: string) => string;
|
|
21
|
+
export declare const reverse: (inputString: string) => string;
|
|
22
|
+
export declare const replaceControlCharacters: (inputString: string) => string;
|
|
23
|
+
export declare const countWtf8Bytes: (inputString: string) => number;
|
|
24
|
+
export declare const stripLineBreaks: (inputStr: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Tests if the `inputStr` is following the extended Kebab Case naming convention,
|
|
27
|
+
* where words are separated with either a dash (`-`) or a dot (`.`), and all
|
|
28
|
+
* characters must be lower-case alphanumeric.
|
|
29
|
+
*
|
|
30
|
+
* For example, it will yield `true` for `'my.amazing-string.literal'`, but `false`
|
|
31
|
+
* for `'Another.AmazingLiteral'` or '`another_amazing_literal'`.
|
|
32
|
+
*
|
|
33
|
+
* @param inputStr the input string to test.
|
|
34
|
+
* @returns `true` if the `inputStr` follows the extended Kebab Case convention.
|
|
35
|
+
*/
|
|
36
|
+
export declare const isExtendedKebabCase: (inputStr: string) => boolean;
|
|
37
|
+
export declare const toTitleCase: (inputStr: string) => string;
|
|
38
|
+
export declare const removeURLFragment: (inputStr: string) => string;
|
|
39
|
+
export declare const regexSpecialCharacters: () => string;
|
|
40
|
+
export declare const filterRegex: (query: string) => RegExp;
|
|
41
|
+
export declare const createSearchRegex: (query: string, caseSensitive: boolean, isRegex: boolean, matchWholeWord?: boolean) => RegExp;
|
|
42
|
+
export declare const caseInsensetiveComparator: (a: string, b: string) => number;
|
|
43
|
+
export declare const hashCode: (string?: string) => number;
|
|
44
|
+
export declare const compare: (a: string, b: string) => number;
|
|
45
|
+
/** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
|
|
46
|
+
export declare const trimMiddle: (str: string, maxLength: number) => string;
|
|
47
|
+
/** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
|
|
48
|
+
export declare const trimEndWithMaxLength: (str: string, maxLength: number) => string;
|
|
49
|
+
export declare const escapeForRegExp: (str: string) => string;
|
|
50
|
+
export declare const naturalOrderComparator: (a: string, b: string) => number;
|
|
51
|
+
export declare const base64ToSize: (content: string | null) => number;
|
|
52
|
+
export declare const SINGLE_QUOTE = "'";
|
|
53
|
+
export declare const DOUBLE_QUOTE = "\"";
|
|
54
|
+
export declare const findUnclosedCssQuote: (str: string) => string;
|
|
55
|
+
export declare const countUnmatchedLeftParentheses: (str: string) => number;
|
|
56
|
+
export declare const createPlainTextSearchRegex: (query: string, flags?: string) => RegExp;
|
|
57
|
+
export type LowerCaseString = Brand<string, 'lowerCaseStringTag'>;
|
|
58
|
+
export declare const toLowerCaseString: (input: string) => LowerCaseString;
|
|
59
|
+
export declare const toKebabCase: (input: string) => Lowercase<string>;
|
|
60
|
+
export declare function toKebabCaseKeys<T>(settingValue: Record<string, T>): Record<string, T>;
|
|
61
|
+
/**
|
|
62
|
+
* Converts a given string to snake_case.
|
|
63
|
+
* This function handles camelCase, PascalCase, and acronyms, including transitions between letters and numbers.
|
|
64
|
+
* It uses Unicode-aware regular expressions (`\p{L}`, `\p{N}`, `\p{Lu}`, `\p{Ll}` with the `u` flag)
|
|
65
|
+
* to correctly process letters and numbers from various languages.
|
|
66
|
+
*
|
|
67
|
+
* @param text The input string to convert to snake_case.
|
|
68
|
+
* @returns The snake_case version of the input string.
|
|
69
|
+
*/
|
|
70
|
+
export declare function toSnakeCase(text: string): string;
|
|
71
|
+
/** Replaces the last occurrence of parameter `search` with parameter `replacement` in `input` **/
|
|
72
|
+
export declare const replaceLast: (input: string, search: string, replacement: string) => string;
|
|
73
|
+
export declare const stringifyWithPrecision: (s: number, precision?: number) => string;
|
|
74
|
+
/**
|
|
75
|
+
* Somewhat efficiently concatenates 2 base64 encoded strings.
|
|
76
|
+
*/
|
|
77
|
+
export declare const concatBase64: (lhs: string, rhs: string) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Brand } from './Brand.js';
|
|
2
|
+
export type Seconds = Brand<number, 'Seconds'>;
|
|
3
|
+
export type MilliSeconds = Brand<number, 'MilliSeconds'>;
|
|
4
|
+
export type MicroSeconds = Brand<number, 'MicroSeconds'>;
|
|
5
|
+
export declare function milliSecondsToSeconds(x: MilliSeconds): Seconds;
|
|
6
|
+
export declare function microSecondsToMilliSeconds(x: MicroSeconds): MilliSeconds;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object which provides functionality similar to Uint32Array. It may be
|
|
3
|
+
* implemented as:
|
|
4
|
+
* 1. A Uint32Array,
|
|
5
|
+
* 2. An array of Uint32Arrays, to support more data than Uint32Array, or
|
|
6
|
+
* 3. A plain array, in which case the length may change by setting values.
|
|
7
|
+
*/
|
|
8
|
+
export interface BigUint32Array {
|
|
9
|
+
get length(): number;
|
|
10
|
+
getValue(index: number): number;
|
|
11
|
+
setValue(index: number, value: number): void;
|
|
12
|
+
asUint32ArrayOrFail(): Uint32Array;
|
|
13
|
+
asArrayOrFail(): number[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @returns A BigUint32Array implementation which is based on Array.
|
|
17
|
+
* This means that its length automatically expands to include the highest index
|
|
18
|
+
* used, and asArrayOrFail will succeed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createExpandableBigUint32Array(): BigUint32Array;
|
|
21
|
+
/**
|
|
22
|
+
* @returns A BigUint32Array implementation which is based on Uint32Array.
|
|
23
|
+
* If the length is small enough to fit in a single Uint32Array, then
|
|
24
|
+
* asUint32ArrayOrFail will succeed. Otherwise, it will throw an exception.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createFixedBigUint32Array(length: number, maxLengthForTesting?: number): BigUint32Array;
|
|
27
|
+
export interface BitVector {
|
|
28
|
+
getBit(index: number): boolean;
|
|
29
|
+
setBit(index: number): void;
|
|
30
|
+
clearBit(index: number): void;
|
|
31
|
+
previous(index: number): number;
|
|
32
|
+
get buffer(): ArrayBuffer;
|
|
33
|
+
}
|
|
34
|
+
export declare function createBitVector(lengthOrBuffer: number | ArrayBuffer): BitVector;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is useful to keep TypeScript happy in a test - if you have a value
|
|
3
|
+
* that's potentially `null` you can use this function to assert that it isn't,
|
|
4
|
+
* and satisfy TypeScript that the value is present.
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertNotNullOrUndefined<T>(val: T, message?: string): asserts val is NonNullable<T>;
|
|
7
|
+
export declare function assertNever(_type: never, message: string): never;
|
|
8
|
+
/**
|
|
9
|
+
* This is useful to check on the type-level that the unhandled cases of
|
|
10
|
+
* a switch are exactly `T` (where T is usually a union type of enum values).
|
|
11
|
+
* @param caseVariable
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertUnhandled<T>(_caseVariable: T): T;
|
|
14
|
+
export type FieldsThatExtend<Type, Selector> = {
|
|
15
|
+
[Key in keyof Type]: Type[Key] extends Selector ? Key : never;
|
|
16
|
+
}[keyof Type];
|
|
17
|
+
export type PickFieldsThatExtend<Type, Selector> = Pick<Type, FieldsThatExtend<Type, Selector>>;
|
|
18
|
+
/**
|
|
19
|
+
* Turns a Union type (a | b) into an Intersection type (a & b).
|
|
20
|
+
* This is a helper type to implement the "NoUnion" guard.
|
|
21
|
+
*
|
|
22
|
+
* Adapted from https://stackoverflow.com/a/50375286.
|
|
23
|
+
*
|
|
24
|
+
* The tautological `T extends any` is necessary to trigger distributivity for
|
|
25
|
+
* plain unions, e.g. in IntersectionFromUnion<'a'|'b'> TypeScript expands it
|
|
26
|
+
* to ('a' extends any ? (arg: 'a') => void : never)
|
|
27
|
+
* | ('b' extends any ? (arg: 'b') => void : never)
|
|
28
|
+
*
|
|
29
|
+
* The second extends clause then asks TypeScript to find a type of the form
|
|
30
|
+
* `(arg: infer U) => void` that upper-bounds the union, i.e., intuitively,
|
|
31
|
+
* a type that converts to each of the union members. This forces U to be the
|
|
32
|
+
* intersection of 'a' and 'b' in the example.
|
|
33
|
+
*
|
|
34
|
+
* Please note that some intersection types are simply impossible, e.g.
|
|
35
|
+
* `string & number`. There is no type that fulfills both at the same time. A
|
|
36
|
+
* union of this kind is reduced to `never`.
|
|
37
|
+
*/
|
|
38
|
+
type IntersectionFromUnion<T> = (T extends any ? (arg: T) => void : never) extends ((arg: infer U) => void) ? U : never;
|
|
39
|
+
/**
|
|
40
|
+
* When writing generic code it may be desired to disallow Union types from
|
|
41
|
+
* being passed. This type can be used in those cases.
|
|
42
|
+
*
|
|
43
|
+
* function foo<T>(argument: NoUnion<T>) {...}
|
|
44
|
+
*
|
|
45
|
+
* Would result in a compile error for foo<a|b>(...); invocations as `argument`
|
|
46
|
+
* would be typed as `never`.
|
|
47
|
+
*
|
|
48
|
+
* Adapted from https://stackoverflow.com/a/50641073.
|
|
49
|
+
*
|
|
50
|
+
* Conditional types become distributive when receiving a union type. To
|
|
51
|
+
* prevent this from happening, we use `[T] extends [IntersectionFromUnion<T>]`
|
|
52
|
+
* instead of `T extends IntersectionFromUnion<T>`.
|
|
53
|
+
* See: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html
|
|
54
|
+
*/
|
|
55
|
+
export type NoUnion<T> = [T] extends [IntersectionFromUnion<T>] ? T : never;
|
|
56
|
+
export type RecursivePartial<T> = {
|
|
57
|
+
[P in keyof T]?: RecursivePartial<T[P]>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Note this does not recursively
|
|
61
|
+
* make Array items readonly at the moment
|
|
62
|
+
*/
|
|
63
|
+
export type RecursiveReadonly<T> = {
|
|
64
|
+
[P in keyof T]: Readonly<RecursiveReadonly<T[P]>>;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LocalizedString } from './UIString.js';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error that might become visible to the user. Where errors
|
|
4
|
+
* might be surfaced to the user (such as by displaying the message to the
|
|
5
|
+
* console), this class should be used to enforce that the message is
|
|
6
|
+
* localized on the way in.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UserVisibleError extends Error {
|
|
9
|
+
readonly message: LocalizedString;
|
|
10
|
+
constructor(message: LocalizedString);
|
|
11
|
+
}
|
|
12
|
+
export declare function isUserVisibleError(error: unknown): error is UserVisibleError;
|