lighthouse 9.5.0-dev.20230118 → 9.5.0-dev.20230119
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/cli/bin.d.ts +5 -0
- package/cli/cli-flags.d.ts +258 -0
- package/cli/commands/commands.d.ts +4 -0
- package/cli/commands/list-audits.d.ts +2 -0
- package/cli/commands/list-locales.d.ts +2 -0
- package/cli/commands/list-trace-categories.d.ts +2 -0
- package/cli/index.d.ts +3 -0
- package/cli/printer.d.ts +28 -0
- package/cli/run.d.ts +24 -0
- package/cli/sentry-prompt.d.ts +5 -0
- package/cli/test/smokehouse/config/exclusions.d.ts +12 -0
- package/cli/test/smokehouse/core-tests.d.ts +4 -0
- package/cli/test/smokehouse/frontends/back-compat-util.d.ts +16 -0
- package/cli/test/smokehouse/frontends/lib.d.ts +8 -0
- package/cli/test/smokehouse/frontends/node.d.ts +2 -0
- package/cli/test/smokehouse/frontends/smokehouse-bin.d.ts +3 -0
- package/cli/test/smokehouse/lib/child-process-error.d.ts +21 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.d.ts +78 -0
- package/cli/test/smokehouse/lib/local-console.d.ts +33 -0
- package/cli/test/smokehouse/lighthouse-runners/bundle.d.ts +16 -0
- package/cli/test/smokehouse/lighthouse-runners/cli.d.ts +18 -0
- package/cli/test/smokehouse/lighthouse-runners/devtools.d.ts +23 -0
- package/cli/test/smokehouse/report-assert-test.d.ts +2 -0
- package/cli/test/smokehouse/report-assert.d.ts +50 -0
- package/cli/test/smokehouse/smokehouse.d.ts +35 -0
- package/cli/test/smokehouse/version-check-test.d.ts +2 -0
- package/cli/test/smokehouse/version-check.d.ts +15 -0
- package/core/audits/accessibility/accesskeys.d.ts +10 -0
- package/core/audits/accessibility/aria-allowed-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-command-name.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-body.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-focus.d.ts +10 -0
- package/core/audits/accessibility/aria-input-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-meter-name.d.ts +10 -0
- package/core/audits/accessibility/aria-progressbar-name.d.ts +10 -0
- package/core/audits/accessibility/aria-required-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-required-children.d.ts +10 -0
- package/core/audits/accessibility/aria-required-parent.d.ts +10 -0
- package/core/audits/accessibility/aria-roles.d.ts +10 -0
- package/core/audits/accessibility/aria-toggle-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-tooltip-name.d.ts +10 -0
- package/core/audits/accessibility/aria-treeitem-name.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr-value.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr.d.ts +10 -0
- package/core/audits/accessibility/axe-audit.d.ts +17 -0
- package/core/audits/accessibility/button-name.d.ts +10 -0
- package/core/audits/accessibility/bypass.d.ts +10 -0
- package/core/audits/accessibility/color-contrast.d.ts +10 -0
- package/core/audits/accessibility/definition-list.d.ts +10 -0
- package/core/audits/accessibility/dlitem.d.ts +10 -0
- package/core/audits/accessibility/document-title.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-active.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-aria.d.ts +10 -0
- package/core/audits/accessibility/form-field-multiple-labels.d.ts +10 -0
- package/core/audits/accessibility/frame-title.d.ts +10 -0
- package/core/audits/accessibility/heading-order.d.ts +10 -0
- package/core/audits/accessibility/html-has-lang.d.ts +10 -0
- package/core/audits/accessibility/html-lang-valid.d.ts +10 -0
- package/core/audits/accessibility/image-alt.d.ts +10 -0
- package/core/audits/accessibility/input-image-alt.d.ts +10 -0
- package/core/audits/accessibility/label.d.ts +10 -0
- package/core/audits/accessibility/link-name.d.ts +10 -0
- package/core/audits/accessibility/list.d.ts +10 -0
- package/core/audits/accessibility/listitem.d.ts +10 -0
- package/core/audits/accessibility/manual/custom-controls-labels.d.ts +8 -0
- package/core/audits/accessibility/manual/custom-controls-roles.d.ts +8 -0
- package/core/audits/accessibility/manual/focus-traps.d.ts +8 -0
- package/core/audits/accessibility/manual/focusable-controls.d.ts +8 -0
- package/core/audits/accessibility/manual/interactive-element-affordance.d.ts +8 -0
- package/core/audits/accessibility/manual/logical-tab-order.d.ts +8 -0
- package/core/audits/accessibility/manual/managed-focus.d.ts +8 -0
- package/core/audits/accessibility/manual/offscreen-content-hidden.d.ts +9 -0
- package/core/audits/accessibility/manual/use-landmarks.d.ts +8 -0
- package/core/audits/accessibility/manual/visual-order-follows-dom.d.ts +8 -0
- package/core/audits/accessibility/meta-refresh.d.ts +10 -0
- package/core/audits/accessibility/meta-viewport.d.ts +10 -0
- package/core/audits/accessibility/object-alt.d.ts +10 -0
- package/core/audits/accessibility/tabindex.d.ts +10 -0
- package/core/audits/accessibility/td-headers-attr.d.ts +10 -0
- package/core/audits/accessibility/th-has-data-cells.d.ts +10 -0
- package/core/audits/accessibility/valid-lang.d.ts +10 -0
- package/core/audits/accessibility/video-caption.d.ts +10 -0
- package/core/audits/audit.d.ts +150 -0
- package/core/audits/audit.js +1 -0
- package/core/audits/autocomplete.d.ts +36 -0
- package/core/audits/bf-cache.d.ts +21 -0
- package/core/audits/bootup-time.d.ts +26 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +82 -0
- package/core/audits/byte-efficiency/duplicated-javascript.d.ts +52 -0
- package/core/audits/byte-efficiency/efficient-animated-content.d.ts +23 -0
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +99 -0
- package/core/audits/byte-efficiency/modern-image-formats.d.ts +38 -0
- package/core/audits/byte-efficiency/offscreen-images.d.ts +75 -0
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +55 -0
- package/core/audits/byte-efficiency/total-byte-weight.d.ts +21 -0
- package/core/audits/byte-efficiency/unminified-css.d.ts +36 -0
- package/core/audits/byte-efficiency/unminified-javascript.d.ts +37 -0
- package/core/audits/byte-efficiency/unused-css-rules.d.ts +16 -0
- package/core/audits/byte-efficiency/unused-javascript.d.ts +27 -0
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +61 -0
- package/core/audits/byte-efficiency/uses-optimized-images.d.ts +33 -0
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +16 -0
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +45 -0
- package/core/audits/byte-efficiency/uses-text-compression.d.ts +14 -0
- package/core/audits/content-width.d.ts +17 -0
- package/core/audits/critical-request-chains.d.ts +44 -0
- package/core/audits/csp-xss.d.ts +51 -0
- package/core/audits/deprecations.d.ts +19 -0
- package/core/audits/diagnostics.d.ts +11 -0
- package/core/audits/dobetterweb/charset.d.ts +19 -0
- package/core/audits/dobetterweb/doctype.d.ts +21 -0
- package/core/audits/dobetterweb/dom-size.d.ts +26 -0
- package/core/audits/dobetterweb/geolocation-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/inspector-issues.d.ts +45 -0
- package/core/audits/dobetterweb/js-libraries.d.ts +15 -0
- package/core/audits/dobetterweb/no-document-write.d.ts +16 -0
- package/core/audits/dobetterweb/notification-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.d.ts +15 -0
- package/core/audits/dobetterweb/uses-http2.d.ts +69 -0
- package/core/audits/dobetterweb/uses-passive-event-listeners.d.ts +16 -0
- package/core/audits/errors-in-console.d.ts +31 -0
- package/core/audits/final-screenshot.d.ts +11 -0
- package/core/audits/font-display.d.ts +32 -0
- package/core/audits/image-aspect-ratio.d.ts +30 -0
- package/core/audits/image-size-responsive.d.ts +28 -0
- package/core/audits/installable-manifest.d.ts +118 -0
- package/core/audits/is-on-https.d.ts +23 -0
- package/core/audits/largest-contentful-paint-element.d.ts +14 -0
- package/core/audits/layout-shift-elements.d.ts +15 -0
- package/core/audits/lcp-lazy-loaded.d.ts +21 -0
- package/core/audits/long-tasks.d.ts +16 -0
- package/core/audits/main-thread-tasks.d.ts +11 -0
- package/core/audits/mainthread-work-breakdown.d.ts +28 -0
- package/core/audits/manual/manual-audit.d.ts +13 -0
- package/core/audits/manual/pwa-cross-browser.d.ts +12 -0
- package/core/audits/manual/pwa-each-page-has-url.d.ts +12 -0
- package/core/audits/manual/pwa-page-transitions.d.ts +12 -0
- package/core/audits/maskable-icon.d.ts +25 -0
- package/core/audits/metrics/cumulative-layout-shift.d.ts +21 -0
- package/core/audits/metrics/experimental-interaction-to-next-paint.d.ts +21 -0
- package/core/audits/metrics/first-contentful-paint-3g.d.ts +15 -0
- package/core/audits/metrics/first-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/first-meaningful-paint.d.ts +28 -0
- package/core/audits/metrics/interactive.d.ts +31 -0
- package/core/audits/metrics/largest-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/max-potential-fid.d.ts +23 -0
- package/core/audits/metrics/speed-index.d.ts +27 -0
- package/core/audits/metrics/total-blocking-time.d.ts +32 -0
- package/core/audits/metrics.d.ts +11 -0
- package/core/audits/multi-check-audit.d.ts +28 -0
- package/core/audits/network-requests.d.ts +11 -0
- package/core/audits/network-rtt.d.ts +15 -0
- package/core/audits/network-server-latency.d.ts +15 -0
- package/core/audits/no-unload-listeners.d.ts +16 -0
- package/core/audits/non-composited-animations.d.ts +21 -0
- package/core/audits/oopif-iframe-test-audit.d.ts +14 -0
- package/core/audits/performance-budget.d.ts +39 -0
- package/core/audits/predictive-perf.d.ts +11 -0
- package/core/audits/preload-fonts.d.ts +29 -0
- package/core/audits/preload-lcp-image.d.ts +67 -0
- package/core/audits/redirects.d.ts +33 -0
- package/core/audits/resource-summary.d.ts +16 -0
- package/core/audits/screenshot-thumbnails.d.ts +32 -0
- package/core/audits/script-elements-test-audit.d.ts +14 -0
- package/core/audits/script-treemap-data.d.ts +42 -0
- package/core/audits/seo/canonical.d.ts +51 -0
- package/core/audits/seo/crawlable-anchors.d.ts +16 -0
- package/core/audits/seo/font-size.d.ts +24 -0
- package/core/audits/seo/hreflang.d.ts +28 -0
- package/core/audits/seo/http-status-code.d.ts +16 -0
- package/core/audits/seo/is-crawlable.d.ts +38 -0
- package/core/audits/seo/link-text.d.ts +16 -0
- package/core/audits/seo/manual/structured-data.d.ts +12 -0
- package/core/audits/seo/meta-description.d.ts +16 -0
- package/core/audits/seo/plugins.d.ts +15 -0
- package/core/audits/seo/robots-txt.d.ts +18 -0
- package/core/audits/seo/tap-targets.d.ts +50 -0
- package/core/audits/server-response-time.d.ts +21 -0
- package/core/audits/service-worker.d.ts +46 -0
- package/core/audits/splash-screen.d.ts +37 -0
- package/core/audits/themed-omnibox.d.ts +42 -0
- package/core/audits/third-party-facades.d.ts +41 -0
- package/core/audits/third-party-summary.d.ts +58 -0
- package/core/audits/timing-budget.d.ts +43 -0
- package/core/audits/unsized-images.d.ts +39 -0
- package/core/audits/user-timings.d.ts +43 -0
- package/core/audits/uses-rel-preconnect.d.ts +37 -0
- package/core/audits/uses-rel-preload.d.ts +61 -0
- package/core/audits/valid-source-maps.d.ts +27 -0
- package/core/audits/viewport.d.ts +17 -0
- package/core/audits/violation-audit.d.ts +14 -0
- package/core/audits/work-during-interaction.d.ts +82 -0
- package/core/computed/computed-artifact.d.ts +15 -0
- package/core/computed/critical-request-chains.d.ts +40 -0
- package/core/computed/image-records.d.ts +24 -0
- package/core/computed/js-bundles.d.ts +13 -0
- package/core/computed/load-simulator.d.ts +28 -0
- package/core/computed/main-resource.d.ts +25 -0
- package/core/computed/main-thread-tasks.d.ts +15 -0
- package/core/computed/manifest-values.d.ts +24 -0
- package/core/computed/metrics/cumulative-layout-shift.d.ts +53 -0
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +19 -0
- package/core/computed/metrics/first-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/first-meaningful-paint.d.ts +15 -0
- package/core/computed/metrics/interactive.d.ts +61 -0
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +48 -0
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +12 -0
- package/core/computed/metrics/lantern-interactive.d.ts +31 -0
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +25 -0
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +30 -0
- package/core/computed/metrics/lantern-metric.d.ts +78 -0
- package/core/computed/metrics/lantern-speed-index.d.ts +38 -0
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +31 -0
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +20 -0
- package/core/computed/metrics/largest-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/max-potential-fid.d.ts +15 -0
- package/core/computed/metrics/metric.d.ts +38 -0
- package/core/computed/metrics/navigation-metric.d.ts +16 -0
- package/core/computed/metrics/responsiveness.d.ts +87 -0
- package/core/computed/metrics/speed-index.d.ts +10 -0
- package/core/computed/metrics/tbt-utils.d.ts +18 -0
- package/core/computed/metrics/timing-summary.d.ts +46 -0
- package/core/computed/metrics/total-blocking-time.d.ts +23 -0
- package/core/computed/module-duplication.d.ts +37 -0
- package/core/computed/network-analysis.d.ts +20 -0
- package/core/computed/network-records.d.ts +15 -0
- package/core/computed/network-records.js +1 -0
- package/core/computed/page-dependency-graph.d.ts +88 -0
- package/core/computed/processed-navigation.d.ts +15 -0
- package/core/computed/processed-trace.d.ts +14 -0
- package/core/computed/resource-summary.d.ts +44 -0
- package/core/computed/screenshots.d.ts +20 -0
- package/core/computed/speedline.d.ts +15 -0
- package/core/computed/unused-css.d.ts +62 -0
- package/core/computed/unused-javascript-summary.d.ts +71 -0
- package/core/computed/user-timings.d.ts +31 -0
- package/core/computed/viewport-meta.d.ts +35 -0
- package/core/config/budget.d.ts +74 -0
- package/core/config/config-helpers.d.ts +94 -0
- package/core/config/config-plugin.d.ts +46 -0
- package/core/config/config.d.ts +28 -0
- package/core/config/constants.d.ts +86 -0
- package/core/config/default-config.d.ts +5 -0
- package/core/config/default-config.js +1 -0
- package/core/config/desktop-config.d.ts +5 -0
- package/core/config/desktop-config.js +1 -0
- package/core/config/experimental-config.d.ts +13 -0
- package/core/config/filters.d.ts +83 -0
- package/core/config/full-config.d.ts +9 -0
- package/core/config/lr-desktop-config.d.ts +4 -0
- package/core/config/lr-mobile-config.d.ts +9 -0
- package/core/config/metrics-to-audits.d.ts +19 -0
- package/core/config/perf-config.d.ts +9 -0
- package/core/config/validation.d.ts +77 -0
- package/core/gather/base-artifacts.d.ts +16 -0
- package/core/gather/base-gatherer.d.ts +72 -0
- package/core/gather/base-gatherer.js +2 -0
- package/core/gather/driver/dom.d.ts +20 -0
- package/core/gather/driver/environment.d.ts +35 -0
- package/core/gather/driver/execution-context.d.ts +101 -0
- package/core/gather/driver/execution-context.js +1 -7
- package/core/gather/driver/navigation.d.ts +33 -0
- package/core/gather/driver/network-monitor.d.ts +82 -0
- package/core/gather/driver/network.d.ts +10 -0
- package/core/gather/driver/prepare.d.ts +46 -0
- package/core/gather/driver/service-workers.d.ts +16 -0
- package/core/gather/driver/storage.d.ts +24 -0
- package/core/gather/driver/target-manager.d.ts +61 -0
- package/core/gather/driver/wait-for-condition.d.ts +116 -0
- package/core/gather/driver/wait-for-condition.js +3 -2
- package/core/gather/driver.d.ts +30 -0
- package/core/gather/fetcher.d.ts +63 -0
- package/core/gather/fetcher.js +2 -0
- package/core/gather/gatherers/accessibility.d.ts +23 -0
- package/core/gather/gatherers/anchor-elements.d.ts +10 -0
- package/core/gather/gatherers/bf-cache-failures.d.ts +43 -0
- package/core/gather/gatherers/cache-contents.d.ts +11 -0
- package/core/gather/gatherers/console-messages.d.ts +39 -0
- package/core/gather/gatherers/css-usage.d.ts +39 -0
- package/core/gather/gatherers/devtools-log-compat.d.ts +13 -0
- package/core/gather/gatherers/devtools-log.d.ts +48 -0
- package/core/gather/gatherers/dobetterweb/doctype.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/domstats.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +61 -0
- package/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/response-compression.d.ts +30 -0
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +53 -0
- package/core/gather/gatherers/full-page-screenshot.d.ts +35 -0
- package/core/gather/gatherers/gatherer.d.ts +46 -0
- package/core/gather/gatherers/global-listeners.d.ts +27 -0
- package/core/gather/gatherers/iframe-elements.d.ts +11 -0
- package/core/gather/gatherers/image-elements.d.ts +35 -0
- package/core/gather/gatherers/inputs.d.ts +10 -0
- package/core/gather/gatherers/inspector-issues.d.ts +38 -0
- package/core/gather/gatherers/installability-errors.d.ts +17 -0
- package/core/gather/gatherers/js-usage.d.ts +22 -0
- package/core/gather/gatherers/link-elements.d.ts +39 -0
- package/core/gather/gatherers/main-document-content.d.ts +27 -0
- package/core/gather/gatherers/meta-elements.d.ts +10 -0
- package/core/gather/gatherers/network-user-agent.d.ts +18 -0
- package/core/gather/gatherers/script-elements.d.ts +26 -0
- package/core/gather/gatherers/scripts.d.ts +27 -0
- package/core/gather/gatherers/seo/embedded-content.d.ts +10 -0
- package/core/gather/gatherers/seo/font-size.d.ts +131 -0
- package/core/gather/gatherers/seo/robots-txt.d.ts +10 -0
- package/core/gather/gatherers/seo/tap-targets.d.ts +21 -0
- package/core/gather/gatherers/service-worker.d.ts +16 -0
- package/core/gather/gatherers/source-maps.d.ts +50 -0
- package/core/gather/gatherers/stacks.d.ts +38 -0
- package/core/gather/gatherers/trace-compat.d.ts +13 -0
- package/core/gather/gatherers/trace-elements.d.ts +83 -0
- package/core/gather/gatherers/trace.d.ts +23 -0
- package/core/gather/gatherers/viewport-dimensions.d.ts +10 -0
- package/core/gather/gatherers/web-app-manifest.d.ts +32 -0
- package/core/gather/navigation-runner.d.ts +92 -0
- package/core/gather/runner-helpers.d.ts +39 -0
- package/core/gather/session.d.ts +50 -0
- package/core/gather/snapshot-runner.d.ts +10 -0
- package/core/gather/timespan-runner.d.ts +12 -0
- package/core/index.d.cts +4 -0
- package/core/index.d.ts +88 -0
- package/core/index.js +2 -0
- package/core/legacy/config/config.d.ts +107 -0
- package/core/legacy/config/legacy-default-config.d.ts +4 -0
- package/core/legacy/gather/connections/connection.d.ts +75 -0
- package/core/legacy/gather/connections/connection.js +1 -0
- package/core/legacy/gather/connections/cri.d.ts +27 -0
- package/core/legacy/gather/connections/raw.d.ts +20 -0
- package/core/legacy/gather/driver.d.ts +214 -0
- package/core/legacy/gather/driver.js +1 -0
- package/core/legacy/gather/gather-runner.d.ts +166 -0
- package/core/lib/arbitrary-equality-map.d.ts +47 -0
- package/core/lib/asset-saver.d.ts +101 -0
- package/core/lib/axe.d.ts +2 -0
- package/core/lib/bf-cache-strings.d.ts +121 -0
- package/core/lib/cdt/Common.d.ts +3 -0
- package/core/lib/cdt/Platform.d.ts +26 -0
- package/core/lib/cdt/SDK.d.ts +2 -0
- package/core/lib/cdt/generated/ParsedURL.d.ts +28 -0
- package/core/lib/cdt/generated/SourceMap.d.ts +100 -0
- package/core/lib/csp-evaluator.d.ts +41 -0
- package/core/lib/dependency-graph/base-node.d.ts +161 -0
- package/core/lib/dependency-graph/cpu-node.d.ts +34 -0
- package/core/lib/dependency-graph/cpu-node.js +1 -0
- package/core/lib/dependency-graph/network-node.d.ts +43 -0
- package/core/lib/dependency-graph/network-node.js +1 -0
- package/core/lib/dependency-graph/simulator/connection-pool.d.ts +58 -0
- package/core/lib/dependency-graph/simulator/connection-pool.js +1 -0
- package/core/lib/dependency-graph/simulator/dns-cache.d.ts +42 -0
- package/core/lib/dependency-graph/simulator/dns-cache.js +2 -0
- package/core/lib/dependency-graph/simulator/network-analyzer.d.ts +166 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.d.ts +153 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.js +2 -2
- package/core/lib/dependency-graph/simulator/simulator.d.ts +154 -0
- package/core/lib/dependency-graph/simulator/simulator.js +3 -2
- package/core/lib/dependency-graph/simulator/tcp-connection.d.ts +89 -0
- package/core/lib/deprecations-strings.d.ts +66 -0
- package/core/lib/emulation.d.ts +43 -0
- package/core/lib/i18n/i18n.d.ts +81 -0
- package/core/lib/icons.d.ts +22 -0
- package/core/lib/lantern-trace-saver.d.ts +20 -0
- package/core/lib/lh-env.d.ts +2 -0
- package/core/lib/lh-error.d.ts +328 -0
- package/core/lib/lh-trace-processor.d.ts +5 -0
- package/core/lib/manifest-parser.d.ts +186 -0
- package/core/lib/median-run.d.ts +17 -0
- package/core/lib/minification-estimator.d.ts +9 -0
- package/core/lib/minify-devtoolslog.d.ts +6 -0
- package/core/lib/minify-trace.d.ts +6 -0
- package/core/lib/navigation-error.d.ts +39 -0
- package/core/lib/network-recorder.d.ts +115 -0
- package/core/lib/network-request.d.ts +245 -0
- package/core/lib/network-request.js +1 -0
- package/core/lib/page-functions.d.ts +149 -0
- package/core/lib/proto-preprocessor.d.ts +13 -0
- package/core/lib/rect-helpers.d.ts +100 -0
- package/core/lib/script-helpers.d.ts +17 -0
- package/core/lib/sentry.d.ts +32 -0
- package/core/lib/stack-packs.d.ts +16 -0
- package/core/lib/statistics.d.ts +28 -0
- package/core/lib/tappable-rects.d.ts +8 -0
- package/core/lib/third-party-web.d.ts +32 -0
- package/core/lib/timing-trace-saver.d.ts +21 -0
- package/core/lib/tracehouse/cpu-profile-model.d.ts +228 -0
- package/core/lib/tracehouse/main-thread-tasks.d.ts +162 -0
- package/core/lib/tracehouse/main-thread-tasks.js +1 -0
- package/core/lib/tracehouse/task-groups.d.ts +66 -0
- package/core/lib/tracehouse/task-summary.d.ts +18 -0
- package/core/lib/tracehouse/trace-processor.d.ts +275 -0
- package/core/lib/traces/metric-trace-events.d.ts +65 -0
- package/core/lib/url-utils.d.ts +100 -0
- package/core/runner.d.ts +109 -0
- package/core/scoring.d.ts +26 -0
- package/core/user-flow.d.ts +106 -0
- package/core/user-flow.js +1 -0
- package/core/util.d.cts +230 -0
- package/eslint-local-rules.d.cts +6 -0
- package/esm-utils.d.ts +14 -0
- package/flow-report/api.d.ts +7 -0
- package/flow-report/clients/standalone.d.ts +7 -0
- package/flow-report/src/app.d.ts +11 -0
- package/flow-report/src/common.d.ts +20 -0
- package/flow-report/src/header.d.ts +10 -0
- package/flow-report/src/help-dialog.d.ts +10 -0
- package/flow-report/src/i18n/i18n.d.ts +209 -0
- package/flow-report/src/i18n/localized-strings.d.ts +9 -0
- package/flow-report/src/i18n/ui-strings.d.ts +48 -0
- package/flow-report/src/icons.d.ts +18 -0
- package/flow-report/src/sidebar/flow.d.ts +8 -0
- package/flow-report/src/sidebar/sidebar.d.ts +17 -0
- package/flow-report/src/summary/category.d.ts +19 -0
- package/flow-report/src/summary/summary.d.ts +18 -0
- package/flow-report/src/topbar.d.ts +15 -0
- package/flow-report/src/util.d.ts +30 -0
- package/flow-report/src/wrappers/category-score.d.ts +12 -0
- package/flow-report/src/wrappers/markdown.d.ts +10 -0
- package/flow-report/src/wrappers/report.d.ts +10 -0
- package/flow-report/src/wrappers/styles.d.ts +8 -0
- package/flow-report/test/app-test.d.ts +7 -0
- package/flow-report/test/common-test.d.ts +7 -0
- package/flow-report/test/flow-report-pptr-test.d.ts +7 -0
- package/flow-report/test/header-test.d.ts +7 -0
- package/flow-report/test/sample-flow.d.ts +7 -0
- package/flow-report/test/setup/env-setup.d.ts +11 -0
- package/flow-report/test/sidebar/flow-test.d.ts +7 -0
- package/flow-report/test/sidebar/sidebar-test.d.ts +7 -0
- package/flow-report/test/summary/category-test.d.ts +7 -0
- package/flow-report/test/summary/summary-test.d.ts +7 -0
- package/flow-report/test/topbar-test.d.ts +7 -0
- package/flow-report/test/util-test.d.ts +7 -0
- package/flow-report/test/wrappers/category-score-test.d.ts +7 -0
- package/flow-report/test/wrappers/markdown-test.d.ts +7 -0
- package/flow-report/tsconfig.json +1 -1
- package/package.json +5 -2
- package/report/clients/bundle.d.ts +6 -0
- package/report/clients/standalone.d.ts +2 -0
- package/report/generator/file-namer.d.ts +35 -0
- package/report/generator/flow-report-assets.d.ts +9 -0
- package/report/generator/report-assets.d.ts +8 -0
- package/report/generator/report-generator.d.ts +59 -0
- package/report/renderer/api.d.ts +31 -0
- package/report/renderer/category-renderer.d.ts +176 -0
- package/report/renderer/components.d.ts +10 -0
- package/report/renderer/crc-details-renderer.d.ts +73 -0
- package/report/renderer/details-renderer.d.ts +141 -0
- package/report/renderer/dom.d.ts +125 -0
- package/report/renderer/drop-down-menu.d.ts +70 -0
- package/report/renderer/element-screenshot-renderer.d.ts +79 -0
- package/report/renderer/features-util.d.ts +13 -0
- package/report/renderer/i18n.d.ts +106 -0
- package/report/renderer/logger.d.ts +47 -0
- package/report/renderer/open-tab.d.ts +19 -0
- package/report/renderer/performance-category-renderer.d.ts +56 -0
- package/report/renderer/pwa-category-renderer.d.ts +55 -0
- package/report/renderer/report-renderer.d.ts +57 -0
- package/report/renderer/report-ui-features.d.ts +71 -0
- package/report/renderer/snippet-renderer.d.ts +85 -0
- package/report/renderer/swap-locale-feature.d.ts +31 -0
- package/report/renderer/text-encoding.d.ts +26 -0
- package/report/renderer/topbar-features.d.ts +82 -0
- package/report/renderer/util.d.ts +230 -0
- package/report/test-assets/faux-psi.d.ts +34 -0
- package/report/types/augment-dom.d.ts +1 -1
- package/root.d.ts +3 -0
- package/shared/localization/format.d.ts +106 -0
- package/shared/localization/i18n-module.d.ts +4 -0
- package/shared/localization/locales.d.ts +7 -0
- package/shared/localization/swap-flow-locale.d.ts +6 -0
- package/shared/localization/swap-locale.d.ts +39 -0
- package/shared/type-verifiers.d.ts +23 -0
- package/third-party/axe/valid-langs.d.ts +9 -0
- package/types/artifacts.d.ts +40 -38
- package/types/audit.d.ts +6 -6
- package/types/config.d.ts +3 -3
- package/types/externs.d.ts +7 -3
- package/types/gatherer.d.ts +27 -21
- package/types/{cssstyle/index.d.ts → internal/cssstyle.d.ts} +0 -0
- package/types/{enquirer.d.ts → internal/enquirer.d.ts} +0 -0
- package/types/{es-main.d.ts → internal/es-main.d.ts} +0 -0
- package/types/internal/global.d.ts +15 -0
- package/types/{http-link-header/index.d.ts → internal/http-link-header.d.ts} +0 -0
- package/types/{jsonlint-mod.d.ts → internal/jsonlint-mod.d.ts} +0 -0
- package/types/{lighthouse-logger/index.d.ts → internal/lighthouse-logger.d.ts} +0 -0
- package/types/{lookup-closest-locale/index.d.ts → internal/lookup-closest-locale.d.ts} +3 -1
- package/types/{metaviewport-parser/index.d.ts → internal/metaviewport-parser.d.ts} +0 -0
- package/types/{node-fetch.d.ts → internal/node-fetch.d.ts} +0 -0
- package/types/{node.d.ts → internal/node.d.ts} +0 -0
- package/types/{parse-cache-control/index.d.ts → internal/parse-cache-control.d.ts} +0 -0
- package/types/{pretty-json-stringify/index.d.ts → internal/pretty-json-stringify.d.ts} +0 -0
- package/types/{query-selector.d.ts → internal/query-selector.d.ts} +1 -1
- package/types/{rollup-plugin-postprocess.d.ts → internal/rollup-plugin-postprocess.d.ts} +0 -0
- package/types/{smokehouse.d.ts → internal/smokehouse.d.ts} +3 -3
- package/types/{test.d.ts → internal/test.d.ts} +0 -0
- package/types/lh.d.ts +81 -0
- package/types/lh.js +13 -0
- package/types/lhr/audit-details.d.ts +2 -2
- package/types/lhr/audit-result.d.ts +2 -2
- package/types/lhr/flow-result.d.ts +1 -1
- package/types/lhr/lhr.d.ts +2 -2
- package/types/lhr/settings.d.ts +1 -1
- package/types/lhr/treemap.d.ts +2 -2
- package/types/protocol.d.ts +8 -3
- package/types/puppeteer.d.ts +11 -6
- package/types/user-flow.d.ts +14 -5
- package/types/global-lh.d.ts +0 -85
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2018 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @param {LH.Artifacts.Rect} rect
|
|
8
|
+
* @param {{x:number, y:number}} point
|
|
9
|
+
*/
|
|
10
|
+
export function rectContainsPoint(rect: LH.Artifacts.Rect, { x, y }: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether rect2 is contained entirely within rect1;
|
|
16
|
+
* @param {LH.Artifacts.Rect} rect1
|
|
17
|
+
* @param {LH.Artifacts.Rect} rect2
|
|
18
|
+
* @return {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export function rectContains(rect1: LH.Artifacts.Rect, rect2: LH.Artifacts.Rect): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @param {{left:number, top:number, right:number, bottom: number}} rect
|
|
23
|
+
* @return {LH.Artifacts.Rect}
|
|
24
|
+
*/
|
|
25
|
+
export function addRectWidthAndHeight({ left, top, right, bottom }: {
|
|
26
|
+
left: number;
|
|
27
|
+
top: number;
|
|
28
|
+
right: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
}): LH.Artifacts.Rect;
|
|
31
|
+
/**
|
|
32
|
+
* @param {{x:number, y:number, width:number, height: number}} rect
|
|
33
|
+
* @return {LH.Artifacts.Rect}
|
|
34
|
+
*/
|
|
35
|
+
export function addRectTopAndBottom({ x, y, width, height }: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}): LH.Artifacts.Rect;
|
|
41
|
+
/**
|
|
42
|
+
* @param {LH.Artifacts.Rect} rect1
|
|
43
|
+
* @param {LH.Artifacts.Rect} rect2
|
|
44
|
+
*/
|
|
45
|
+
export function getRectOverlapArea(rect1: LH.Artifacts.Rect, rect2: LH.Artifacts.Rect): number;
|
|
46
|
+
/**
|
|
47
|
+
* @param {LH.Artifacts.Rect} rect
|
|
48
|
+
* @param {number} centerRectSize
|
|
49
|
+
*/
|
|
50
|
+
export function getRectAtCenter(rect: LH.Artifacts.Rect, centerRectSize: number): import("../../types/lhr/audit-details").default.Rect;
|
|
51
|
+
/**
|
|
52
|
+
* @param {LH.Artifacts.Rect[]} rects
|
|
53
|
+
*/
|
|
54
|
+
export function getLargestRect(rects: LH.Artifacts.Rect[]): import("../../types/lhr/audit-details").default.Rect;
|
|
55
|
+
/**
|
|
56
|
+
* @param {LH.Artifacts.Rect} rect
|
|
57
|
+
*/
|
|
58
|
+
export function getRectArea(rect: LH.Artifacts.Rect): number;
|
|
59
|
+
/**
|
|
60
|
+
* @param {LH.Artifacts.Rect} rect
|
|
61
|
+
*/
|
|
62
|
+
export function getRectCenterPoint(rect: LH.Artifacts.Rect): {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @param {LH.Artifacts.Rect[]} rects
|
|
68
|
+
*/
|
|
69
|
+
export function getBoundingRect(rects: LH.Artifacts.Rect[]): import("../../types/lhr/audit-details").default.Rect;
|
|
70
|
+
/**
|
|
71
|
+
* Returns a bounding rect for all the passed in rects, with padded with half of
|
|
72
|
+
* `padding` on all sides.
|
|
73
|
+
* @param {LH.Artifacts.Rect[]} rects
|
|
74
|
+
* @param {number} padding
|
|
75
|
+
* @return {LH.Artifacts.Rect}
|
|
76
|
+
*/
|
|
77
|
+
export function getBoundingRectWithPadding(rects: LH.Artifacts.Rect[], padding: number): LH.Artifacts.Rect;
|
|
78
|
+
/**
|
|
79
|
+
* @param {LH.Artifacts.Rect} rectA
|
|
80
|
+
* @param {LH.Artifacts.Rect} rectB
|
|
81
|
+
* @return {boolean}
|
|
82
|
+
*/
|
|
83
|
+
export function rectsTouchOrOverlap(rectA: LH.Artifacts.Rect, rectB: LH.Artifacts.Rect): boolean;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @param {LH.Artifacts.Rect[]} rectListA
|
|
87
|
+
* @param {LH.Artifacts.Rect[]} rectListB
|
|
88
|
+
*/
|
|
89
|
+
export function allRectsContainedWithinEachOther(rectListA: LH.Artifacts.Rect[], rectListB: LH.Artifacts.Rect[]): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @param {LH.Artifacts.Rect[]} rects
|
|
92
|
+
* @return {LH.Artifacts.Rect[]}
|
|
93
|
+
*/
|
|
94
|
+
export function filterOutRectsContainedByOthers(rects: LH.Artifacts.Rect[]): LH.Artifacts.Rect[];
|
|
95
|
+
/**
|
|
96
|
+
* @param {LH.Artifacts.Rect[]} rects
|
|
97
|
+
* @return {LH.Artifacts.Rect[]}
|
|
98
|
+
*/
|
|
99
|
+
export function filterOutTinyRects(rects: LH.Artifacts.Rect[]): LH.Artifacts.Rect[];
|
|
100
|
+
//# sourceMappingURL=rect-helpers.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {LH.Artifacts.NetworkRequest[]} networkRecords
|
|
3
|
+
* @param {LH.Artifacts.Script} script
|
|
4
|
+
* @return {LH.Artifacts.NetworkRequest|undefined}
|
|
5
|
+
*/
|
|
6
|
+
export function getRequestForScript(networkRecords: LH.Artifacts.NetworkRequest[], script: LH.Artifacts.Script): LH.Artifacts.NetworkRequest | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @param {LH.Artifacts.Script} script
|
|
14
|
+
* @return {boolean}
|
|
15
|
+
*/
|
|
16
|
+
export function isInline(script: LH.Artifacts.Script): boolean;
|
|
17
|
+
//# sourceMappingURL=script-helpers.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export namespace Sentry {
|
|
2
|
+
export { init };
|
|
3
|
+
export { noop as captureMessage };
|
|
4
|
+
export { noop as captureBreadcrumb };
|
|
5
|
+
export { noop as getContext };
|
|
6
|
+
export const captureException: (error: Error, options: {
|
|
7
|
+
level?: string | undefined;
|
|
8
|
+
tags?: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
} | undefined;
|
|
11
|
+
extra?: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
export function _shouldSample(): boolean;
|
|
16
|
+
}
|
|
17
|
+
export type Breadcrumb = import('@sentry/node').Breadcrumb;
|
|
18
|
+
export type NodeClient = import('@sentry/node').NodeClient;
|
|
19
|
+
export type NodeOptions = import('@sentry/node').NodeOptions;
|
|
20
|
+
export type Severity = import('@sentry/node').Severity;
|
|
21
|
+
/**
|
|
22
|
+
* When called, replaces noops with actual Sentry implementation.
|
|
23
|
+
* @param {{url: string, flags: LH.CliFlags, environmentData: NodeOptions}} opts
|
|
24
|
+
*/
|
|
25
|
+
declare function init(opts: {
|
|
26
|
+
url: string;
|
|
27
|
+
flags: LH.CliFlags;
|
|
28
|
+
environmentData: NodeOptions;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
declare function noop(): void;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=sentry.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns all packs that match the stacks found in the page.
|
|
3
|
+
* @param {LH.Artifacts['Stacks']|undefined} pageStacks
|
|
4
|
+
* @return {LH.RawIcu<Array<LH.Result.StackPack>>}
|
|
5
|
+
*/
|
|
6
|
+
export function getStackPacks(pageStacks: LH.Artifacts['Stacks'] | undefined): LH.RawIcu<Array<LH.Result.StackPack>>;
|
|
7
|
+
/**
|
|
8
|
+
* Pairs consisting of a stack pack's ID and the set of stacks needed to be
|
|
9
|
+
* detected in a page to display that pack's advice.
|
|
10
|
+
* @type {Array<{packId: string, requiredStacks: Array<string>}>}
|
|
11
|
+
*/
|
|
12
|
+
export const stackPacksToInclude: Array<{
|
|
13
|
+
packId: string;
|
|
14
|
+
requiredStacks: Array<string>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=stack-packs.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpolates the y value at a point x on the line defined by (x0, y0) and (x1, y1)
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} x1
|
|
6
|
+
* @param {number} y1
|
|
7
|
+
* @param {number} x
|
|
8
|
+
* @return {number}
|
|
9
|
+
*/
|
|
10
|
+
export function linearInterpolation(x0: number, y0: number, x1: number, y1: number, x: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the score (1 - percentile) of `value` in a log-normal distribution
|
|
13
|
+
* specified by the `median` value, at which the score will be 0.5, and a 10th
|
|
14
|
+
* percentile value, at which the score will be 0.9. The score represents the
|
|
15
|
+
* amount of the distribution greater than `value`. All values should be in the
|
|
16
|
+
* same units (e.g. milliseconds). See
|
|
17
|
+
* https://www.desmos.com/calculator/o98tbeyt1t
|
|
18
|
+
* for an interactive view of the relationship between these parameters and the
|
|
19
|
+
* typical parameterization (location and shape) of the log-normal distribution.
|
|
20
|
+
* @param {{median: number, p10: number}} parameters
|
|
21
|
+
* @param {number} value
|
|
22
|
+
* @return {number}
|
|
23
|
+
*/
|
|
24
|
+
export function getLogNormalScore({ median, p10 }: {
|
|
25
|
+
median: number;
|
|
26
|
+
p10: number;
|
|
27
|
+
}, value: number): number;
|
|
28
|
+
//# sourceMappingURL=statistics.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge client rects together and remove small ones. This may result in a larger overall
|
|
3
|
+
* size than that of the individual client rects.
|
|
4
|
+
* We use this to simulate a finger tap on those targets later on.
|
|
5
|
+
* @param {LH.Artifacts.Rect[]} clientRects
|
|
6
|
+
*/
|
|
7
|
+
export function getTappableRectsFromClientRects(clientRects: LH.Artifacts.Rect[]): import("../../types/lhr/audit-details.js").default.Rect[];
|
|
8
|
+
//# sourceMappingURL=tappable-rects.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { getEntity };
|
|
3
|
+
export { getProduct };
|
|
4
|
+
export { isThirdParty };
|
|
5
|
+
export { isFirstParty };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export type ThirdPartyEntity = import("third-party-web").IEntity;
|
|
9
|
+
export type ThirdPartyProduct = import("third-party-web").IProduct;
|
|
10
|
+
/** @typedef {import("third-party-web").IEntity} ThirdPartyEntity */
|
|
11
|
+
/** @typedef {import("third-party-web").IProduct} ThirdPartyProduct */
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} url
|
|
14
|
+
* @return {ThirdPartyEntity|undefined}
|
|
15
|
+
*/
|
|
16
|
+
declare function getEntity(url: string): ThirdPartyEntity | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} url
|
|
19
|
+
* @return {ThirdPartyProduct|undefined}
|
|
20
|
+
*/
|
|
21
|
+
declare function getProduct(url: string): ThirdPartyProduct | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @param {string} url
|
|
24
|
+
* @param {ThirdPartyEntity | undefined} mainDocumentEntity
|
|
25
|
+
*/
|
|
26
|
+
declare function isThirdParty(url: string, mainDocumentEntity: ThirdPartyEntity | undefined): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @param {string} url
|
|
29
|
+
* @param {ThirdPartyEntity | undefined} mainDocumentEntity
|
|
30
|
+
*/
|
|
31
|
+
declare function isFirstParty(url: string, mainDocumentEntity: ThirdPartyEntity | undefined): boolean;
|
|
32
|
+
//# sourceMappingURL=third-party-web.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2018 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generates a chromium trace file from user timing measures
|
|
8
|
+
* `threadId` can be provided to separate a series of trace events into another thread, useful
|
|
9
|
+
* if timings do not share the same timeOrigin, but should both be "left-aligned".
|
|
10
|
+
* Adapted from https://github.com/tdresser/performance-observer-tracing
|
|
11
|
+
* @param {LH.Artifacts.MeasureEntry[]} entries user timing entries
|
|
12
|
+
* @param {number=} threadId
|
|
13
|
+
*/
|
|
14
|
+
export function generateTraceEvents(entries: LH.Artifacts.MeasureEntry[], threadId?: number | undefined): import("..").TraceEvent[];
|
|
15
|
+
/**
|
|
16
|
+
* Writes a trace file to disk
|
|
17
|
+
* @param {LH.Result} lhr
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
export function createTraceString(lhr: LH.Result): string;
|
|
21
|
+
//# sourceMappingURL=timing-trace-saver.d.ts.map
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
export type CpuProfile = {
|
|
2
|
+
id: string;
|
|
3
|
+
pid: number;
|
|
4
|
+
tid: number;
|
|
5
|
+
startTime: number;
|
|
6
|
+
nodes: Required<LH.TraceCpuProfile>['nodes'];
|
|
7
|
+
samples: Array<number>;
|
|
8
|
+
timeDeltas: Array<number>;
|
|
9
|
+
};
|
|
10
|
+
export type ProfilerRange = Required<Required<LH.TraceEvent['args']>['data']>['_syntheticProfilerRange'];
|
|
11
|
+
export type SynthethicEvent = LH.TraceEvent & {
|
|
12
|
+
args: {
|
|
13
|
+
data: {
|
|
14
|
+
_syntheticProfilerRange: ProfilerRange;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type SynthethicTaskNode = Omit<LH.Artifacts.TaskNode, 'event'> & {
|
|
19
|
+
event: SynthethicEvent;
|
|
20
|
+
endEvent: SynthethicEvent;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @fileoverview
|
|
24
|
+
*
|
|
25
|
+
* This model converts the `Profile` and `ProfileChunk` mega trace events from the `disabled-by-default-v8.cpu_profiler`
|
|
26
|
+
* category into B/E-style trace events that main-thread-tasks.js already knows how to parse into a task tree.
|
|
27
|
+
*
|
|
28
|
+
* The V8 CPU profiler measures where time is being spent by sampling the stack (See https://www.jetbrains.com/help/profiler/Profiling_Guidelines__Choosing_the_Right_Profiling_Mode.html
|
|
29
|
+
* for a generic description of the differences between tracing and sampling).
|
|
30
|
+
*
|
|
31
|
+
* A `Profile` event is a record of the stack that was being executed at different sample points in time.
|
|
32
|
+
* It has a structure like this:
|
|
33
|
+
*
|
|
34
|
+
* nodes: [function A, function B, function C]
|
|
35
|
+
* samples: [node with id 2, node with id 1, ...]
|
|
36
|
+
* timeDeltas: [4125μs since last sample, 121μs since last sample, ...]
|
|
37
|
+
*
|
|
38
|
+
* Note that this is subtly different from the protocol-based Crdp.Profiler.Profile type.
|
|
39
|
+
*
|
|
40
|
+
* Helpful prior art:
|
|
41
|
+
* @see https://cs.chromium.org/chromium/src/third_party/devtools-frontend/src/front_end/sdk/CPUProfileDataModel.js?sq=package:chromium&g=0&l=42
|
|
42
|
+
* @see https://github.com/v8/v8/blob/99ca333b0efba3236954b823101315aefeac51ab/tools/profile.js
|
|
43
|
+
* @see https://github.com/jlfwong/speedscope/blob/9ed1eb192cb7e9dac43a5f25bd101af169dc654a/src/import/chrome.ts#L200
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @typedef CpuProfile
|
|
47
|
+
* @property {string} id
|
|
48
|
+
* @property {number} pid
|
|
49
|
+
* @property {number} tid
|
|
50
|
+
* @property {number} startTime
|
|
51
|
+
* @property {Required<LH.TraceCpuProfile>['nodes']} nodes
|
|
52
|
+
* @property {Array<number>} samples
|
|
53
|
+
* @property {Array<number>} timeDeltas
|
|
54
|
+
*/
|
|
55
|
+
/** @typedef {Required<Required<LH.TraceEvent['args']>['data']>['_syntheticProfilerRange']} ProfilerRange */
|
|
56
|
+
/** @typedef {LH.TraceEvent & {args: {data: {_syntheticProfilerRange: ProfilerRange}}}} SynthethicEvent */
|
|
57
|
+
/** @typedef {Omit<LH.Artifacts.TaskNode, 'event'> & {event: SynthethicEvent, endEvent: SynthethicEvent}} SynthethicTaskNode */
|
|
58
|
+
export class CpuProfileModel {
|
|
59
|
+
/**
|
|
60
|
+
* @param {LH.TraceEvent | undefined} event
|
|
61
|
+
* @return {event is SynthethicEvent}
|
|
62
|
+
*/
|
|
63
|
+
static isSyntheticEvent(event: LH.TraceEvent | undefined): event is SynthethicEvent;
|
|
64
|
+
/**
|
|
65
|
+
* @param {LH.Artifacts.TaskNode} task
|
|
66
|
+
* @return {task is SynthethicTaskNode}
|
|
67
|
+
*/
|
|
68
|
+
static isSyntheticTask(task: LH.Artifacts.TaskNode): task is SynthethicTaskNode;
|
|
69
|
+
/**
|
|
70
|
+
* Finds all the tasks that started or ended (depending on `type`) within the provided time range.
|
|
71
|
+
* Uses a memory index to remember the place in the array the last invocation left off to avoid
|
|
72
|
+
* re-traversing the entire array, but note that this index might still be slightly off from the
|
|
73
|
+
* true start position.
|
|
74
|
+
*
|
|
75
|
+
* @param {Array<{startTime: number, endTime: number}>} knownTasks
|
|
76
|
+
* @param {{type: 'startTime'|'endTime', initialIndex: number, earliestPossibleTimestamp: number, latestPossibleTimestamp: number}} options
|
|
77
|
+
*/
|
|
78
|
+
static _getTasksInRange(knownTasks: Array<{
|
|
79
|
+
startTime: number;
|
|
80
|
+
endTime: number;
|
|
81
|
+
}>, options: {
|
|
82
|
+
type: 'startTime' | 'endTime';
|
|
83
|
+
initialIndex: number;
|
|
84
|
+
earliestPossibleTimestamp: number;
|
|
85
|
+
latestPossibleTimestamp: number;
|
|
86
|
+
}): {
|
|
87
|
+
tasks: {
|
|
88
|
+
startTime: number;
|
|
89
|
+
endTime: number;
|
|
90
|
+
}[];
|
|
91
|
+
lastIndex: number;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Given a particular time range and a set of known true tasks, find the correct timestamp to use
|
|
95
|
+
* for a transition between tasks.
|
|
96
|
+
*
|
|
97
|
+
* Because the sampling profiler only provides a *range* of start/stop function boundaries, this
|
|
98
|
+
* method uses knowledge of a known set of tasks to find the most accurate timestamp for a particular
|
|
99
|
+
* range. For example, if we know that a function ended between 800ms and 810ms, we can use the
|
|
100
|
+
* knowledge that a toplevel task ended at 807ms to use 807ms as the correct endtime for this function.
|
|
101
|
+
*
|
|
102
|
+
* @param {{syntheticTask: SynthethicTaskNode, eventType: 'start'|'end', allEventsAtTs: {naive: Array<SynthethicEvent>, refined: Array<SynthethicEvent>}, knownTaskStartTimeIndex: number, knownTaskEndTimeIndex: number, knownTasksByStartTime: Array<{startTime: number, endTime: number}>, knownTasksByEndTime: Array<{startTime: number, endTime: number}>}} data
|
|
103
|
+
* @return {{timestamp: number, lastStartTimeIndex: number, lastEndTimeIndex: number}}
|
|
104
|
+
*/
|
|
105
|
+
static _findEffectiveTimestamp(data: {
|
|
106
|
+
syntheticTask: SynthethicTaskNode;
|
|
107
|
+
eventType: 'start' | 'end';
|
|
108
|
+
allEventsAtTs: {
|
|
109
|
+
naive: Array<SynthethicEvent>;
|
|
110
|
+
refined: Array<SynthethicEvent>;
|
|
111
|
+
};
|
|
112
|
+
knownTaskStartTimeIndex: number;
|
|
113
|
+
knownTaskEndTimeIndex: number;
|
|
114
|
+
knownTasksByStartTime: Array<{
|
|
115
|
+
startTime: number;
|
|
116
|
+
endTime: number;
|
|
117
|
+
}>;
|
|
118
|
+
knownTasksByEndTime: Array<{
|
|
119
|
+
startTime: number;
|
|
120
|
+
endTime: number;
|
|
121
|
+
}>;
|
|
122
|
+
}): {
|
|
123
|
+
timestamp: number;
|
|
124
|
+
lastStartTimeIndex: number;
|
|
125
|
+
lastEndTimeIndex: number;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Creates B/E-style trace events from a CpuProfile object created by `collectProfileEvents()`
|
|
129
|
+
*
|
|
130
|
+
* @param {CpuProfile} profile
|
|
131
|
+
* @param {Array<LH.Artifacts.TaskNode>} tasks
|
|
132
|
+
* @return {Array<LH.TraceEvent>}
|
|
133
|
+
*/
|
|
134
|
+
static synthesizeTraceEvents(profile: CpuProfile, tasks: Array<LH.Artifacts.TaskNode>): Array<LH.TraceEvent>;
|
|
135
|
+
/**
|
|
136
|
+
* Merges the data of all the `ProfileChunk` trace events into a single CpuProfile object for consumption
|
|
137
|
+
* by `synthesizeTraceEvents()`.
|
|
138
|
+
*
|
|
139
|
+
* @param {Array<LH.TraceEvent>} traceEvents
|
|
140
|
+
* @return {Array<CpuProfile>}
|
|
141
|
+
*/
|
|
142
|
+
static collectProfileEvents(traceEvents: Array<LH.TraceEvent>): Array<CpuProfile>;
|
|
143
|
+
/**
|
|
144
|
+
* @param {CpuProfile} profile
|
|
145
|
+
*/
|
|
146
|
+
constructor(profile: CpuProfile);
|
|
147
|
+
_profile: CpuProfile;
|
|
148
|
+
_nodesById: Map<number, {
|
|
149
|
+
id: number;
|
|
150
|
+
callFrame: {
|
|
151
|
+
functionName: string;
|
|
152
|
+
url?: string | undefined;
|
|
153
|
+
};
|
|
154
|
+
parent?: number | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
_activeNodeArraysById: Map<number, number[]>;
|
|
157
|
+
/**
|
|
158
|
+
* Initialization function to enable O(1) access to nodes by node ID.
|
|
159
|
+
* @return {Map<number, CpuProfile['nodes'][0]>}
|
|
160
|
+
*/
|
|
161
|
+
_createNodeMap(): Map<number, CpuProfile['nodes'][0]>;
|
|
162
|
+
/**
|
|
163
|
+
* Initialization function to enable O(1) access to the set of active nodes in the stack by node ID.
|
|
164
|
+
* @return {Map<number, Array<number>>}
|
|
165
|
+
*/
|
|
166
|
+
_createActiveNodeArrays(): Map<number, Array<number>>;
|
|
167
|
+
/**
|
|
168
|
+
* Returns all the node IDs in a stack when a specific nodeId is at the top of the stack
|
|
169
|
+
* (i.e. a stack's node ID and the node ID of all of its parents).
|
|
170
|
+
*
|
|
171
|
+
* @param {number} nodeId
|
|
172
|
+
* @return {Array<number>}
|
|
173
|
+
*/
|
|
174
|
+
_getActiveNodeIds(nodeId: number): Array<number>;
|
|
175
|
+
/**
|
|
176
|
+
* Generates the necessary B/E-style trace events for a single transition from stack A to stack B
|
|
177
|
+
* at the given latest timestamp (includes possible range in event.args.data).
|
|
178
|
+
*
|
|
179
|
+
* Example:
|
|
180
|
+
*
|
|
181
|
+
* latestPossibleTimestamp 1234
|
|
182
|
+
* previousNodeIds 1,2,3
|
|
183
|
+
* currentNodeIds 1,2,4
|
|
184
|
+
*
|
|
185
|
+
* yields [end 3 at ts 1234, begin 4 at ts 1234]
|
|
186
|
+
*
|
|
187
|
+
* @param {number} earliestPossibleTimestamp
|
|
188
|
+
* @param {number} latestPossibleTimestamp
|
|
189
|
+
* @param {Array<number>} previousNodeIds
|
|
190
|
+
* @param {Array<number>} currentNodeIds
|
|
191
|
+
* @return {Array<SynthethicEvent>}
|
|
192
|
+
*/
|
|
193
|
+
_synthesizeTraceEventsForTransition(earliestPossibleTimestamp: number, latestPossibleTimestamp: number, previousNodeIds: Array<number>, currentNodeIds: Array<number>): Array<SynthethicEvent>;
|
|
194
|
+
/**
|
|
195
|
+
* Creates the B/E-style trace events using only data from the profile itself. Each B/E event will
|
|
196
|
+
* include the actual _range_ the timestamp could have been in its metadata that is used for
|
|
197
|
+
* refinement later.
|
|
198
|
+
*
|
|
199
|
+
* @return {Array<SynthethicEvent>}
|
|
200
|
+
*/
|
|
201
|
+
_synthesizeNaiveTraceEvents(): Array<SynthethicEvent>;
|
|
202
|
+
/**
|
|
203
|
+
* Creates a copy of B/E-style trace events with refined timestamps using knowledge from the
|
|
204
|
+
* tasks that have definitive timestamps.
|
|
205
|
+
*
|
|
206
|
+
* With the sampling profiler we know that a function started/ended _sometime between_ two points,
|
|
207
|
+
* but not exactly when. Using the information from other tasks gives us more information to be
|
|
208
|
+
* more precise with timings and allows us to create a valid task tree later on.
|
|
209
|
+
*
|
|
210
|
+
* @param {Array<{startTime: number, endTime: number}>} knownTasks
|
|
211
|
+
* @param {Array<SynthethicTaskNode>} syntheticTasks
|
|
212
|
+
* @param {Array<SynthethicEvent>} syntheticEvents
|
|
213
|
+
* @return {Array<SynthethicEvent>}
|
|
214
|
+
*/
|
|
215
|
+
_refineTraceEventsWithTasks(knownTasks: Array<{
|
|
216
|
+
startTime: number;
|
|
217
|
+
endTime: number;
|
|
218
|
+
}>, syntheticTasks: Array<SynthethicTaskNode>, syntheticEvents: Array<SynthethicEvent>): Array<SynthethicEvent>;
|
|
219
|
+
/**
|
|
220
|
+
* Creates B/E-style trace events from a CpuProfile object created by `collectProfileEvents()`.
|
|
221
|
+
* An optional set of tasks can be passed in to refine the start/end times.
|
|
222
|
+
*
|
|
223
|
+
* @param {Array<LH.Artifacts.TaskNode>} [knownTaskNodes]
|
|
224
|
+
* @return {Array<LH.TraceEvent>}
|
|
225
|
+
*/
|
|
226
|
+
synthesizeTraceEvents(knownTaskNodes?: import("./main-thread-tasks.js").TaskNode[] | undefined): Array<LH.TraceEvent>;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=cpu-profile-model.d.ts.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export type TaskGroup = import('./task-groups.js').TaskGroup;
|
|
2
|
+
export type TaskNode = {
|
|
3
|
+
event: LH.TraceEvent;
|
|
4
|
+
endEvent: LH.TraceEvent | undefined;
|
|
5
|
+
children: TaskNode[];
|
|
6
|
+
parent: TaskNode | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Indicates that the task had an endTime that was inferred rather than specified in the trace. i.e. in the source trace this task was unbounded.
|
|
9
|
+
*/
|
|
10
|
+
unbounded: boolean;
|
|
11
|
+
startTime: number;
|
|
12
|
+
endTime: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
selfTime: number;
|
|
15
|
+
attributableURLs: string[];
|
|
16
|
+
group: TaskGroup;
|
|
17
|
+
};
|
|
18
|
+
export type PriorTaskData = {
|
|
19
|
+
timers: Map<string, TaskNode>;
|
|
20
|
+
xhrs: Map<string, TaskNode>;
|
|
21
|
+
frameURLsById: Map<string, string>;
|
|
22
|
+
lastTaskURLs: string[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @fileoverview
|
|
26
|
+
*
|
|
27
|
+
* This artifact converts the array of raw trace events into an array of hierarchical
|
|
28
|
+
* tasks for easier consumption and bottom-up analysis.
|
|
29
|
+
*
|
|
30
|
+
* Events are easily produced but difficult to consume. They're a mixture of start/end markers, "complete" events, etc.
|
|
31
|
+
* @see https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview
|
|
32
|
+
*
|
|
33
|
+
* LH's TaskNode is an artifact that fills in the gaps a trace event leaves behind.
|
|
34
|
+
* i.e. when did it end? which events are children/parents of this one?
|
|
35
|
+
*
|
|
36
|
+
* Each task will have its group/classification, start time, end time,
|
|
37
|
+
* duration, and self time computed. Each task will potentially have a parent, children, and an
|
|
38
|
+
* attributableURL for the script that was executing/forced this execution.
|
|
39
|
+
*/
|
|
40
|
+
/** @typedef {import('./task-groups.js').TaskGroup} TaskGroup */
|
|
41
|
+
/**
|
|
42
|
+
* @typedef TaskNode
|
|
43
|
+
* @prop {LH.TraceEvent} event
|
|
44
|
+
* @prop {LH.TraceEvent|undefined} endEvent
|
|
45
|
+
* @prop {TaskNode[]} children
|
|
46
|
+
* @prop {TaskNode|undefined} parent
|
|
47
|
+
* @prop {boolean} unbounded Indicates that the task had an endTime that was inferred rather than specified in the trace. i.e. in the source trace this task was unbounded.
|
|
48
|
+
* @prop {number} startTime
|
|
49
|
+
* @prop {number} endTime
|
|
50
|
+
* @prop {number} duration
|
|
51
|
+
* @prop {number} selfTime
|
|
52
|
+
* @prop {string[]} attributableURLs
|
|
53
|
+
* @prop {TaskGroup} group
|
|
54
|
+
*/
|
|
55
|
+
/** @typedef {{timers: Map<string, TaskNode>, xhrs: Map<string, TaskNode>, frameURLsById: Map<string, string>, lastTaskURLs: string[]}} PriorTaskData */
|
|
56
|
+
export class MainThreadTasks {
|
|
57
|
+
/**
|
|
58
|
+
* @param {LH.TraceEvent} event
|
|
59
|
+
* @param {LH.TraceEvent} [endEvent]
|
|
60
|
+
* @return {TaskNode}
|
|
61
|
+
*/
|
|
62
|
+
static _createNewTaskNode(event: LH.TraceEvent, endEvent?: LH.TraceEvent | undefined): TaskNode;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {TaskNode} currentTask
|
|
66
|
+
* @param {number} stopTs
|
|
67
|
+
* @param {PriorTaskData} priorTaskData
|
|
68
|
+
* @param {Array<LH.TraceEvent>} reverseEventsQueue
|
|
69
|
+
*/
|
|
70
|
+
static _assignAllTimersUntilTs(currentTask: TaskNode, stopTs: number, priorTaskData: PriorTaskData, reverseEventsQueue: Array<LH.TraceEvent>): void;
|
|
71
|
+
/**
|
|
72
|
+
* This function takes the start and end events from a thread and creates tasks from them.
|
|
73
|
+
* We do this by iterating through the start and end event arrays simultaneously. For each start
|
|
74
|
+
* event we attempt to find its end event.
|
|
75
|
+
*
|
|
76
|
+
* Because of this matching of start/end events and the need to be mutating our end events queue,
|
|
77
|
+
* we reverse the array to more efficiently `.pop()` them off rather than `.shift()` them off.
|
|
78
|
+
* While it's true the worst case runtime here is O(n^2), ~99.999% of the time the reverse loop is O(1)
|
|
79
|
+
* because the overwhelmingly common case is that end event for a given start event is simply the very next event in our queue.
|
|
80
|
+
*
|
|
81
|
+
* @param {LH.TraceEvent[]} taskStartEvents
|
|
82
|
+
* @param {LH.TraceEvent[]} taskEndEvents
|
|
83
|
+
* @param {number} traceEndTs
|
|
84
|
+
* @return {TaskNode[]}
|
|
85
|
+
*/
|
|
86
|
+
static _createTasksFromStartAndEndEvents(taskStartEvents: LH.TraceEvent[], taskEndEvents: LH.TraceEvent[], traceEndTs: number): TaskNode[];
|
|
87
|
+
/**
|
|
88
|
+
* This function iterates through the tasks to set the `.parent`/`.children` properties of tasks
|
|
89
|
+
* according to their implied nesting structure. If any of these relationships seem impossible based on
|
|
90
|
+
* the timestamps, this method will throw.
|
|
91
|
+
*
|
|
92
|
+
* @param {TaskNode[]} sortedTasks
|
|
93
|
+
* @param {LH.TraceEvent[]} timerInstallEvents
|
|
94
|
+
* @param {PriorTaskData} priorTaskData
|
|
95
|
+
*/
|
|
96
|
+
static _createTaskRelationships(sortedTasks: TaskNode[], timerInstallEvents: LH.TraceEvent[], priorTaskData: PriorTaskData): void;
|
|
97
|
+
/**
|
|
98
|
+
* This function takes the raw trace events sorted in increasing timestamp order and outputs connected task nodes.
|
|
99
|
+
* To create the task heirarchy we make several passes over the events.
|
|
100
|
+
*
|
|
101
|
+
* 1. Create three arrays of X/B events, E events, and TimerInstall events.
|
|
102
|
+
* 2. Create tasks for each X/B event, throwing if a matching E event cannot be found for a given B.
|
|
103
|
+
* 3. Sort the tasks by ↑ startTime, ↓ duration.
|
|
104
|
+
* 4. Match each task to its parent, throwing if there is any invalid overlap between tasks.
|
|
105
|
+
* 5. Sort the tasks once more by ↑ startTime, ↓ duration in case they changed during relationship creation.
|
|
106
|
+
*
|
|
107
|
+
* @param {LH.TraceEvent[]} mainThreadEvents
|
|
108
|
+
* @param {PriorTaskData} priorTaskData
|
|
109
|
+
* @param {number} traceEndTs
|
|
110
|
+
* @return {TaskNode[]}
|
|
111
|
+
*/
|
|
112
|
+
static _createTasksFromEvents(mainThreadEvents: LH.TraceEvent[], priorTaskData: PriorTaskData, traceEndTs: number): TaskNode[];
|
|
113
|
+
/**
|
|
114
|
+
* @param {TaskNode} task
|
|
115
|
+
* @param {TaskNode|undefined} parent
|
|
116
|
+
* @return {number}
|
|
117
|
+
*/
|
|
118
|
+
static _computeRecursiveSelfTime(task: TaskNode, parent: TaskNode | undefined): number;
|
|
119
|
+
/**
|
|
120
|
+
* @param {TaskNode} task
|
|
121
|
+
* @param {string[]} parentURLs
|
|
122
|
+
* @param {string[]} allURLsInTree
|
|
123
|
+
* @param {PriorTaskData} priorTaskData
|
|
124
|
+
*/
|
|
125
|
+
static _computeRecursiveAttributableURLs(task: TaskNode, parentURLs: string[], allURLsInTree: string[], priorTaskData: PriorTaskData): void;
|
|
126
|
+
/**
|
|
127
|
+
* @param {TaskNode} task
|
|
128
|
+
* @param {Array<string>} urls
|
|
129
|
+
*/
|
|
130
|
+
static _setRecursiveEmptyAttributableURLs(task: TaskNode, urls: Array<string>): void;
|
|
131
|
+
/**
|
|
132
|
+
* @param {TaskNode} task
|
|
133
|
+
* @param {TaskGroup} [parentGroup]
|
|
134
|
+
*/
|
|
135
|
+
static _computeRecursiveTaskGroup(task: TaskNode, parentGroup?: import("./task-groups.js").TaskGroup | undefined): void;
|
|
136
|
+
/**
|
|
137
|
+
* @param {LH.TraceEvent[]} mainThreadEvents
|
|
138
|
+
* @param {Array<{id: string, url: string}>} frames
|
|
139
|
+
* @param {number} traceEndTs
|
|
140
|
+
* @param {number} [traceStartTs] Optional time-0 ts for tasks. Tasks before this point will have negative start/end times. Defaults to the first task found.
|
|
141
|
+
* @return {TaskNode[]}
|
|
142
|
+
*/
|
|
143
|
+
static getMainThreadTasks(mainThreadEvents: LH.TraceEvent[], frames: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
url: string;
|
|
146
|
+
}>, traceEndTs: number, traceStartTs?: number | undefined): TaskNode[];
|
|
147
|
+
/**
|
|
148
|
+
* Prints an artistic rendering of the task tree for easier debugability.
|
|
149
|
+
*
|
|
150
|
+
* @param {TaskNode[]} tasks
|
|
151
|
+
* @param {{printWidth?: number, startTime?: number, endTime?: number, taskLabelFn?: (node: TaskNode) => string}} options
|
|
152
|
+
* @return {string}
|
|
153
|
+
*/
|
|
154
|
+
static printTaskTreeToDebugString(tasks: TaskNode[], options?: {
|
|
155
|
+
printWidth?: number | undefined;
|
|
156
|
+
startTime?: number | undefined;
|
|
157
|
+
endTime?: number | undefined;
|
|
158
|
+
taskLabelFn?: ((node: TaskNode) => string) | undefined;
|
|
159
|
+
}): string;
|
|
160
|
+
}
|
|
161
|
+
import * as LH from "../../../types/lh.js";
|
|
162
|
+
//# sourceMappingURL=main-thread-tasks.d.ts.map
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as LH from '../../../types/lh.js';
|
|
7
8
|
import {taskGroups, taskNameToGroup} from './task-groups.js';
|
|
8
9
|
|
|
9
10
|
/**
|