lighthouse 9.5.0-dev.20230117 → 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/render-blocking-resources.js +1 -3
- 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-preconnect.js +1 -4
- 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-metric.js +1 -3
- 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/metric.js +1 -1
- 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/timing-summary.js +1 -1
- 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-navigation.js +5 -2
- 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 +5 -4
- 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-elements.js +4 -4
- 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/dist/report/bundle.esm.js +2 -0
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- 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/performance-category-renderer.js +2 -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/generator/report-generator-test.js +3 -3
- package/report/test/renderer/performance-category-renderer-test.js +8 -9
- 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,72 @@
|
|
|
1
|
+
export default FRGatherer;
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all gatherers supporting both Fraggle Rock and the legacy flow.
|
|
4
|
+
* Most extending classes should implement the Fraggle Rock API and let this class handle translation.
|
|
5
|
+
* See core/gather/gatherers/gatherer.js for legacy method explanations.
|
|
6
|
+
*
|
|
7
|
+
* @implements {LH.Gatherer.GathererInstance}
|
|
8
|
+
* @implements {LH.Gatherer.FRGathererInstance}
|
|
9
|
+
*/
|
|
10
|
+
declare class FRGatherer implements LH.Gatherer.GathererInstance, LH.Gatherer.FRGathererInstance {
|
|
11
|
+
/** @type {LH.Gatherer.GathererMeta} */
|
|
12
|
+
meta: LH.Gatherer.GathererMeta;
|
|
13
|
+
/**
|
|
14
|
+
* Method to start observing a page for an arbitrary period of time.
|
|
15
|
+
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
16
|
+
* @return {Promise<void>|void}
|
|
17
|
+
*/
|
|
18
|
+
startInstrumentation(passContext: LH.Gatherer.FRTransitionalContext): Promise<void> | void;
|
|
19
|
+
/**
|
|
20
|
+
* Method to start observing a page when the measurements are very sensitive and
|
|
21
|
+
* should observe as little Lighthouse-induced work as possible.
|
|
22
|
+
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
23
|
+
* @return {Promise<void>|void}
|
|
24
|
+
*/
|
|
25
|
+
startSensitiveInstrumentation(passContext: LH.Gatherer.FRTransitionalContext): Promise<void> | void;
|
|
26
|
+
/**
|
|
27
|
+
* Method to stop observing a page when the measurements are very sensitive and
|
|
28
|
+
* should observe as little Lighthouse-induced work as possible.
|
|
29
|
+
*
|
|
30
|
+
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
31
|
+
* @return {Promise<void>|void}
|
|
32
|
+
*/
|
|
33
|
+
stopSensitiveInstrumentation(passContext: LH.Gatherer.FRTransitionalContext): Promise<void> | void;
|
|
34
|
+
/**
|
|
35
|
+
* Method to end observing a page after an arbitrary period of time.
|
|
36
|
+
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
37
|
+
* @return {Promise<void>|void}
|
|
38
|
+
*/
|
|
39
|
+
stopInstrumentation(passContext: LH.Gatherer.FRTransitionalContext): Promise<void> | void;
|
|
40
|
+
/**
|
|
41
|
+
* Method to gather results about a page.
|
|
42
|
+
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
43
|
+
* @return {LH.Gatherer.PhaseResult}
|
|
44
|
+
*/
|
|
45
|
+
getArtifact(passContext: LH.Gatherer.FRTransitionalContext): LH.Gatherer.PhaseResult;
|
|
46
|
+
/**
|
|
47
|
+
* Legacy property used to define the artifact ID. In Fraggle Rock, the artifact ID lives on the config.
|
|
48
|
+
* @return {keyof LH.GathererArtifacts}
|
|
49
|
+
*/
|
|
50
|
+
get name(): keyof LH.GathererArtifacts;
|
|
51
|
+
/**
|
|
52
|
+
* Legacy method. Called before navigation to target url, roughly corresponds to `startInstrumentation`.
|
|
53
|
+
* @param {LH.Gatherer.PassContext} passContext
|
|
54
|
+
* @return {Promise<LH.Gatherer.PhaseResultNonPromise>}
|
|
55
|
+
*/
|
|
56
|
+
beforePass(passContext: LH.Gatherer.PassContext): Promise<LH.Gatherer.PhaseResultNonPromise>;
|
|
57
|
+
/**
|
|
58
|
+
* Legacy method. Should never be used by a Fraggle Rock gatherer, here for compat only.
|
|
59
|
+
* @param {LH.Gatherer.PassContext} passContext
|
|
60
|
+
* @return {LH.Gatherer.PhaseResult}
|
|
61
|
+
*/
|
|
62
|
+
pass(passContext: LH.Gatherer.PassContext): LH.Gatherer.PhaseResult;
|
|
63
|
+
/**
|
|
64
|
+
* Legacy method. Roughly corresponds to `stopInstrumentation` or `getArtifact` depending on type of gatherer.
|
|
65
|
+
* @param {LH.Gatherer.PassContext} passContext
|
|
66
|
+
* @param {LH.Gatherer.LoadData} loadData
|
|
67
|
+
* @return {Promise<LH.Gatherer.PhaseResultNonPromise>}
|
|
68
|
+
*/
|
|
69
|
+
afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Gatherer.PhaseResultNonPromise>;
|
|
70
|
+
}
|
|
71
|
+
import * as LH from "../../types/lh.js";
|
|
72
|
+
//# sourceMappingURL=base-gatherer.d.ts.map
|
|
@@ -4,6 +4,8 @@
|
|
|
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';
|
|
8
|
+
|
|
7
9
|
/* eslint-disable no-unused-vars */
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a backend node ID (from a trace event, protocol, etc) to the object ID for use with
|
|
3
|
+
* `Runtime.callFunctionOn`. `undefined` means the node could not be found.
|
|
4
|
+
*
|
|
5
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
6
|
+
* @param {number} backendNodeId
|
|
7
|
+
* @return {Promise<string|undefined>}
|
|
8
|
+
*/
|
|
9
|
+
export function resolveNodeIdToObjectId(session: LH.Gatherer.FRProtocolSession, backendNodeId: number): Promise<string | undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a proprietary devtools node path (created from page-function.js) to the object ID for use
|
|
12
|
+
* with `Runtime.callFunctionOn`. `undefined` means the node could not be found.
|
|
13
|
+
* Requires `DOM.getDocument` to have been called since the object's creation or it will always be `undefined`.
|
|
14
|
+
*
|
|
15
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
16
|
+
* @param {string} path
|
|
17
|
+
* @return {Promise<string|undefined>}
|
|
18
|
+
*/
|
|
19
|
+
export function resolveDevtoolsNodePathToObjectId(session: LH.Gatherer.FRProtocolSession, path: string): Promise<string | undefined>;
|
|
20
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export namespace UIStrings {
|
|
2
|
+
const warningSlowHostCpu: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
6
|
+
* @return {Promise<LH.Crdp.Browser.GetVersionResponse & {milestone: number}>}
|
|
7
|
+
*/
|
|
8
|
+
export function getBrowserVersion(session: LH.Gatherer.FRProtocolSession): Promise<import("devtools-protocol").Protocol.Browser.GetVersionResponse & {
|
|
9
|
+
milestone: number;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Computes the benchmark index to get a rough estimate of device class.
|
|
13
|
+
* @param {LH.Gatherer.FRTransitionalDriver['executionContext']} executionContext
|
|
14
|
+
* @return {Promise<number>}
|
|
15
|
+
*/
|
|
16
|
+
export function getBenchmarkIndex(executionContext: LH.Gatherer.FRTransitionalDriver['executionContext']): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a warning if the host device appeared to be underpowered according to BenchmarkIndex.
|
|
19
|
+
*
|
|
20
|
+
* @param {{settings: LH.Config.Settings; baseArtifacts: Pick<LH.Artifacts, 'BenchmarkIndex'>}} context
|
|
21
|
+
* @return {LH.IcuMessage | undefined}
|
|
22
|
+
*/
|
|
23
|
+
export function getSlowHostCpuWarning(context: {
|
|
24
|
+
settings: LH.Config.Settings;
|
|
25
|
+
baseArtifacts: Pick<LH.Artifacts, 'BenchmarkIndex'>;
|
|
26
|
+
}): LH.IcuMessage | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* @param {{settings: LH.Config.Settings, baseArtifacts: Pick<LH.Artifacts, 'BenchmarkIndex'>}} context
|
|
29
|
+
* @return {Array<LH.IcuMessage>}
|
|
30
|
+
*/
|
|
31
|
+
export function getEnvironmentWarnings(context: {
|
|
32
|
+
settings: LH.Config.Settings;
|
|
33
|
+
baseArtifacts: Pick<LH.Artifacts, 'BenchmarkIndex'>;
|
|
34
|
+
}): Array<LH.IcuMessage>;
|
|
35
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export class ExecutionContext {
|
|
2
|
+
/**
|
|
3
|
+
* Prefix every script evaluation with a shadowing of common globals that tend to be ponyfilled
|
|
4
|
+
* incorrectly by many sites. This allows functions to still refer to `Promise` instead of
|
|
5
|
+
* Lighthouse-specific backups like `__nativePromise` (injected by `cacheNativesOnNewDocument` above).
|
|
6
|
+
*/
|
|
7
|
+
static _cachedNativesPreamble: string;
|
|
8
|
+
/**
|
|
9
|
+
* Serializes an array of arguments for use in an `eval` string across the protocol.
|
|
10
|
+
* @param {unknown[]} args
|
|
11
|
+
* @return {string}
|
|
12
|
+
*/
|
|
13
|
+
static serializeArguments(args: unknown[]): string;
|
|
14
|
+
/** @param {LH.Gatherer.FRProtocolSession} session */
|
|
15
|
+
constructor(session: LH.Gatherer.FRProtocolSession);
|
|
16
|
+
_session: LH.Gatherer.FRProtocolSession;
|
|
17
|
+
/** @type {number|undefined} */
|
|
18
|
+
_executionContextId: number | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Marks how many execution context ids have been created, for purposes of having a unique
|
|
21
|
+
* value (that doesn't expose the actual execution context id) to
|
|
22
|
+
* use for __lighthouseExecutionContextUniqueIdentifier.
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
_executionContextIdentifiersCreated: number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the isolated context ID currently in use.
|
|
28
|
+
*/
|
|
29
|
+
getContextId(): number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Clears the remembered context ID. Use this method when we have knowledge that the runtime context
|
|
32
|
+
* we were using has been destroyed by the browser and is no longer available.
|
|
33
|
+
*/
|
|
34
|
+
clearContextId(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the cached isolated execution context ID or creates a new execution context for the main
|
|
37
|
+
* frame. The cached execution context is cleared on every gotoURL invocation, so a new one will
|
|
38
|
+
* always be created on the first call on a new page.
|
|
39
|
+
* @return {Promise<number>}
|
|
40
|
+
*/
|
|
41
|
+
_getOrCreateIsolatedContextId(): Promise<number>;
|
|
42
|
+
/**
|
|
43
|
+
* Evaluate an expression in the given execution context; an undefined contextId implies the main
|
|
44
|
+
* page without isolation.
|
|
45
|
+
* @param {string} expression
|
|
46
|
+
* @param {number|undefined} contextId
|
|
47
|
+
* @return {Promise<*>}
|
|
48
|
+
*/
|
|
49
|
+
_evaluateInContext(expression: string, contextId: number | undefined): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Note: Prefer `evaluate` instead.
|
|
52
|
+
* Evaluate an expression in the context of the current page. If useIsolation is true, the expression
|
|
53
|
+
* will be evaluated in a content script that has access to the page's DOM but whose JavaScript state
|
|
54
|
+
* is completely separate.
|
|
55
|
+
* Returns a promise that resolves on the expression's value.
|
|
56
|
+
* @param {string} expression
|
|
57
|
+
* @param {{useIsolation?: boolean}=} options
|
|
58
|
+
* @return {Promise<*>}
|
|
59
|
+
*/
|
|
60
|
+
evaluateAsync(expression: string, options?: {
|
|
61
|
+
useIsolation?: boolean;
|
|
62
|
+
} | undefined): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Evaluate a function in the context of the current page.
|
|
65
|
+
* If `useIsolation` is true, the function will be evaluated in a content script that has
|
|
66
|
+
* access to the page's DOM but whose JavaScript state is completely separate.
|
|
67
|
+
* Returns a promise that resolves on a value of `mainFn`'s return type.
|
|
68
|
+
* @template {unknown[]} T, R
|
|
69
|
+
* @param {((...args: T) => R)} mainFn The main function to call.
|
|
70
|
+
* @param {{args: T, useIsolation?: boolean, deps?: Array<Function|string>}} options `args` should
|
|
71
|
+
* match the args of `mainFn`, and can be any serializable value. `deps` are functions that must be
|
|
72
|
+
* defined for `mainFn` to work.
|
|
73
|
+
* @return {Promise<Awaited<R>>}
|
|
74
|
+
*/
|
|
75
|
+
evaluate<T extends unknown[], R>(mainFn: (...args: T) => R, options: {
|
|
76
|
+
args: T;
|
|
77
|
+
useIsolation?: boolean | undefined;
|
|
78
|
+
deps?: (string | Function)[] | undefined;
|
|
79
|
+
}): Promise<Awaited<R>>;
|
|
80
|
+
/**
|
|
81
|
+
* Evaluate a function on every new frame from now on.
|
|
82
|
+
* @template {unknown[]} T
|
|
83
|
+
* @param {((...args: T) => void)} mainFn The main function to call.
|
|
84
|
+
* @param {{args: T, deps?: Array<Function|string>}} options `args` should
|
|
85
|
+
* match the args of `mainFn`, and can be any serializable value. `deps` are functions that must be
|
|
86
|
+
* defined for `mainFn` to work.
|
|
87
|
+
* @return {Promise<void>}
|
|
88
|
+
*/
|
|
89
|
+
evaluateOnNewDocument<T_1 extends unknown[]>(mainFn: (...args: T_1) => void, options: {
|
|
90
|
+
args: T_1;
|
|
91
|
+
deps?: (string | Function)[] | undefined;
|
|
92
|
+
}): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Cache native functions/objects inside window so we are sure polyfills do not overwrite the
|
|
95
|
+
* native implementations when the page loads.
|
|
96
|
+
* @return {Promise<void>}
|
|
97
|
+
*/
|
|
98
|
+
cacheNativesOnNewDocument(): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
import * as LH from "../../../types/lh.js";
|
|
101
|
+
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
/* global window */
|
|
8
8
|
|
|
9
|
+
import * as LH from '../../../types/lh.js';
|
|
9
10
|
import {pageFunctions} from '../../lib/page-functions.js';
|
|
10
11
|
|
|
11
12
|
class ExecutionContext {
|
|
@@ -232,13 +233,6 @@ class ExecutionContext {
|
|
|
232
233
|
window.__nativeFetch = window.fetch;
|
|
233
234
|
window.__ElementMatches = window.Element.prototype.matches;
|
|
234
235
|
window.__HTMLElementBoundingClientRect = window.HTMLElement.prototype.getBoundingClientRect;
|
|
235
|
-
// Ensure the native `performance.now` is not overwritable.
|
|
236
|
-
const performance = window.performance;
|
|
237
|
-
const performanceNow = window.performance.now;
|
|
238
|
-
Object.defineProperty(performance, 'now', {
|
|
239
|
-
value: () => performanceNow.call(performance),
|
|
240
|
-
writable: false,
|
|
241
|
-
});
|
|
242
236
|
/* c8 ignore stop */
|
|
243
237
|
}, {args: []});
|
|
244
238
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type NavigationOptions = {
|
|
2
|
+
waitUntil: Array<'fcp' | 'load' | 'navigated'>;
|
|
3
|
+
} & LH.Config.SharedPassNavigationJson & Partial<Pick<LH.Config.Settings, 'maxWaitForFcp' | 'maxWaitForLoad' | 'debugNavigation'>>;
|
|
4
|
+
/**
|
|
5
|
+
* Navigates to the given URL, assuming that the page is not already on this URL.
|
|
6
|
+
* Resolves on the url of the loaded page, taking into account any redirects.
|
|
7
|
+
* Typical use of this method involves navigating to a neutral page such as `about:blank` in between
|
|
8
|
+
* navigations.
|
|
9
|
+
*
|
|
10
|
+
* @param {LH.Gatherer.FRTransitionalDriver} driver
|
|
11
|
+
* @param {LH.NavigationRequestor} requestor
|
|
12
|
+
* @param {NavigationOptions} options
|
|
13
|
+
* @return {Promise<{requestedUrl: string, mainDocumentUrl: string, warnings: Array<LH.IcuMessage>}>}
|
|
14
|
+
*/
|
|
15
|
+
export function gotoURL(driver: LH.Gatherer.FRTransitionalDriver, requestor: LH.NavigationRequestor, options: NavigationOptions): Promise<{
|
|
16
|
+
requestedUrl: string;
|
|
17
|
+
mainDocumentUrl: string;
|
|
18
|
+
warnings: Array<LH.IcuMessage>;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* @param {{timedOut: boolean, requestedUrl: string, mainDocumentUrl: string; }} navigation
|
|
22
|
+
* @return {Array<LH.IcuMessage>}
|
|
23
|
+
*/
|
|
24
|
+
export function getNavigationWarnings(navigation: {
|
|
25
|
+
timedOut: boolean;
|
|
26
|
+
requestedUrl: string;
|
|
27
|
+
mainDocumentUrl: string;
|
|
28
|
+
}): Array<LH.IcuMessage>;
|
|
29
|
+
export namespace UIStrings {
|
|
30
|
+
const warningRedirected: string;
|
|
31
|
+
const warningTimeout: string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type NetworkRecorderEventMap = import('../../lib/network-recorder.js').NetworkRecorderEventMap;
|
|
2
|
+
export type NetworkMonitorEvent_ = 'network-2-idle' | 'network-critical-idle' | 'networkidle' | 'networkbusy' | 'network-critical-busy' | 'network-2-busy';
|
|
3
|
+
export type NetworkMonitorEventMap = Record<NetworkMonitorEvent_, []> & NetworkRecorderEventMap;
|
|
4
|
+
export type NetworkMonitorEvent = keyof NetworkMonitorEventMap;
|
|
5
|
+
export type NetworkMonitorEmitter = LH.Protocol.StrictEventEmitterClass<NetworkMonitorEventMap>;
|
|
6
|
+
declare const NetworkMonitor_base: NetworkMonitorEmitter;
|
|
7
|
+
export class NetworkMonitor extends NetworkMonitor_base {
|
|
8
|
+
/**
|
|
9
|
+
* Finds all time periods where the number of inflight requests is less than or equal to the
|
|
10
|
+
* number of allowed concurrent requests.
|
|
11
|
+
* @param {Array<LH.Artifacts.NetworkRequest>} requests
|
|
12
|
+
* @param {number} allowedConcurrentRequests
|
|
13
|
+
* @param {number=} endTime
|
|
14
|
+
* @return {Array<{start: number, end: number}>}
|
|
15
|
+
*/
|
|
16
|
+
static findNetworkQuietPeriods(requests: Array<LH.Artifacts.NetworkRequest>, allowedConcurrentRequests: number, endTime?: number | undefined): Array<{
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
}>;
|
|
20
|
+
/** @param {LH.Gatherer.FRTransitionalDriver['targetManager']} targetManager */
|
|
21
|
+
constructor(targetManager: LH.Gatherer.FRTransitionalDriver['targetManager']);
|
|
22
|
+
/** @type {NetworkRecorder|undefined} */
|
|
23
|
+
_networkRecorder: NetworkRecorder | undefined;
|
|
24
|
+
/** @type {Array<LH.Crdp.Page.Frame>} */
|
|
25
|
+
_frameNavigations: Array<LH.Crdp.Page.Frame>;
|
|
26
|
+
/** @type {LH.Gatherer.FRTransitionalDriver['targetManager']} */
|
|
27
|
+
_targetManager: LH.Gatherer.FRTransitionalDriver['targetManager'];
|
|
28
|
+
/** @type {LH.Gatherer.FRProtocolSession} */
|
|
29
|
+
_session: LH.Gatherer.FRProtocolSession;
|
|
30
|
+
/** @param {LH.Crdp.Page.FrameNavigatedEvent} event */
|
|
31
|
+
_onFrameNavigated: (event: LH.Crdp.Page.FrameNavigatedEvent) => number;
|
|
32
|
+
/** @param {LH.Protocol.RawEventMessage} event */
|
|
33
|
+
_onProtocolMessage: (event: LH.Protocol.RawEventMessage) => void;
|
|
34
|
+
/**
|
|
35
|
+
* @return {Promise<void>}
|
|
36
|
+
*/
|
|
37
|
+
enable(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* @return {Promise<void>}
|
|
40
|
+
*/
|
|
41
|
+
disable(): Promise<void>;
|
|
42
|
+
/** @return {Promise<{requestedUrl?: string, mainDocumentUrl?: string}>} */
|
|
43
|
+
getNavigationUrls(): Promise<{
|
|
44
|
+
requestedUrl?: string | undefined;
|
|
45
|
+
mainDocumentUrl?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* @return {Array<NetworkRequest>}
|
|
49
|
+
*/
|
|
50
|
+
getInflightRequests(): Array<NetworkRequest>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns whether the network is completely idle (i.e. there are 0 inflight network requests).
|
|
53
|
+
*/
|
|
54
|
+
isIdle(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Returns whether any important resources for the page are in progress.
|
|
57
|
+
* Above-the-fold images and XHRs should be included.
|
|
58
|
+
* Tracking pixels, low priority images, and cross frame requests should be excluded.
|
|
59
|
+
* @return {boolean}
|
|
60
|
+
*/
|
|
61
|
+
isCriticalIdle(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Returns whether the network is semi-idle (i.e. there are 2 or fewer inflight network requests).
|
|
64
|
+
*/
|
|
65
|
+
is2Idle(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Returns whether the number of currently inflight requests is less than or
|
|
68
|
+
* equal to the number of allowed concurrent requests.
|
|
69
|
+
* @param {number} allowedRequests
|
|
70
|
+
* @param {(request: NetworkRequest) => boolean} [requestFilter]
|
|
71
|
+
* @return {boolean}
|
|
72
|
+
*/
|
|
73
|
+
_isActiveIdlePeriod(allowedRequests: number, requestFilter?: ((request: NetworkRequest) => boolean) | undefined): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Emits the appropriate network status event.
|
|
76
|
+
*/
|
|
77
|
+
_emitNetworkStatus(): void;
|
|
78
|
+
}
|
|
79
|
+
import { NetworkRecorder } from "../../lib/network-recorder.js";
|
|
80
|
+
import { NetworkRequest } from "../../lib/network-request.js";
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=network-monitor.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the body of the response with the given ID. Rejects if getting the
|
|
3
|
+
* body times out.
|
|
4
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
5
|
+
* @param {string} requestId
|
|
6
|
+
* @param {number} [timeout]
|
|
7
|
+
* @return {Promise<string>}
|
|
8
|
+
*/
|
|
9
|
+
export function fetchResponseBodyFromCache(session: LH.Gatherer.FRProtocolSession, requestId: string, timeout?: number | undefined): Promise<string>;
|
|
10
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prepares a target for observational analysis by setting throttling and network headers/blocked patterns.
|
|
3
|
+
*
|
|
4
|
+
* This method assumes `prepareTargetForNavigationMode` or `prepareTargetForTimespanMode` has already been invoked.
|
|
5
|
+
*
|
|
6
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
7
|
+
* @param {LH.Config.Settings} settings
|
|
8
|
+
* @param {{disableThrottling: boolean, blockedUrlPatterns?: string[]}} options
|
|
9
|
+
*/
|
|
10
|
+
export function prepareThrottlingAndNetwork(session: LH.Gatherer.FRProtocolSession, settings: LH.Config.Settings, options: {
|
|
11
|
+
disableThrottling: boolean;
|
|
12
|
+
blockedUrlPatterns?: string[];
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Prepares a target to be analyzed in timespan mode by enabling protocol domains, emulation, and throttling.
|
|
16
|
+
*
|
|
17
|
+
* @param {LH.Gatherer.FRTransitionalDriver} driver
|
|
18
|
+
* @param {LH.Config.Settings} settings
|
|
19
|
+
*/
|
|
20
|
+
export function prepareTargetForTimespanMode(driver: LH.Gatherer.FRTransitionalDriver, settings: LH.Config.Settings): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Prepares a target to be analyzed in navigation mode by enabling protocol domains, emulation, and new document
|
|
23
|
+
* handlers for global APIs or error handling.
|
|
24
|
+
*
|
|
25
|
+
* This method should be used in combination with `prepareTargetForIndividualNavigation` before a specific navigation occurs.
|
|
26
|
+
*
|
|
27
|
+
* @param {LH.Gatherer.FRTransitionalDriver} driver
|
|
28
|
+
* @param {LH.Config.Settings} settings
|
|
29
|
+
*/
|
|
30
|
+
export function prepareTargetForNavigationMode(driver: LH.Gatherer.FRTransitionalDriver, settings: LH.Config.Settings): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Prepares a target for a particular navigation by resetting storage and setting network.
|
|
33
|
+
*
|
|
34
|
+
* This method assumes `prepareTargetForNavigationMode` has already been invoked.
|
|
35
|
+
*
|
|
36
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
37
|
+
* @param {LH.Config.Settings} settings
|
|
38
|
+
* @param {Pick<LH.Config.NavigationDefn, 'disableThrottling'|'disableStorageReset'|'blockedUrlPatterns'> & {requestor: LH.NavigationRequestor}} navigation
|
|
39
|
+
* @return {Promise<{warnings: Array<LH.IcuMessage>}>}
|
|
40
|
+
*/
|
|
41
|
+
export function prepareTargetForIndividualNavigation(session: LH.Gatherer.FRProtocolSession, settings: LH.Config.Settings, navigation: Pick<import("../../../types/config.js").default.NavigationDefn, "blockedUrlPatterns" | "disableStorageReset" | "disableThrottling"> & {
|
|
42
|
+
requestor: LH.NavigationRequestor;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
warnings: Array<LH.IcuMessage>;
|
|
45
|
+
}>;
|
|
46
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2021 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.Gatherer.FRProtocolSession} session
|
|
8
|
+
* @return {Promise<LH.Crdp.ServiceWorker.WorkerVersionUpdatedEvent>}
|
|
9
|
+
*/
|
|
10
|
+
export function getServiceWorkerVersions(session: LH.Gatherer.FRProtocolSession): Promise<LH.Crdp.ServiceWorker.WorkerVersionUpdatedEvent>;
|
|
11
|
+
/**
|
|
12
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
13
|
+
* @return {Promise<LH.Crdp.ServiceWorker.WorkerRegistrationUpdatedEvent>}
|
|
14
|
+
*/
|
|
15
|
+
export function getServiceWorkerRegistrations(session: LH.Gatherer.FRProtocolSession): Promise<LH.Crdp.ServiceWorker.WorkerRegistrationUpdatedEvent>;
|
|
16
|
+
//# sourceMappingURL=service-workers.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
3
|
+
* @param {string} url
|
|
4
|
+
* @return {Promise<LH.IcuMessage[]>}
|
|
5
|
+
*/
|
|
6
|
+
export function clearDataForOrigin(session: LH.Gatherer.FRProtocolSession, url: string): Promise<LH.IcuMessage[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Clear the network cache on disk and in memory.
|
|
9
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
10
|
+
* @return {Promise<LH.IcuMessage[]>}
|
|
11
|
+
*/
|
|
12
|
+
export function clearBrowserCaches(session: LH.Gatherer.FRProtocolSession): Promise<LH.IcuMessage[]>;
|
|
13
|
+
/**
|
|
14
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
15
|
+
* @param {string} url
|
|
16
|
+
* @return {Promise<LH.IcuMessage | undefined>}
|
|
17
|
+
*/
|
|
18
|
+
export function getImportantStorageWarning(session: LH.Gatherer.FRProtocolSession, url: string): Promise<LH.IcuMessage | undefined>;
|
|
19
|
+
export namespace UIStrings {
|
|
20
|
+
const warningData: string;
|
|
21
|
+
const warningCacheTimeout: string;
|
|
22
|
+
const warningOriginDataTimeout: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type TargetWithSession = {
|
|
2
|
+
target: LH.Crdp.Target.TargetInfo;
|
|
3
|
+
cdpSession: LH.Puppeteer.CDPSession;
|
|
4
|
+
session: LH.Gatherer.FRProtocolSession;
|
|
5
|
+
protocolListener: (event: unknown) => void;
|
|
6
|
+
};
|
|
7
|
+
export type ProtocolEventMap = {
|
|
8
|
+
'protocolevent': [LH.Protocol.RawEventMessage];
|
|
9
|
+
};
|
|
10
|
+
export type ProtocolEventMessageEmitter = LH.Protocol.StrictEventEmitterClass<ProtocolEventMap>;
|
|
11
|
+
declare const TargetManager_base: ProtocolEventMessageEmitter;
|
|
12
|
+
/**
|
|
13
|
+
* Tracks targets (the page itself, its iframes, their iframes, etc) as they
|
|
14
|
+
* appear and allows listeners to the flattened protocol events from all targets.
|
|
15
|
+
*/
|
|
16
|
+
export class TargetManager extends TargetManager_base {
|
|
17
|
+
/** @param {LH.Puppeteer.CDPSession} cdpSession */
|
|
18
|
+
constructor(cdpSession: LH.Puppeteer.CDPSession);
|
|
19
|
+
_enabled: boolean;
|
|
20
|
+
_rootCdpSession: import("../../../types/puppeteer.js").default.CDPSession;
|
|
21
|
+
/**
|
|
22
|
+
* A map of target id to target/session information. Used to ensure unique
|
|
23
|
+
* attached targets.
|
|
24
|
+
* @type {Map<string, TargetWithSession>}
|
|
25
|
+
*/
|
|
26
|
+
_targetIdToTargets: Map<string, TargetWithSession>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {LH.Puppeteer.CDPSession} cdpSession
|
|
29
|
+
*/
|
|
30
|
+
_onSessionAttached(cdpSession: LH.Puppeteer.CDPSession): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* @param {LH.Crdp.Page.FrameNavigatedEvent} frameNavigatedEvent
|
|
33
|
+
*/
|
|
34
|
+
_onFrameNavigated(frameNavigatedEvent: LH.Crdp.Page.FrameNavigatedEvent): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} sessionId
|
|
37
|
+
* @return {LH.Gatherer.FRProtocolSession}
|
|
38
|
+
*/
|
|
39
|
+
_findSession(sessionId: string): LH.Gatherer.FRProtocolSession;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the root session.
|
|
42
|
+
* @return {LH.Gatherer.FRProtocolSession}
|
|
43
|
+
*/
|
|
44
|
+
rootSession(): LH.Gatherer.FRProtocolSession;
|
|
45
|
+
/**
|
|
46
|
+
* Returns a listener for all protocol events from session, and augments the
|
|
47
|
+
* event with the sessionId.
|
|
48
|
+
* @param {string} sessionId
|
|
49
|
+
*/
|
|
50
|
+
_getProtocolEventListener(sessionId: string): <EventName extends keyof import("puppeteer-core").ProtocolMapping.Events>(method: EventName, params: import("../../../types/protocol.js").default.RawEventMessageRecord[EventName]["params"]) => void;
|
|
51
|
+
/**
|
|
52
|
+
* @return {Promise<void>}
|
|
53
|
+
*/
|
|
54
|
+
enable(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* @return {Promise<void>}
|
|
57
|
+
*/
|
|
58
|
+
disable(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=target-manager.d.ts.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type NetworkMonitor = InstanceType<typeof import("./network-monitor.js")['NetworkMonitor']>;
|
|
2
|
+
export type NetworkMonitorEvent = import('./network-monitor.js').NetworkMonitorEvent;
|
|
3
|
+
export type CancellableWait<T = void> = {
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
cancel: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type WaitOptions = {
|
|
8
|
+
pauseAfterFcpMs: number;
|
|
9
|
+
pauseAfterLoadMs: number;
|
|
10
|
+
networkQuietThresholdMs: number;
|
|
11
|
+
cpuQuietThresholdMs: number;
|
|
12
|
+
maxWaitForLoadedMs: number;
|
|
13
|
+
maxWaitForFcpMs: number | undefined;
|
|
14
|
+
_waitForTestOverrides?: {
|
|
15
|
+
waitForFcp: typeof waitForFcp;
|
|
16
|
+
waitForLoadEvent: typeof waitForLoadEvent;
|
|
17
|
+
waitForNetworkIdle: typeof waitForNetworkIdle;
|
|
18
|
+
waitForCPUIdle: typeof waitForCPUIdle;
|
|
19
|
+
} | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @typedef {InstanceType<import('./network-monitor.js')['NetworkMonitor']>} NetworkMonitor */
|
|
22
|
+
/** @typedef {import('./network-monitor.js').NetworkMonitorEvent} NetworkMonitorEvent */
|
|
23
|
+
/**
|
|
24
|
+
* @template [T=void]
|
|
25
|
+
* @typedef CancellableWait
|
|
26
|
+
* @prop {Promise<T>} promise
|
|
27
|
+
* @prop {() => void} cancel
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @typedef WaitOptions
|
|
31
|
+
* @prop {number} pauseAfterFcpMs
|
|
32
|
+
* @prop {number} pauseAfterLoadMs
|
|
33
|
+
* @prop {number} networkQuietThresholdMs
|
|
34
|
+
* @prop {number} cpuQuietThresholdMs
|
|
35
|
+
* @prop {number} maxWaitForLoadedMs
|
|
36
|
+
* @prop {number|undefined} maxWaitForFcpMs
|
|
37
|
+
* @prop {{waitForFcp: typeof waitForFcp, waitForLoadEvent: typeof waitForLoadEvent, waitForNetworkIdle: typeof waitForNetworkIdle, waitForCPUIdle: typeof waitForCPUIdle}} [_waitForTestOverrides]
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Returns a promise that resolves immediately.
|
|
41
|
+
* Used for placeholder conditions that we don't want to start waiting for just yet, but still want
|
|
42
|
+
* to satisfy the same interface.
|
|
43
|
+
* @return {{promise: Promise<void>, cancel: function(): void}}
|
|
44
|
+
*/
|
|
45
|
+
export function waitForNothing(): {
|
|
46
|
+
promise: Promise<void>;
|
|
47
|
+
cancel: () => void;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns a promise that resolve when a frame has been navigated.
|
|
51
|
+
* Used for detecting that our about:blank reset has been completed.
|
|
52
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
53
|
+
* @return {CancellableWait<LH.Crdp.Page.FrameNavigatedEvent>}
|
|
54
|
+
*/
|
|
55
|
+
export function waitForFrameNavigated(session: LH.Gatherer.FRProtocolSession): CancellableWait<LH.Crdp.Page.FrameNavigatedEvent>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns a promise that resolve when a frame has a FCP.
|
|
58
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
59
|
+
* @param {number} pauseAfterFcpMs
|
|
60
|
+
* @param {number} maxWaitForFcpMs
|
|
61
|
+
* @return {CancellableWait}
|
|
62
|
+
*/
|
|
63
|
+
export function waitForFcp(session: LH.Gatherer.FRProtocolSession, pauseAfterFcpMs: number, maxWaitForFcpMs: number): CancellableWait;
|
|
64
|
+
/**
|
|
65
|
+
* Return a promise that resolves `pauseAfterLoadMs` after the load event
|
|
66
|
+
* fires and a method to cancel internal listeners and timeout.
|
|
67
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
68
|
+
* @param {number} pauseAfterLoadMs
|
|
69
|
+
* @return {CancellableWait}
|
|
70
|
+
*/
|
|
71
|
+
export function waitForLoadEvent(session: LH.Gatherer.FRProtocolSession, pauseAfterLoadMs: number): CancellableWait;
|
|
72
|
+
/**
|
|
73
|
+
* Returns a promise that resolves when the network has been idle (after DCL) for
|
|
74
|
+
* `networkQuietThresholdMs` ms and a method to cancel internal network listeners/timeout.
|
|
75
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
76
|
+
* @param {NetworkMonitor} networkMonitor
|
|
77
|
+
* @param {{networkQuietThresholdMs: number, busyEvent: NetworkMonitorEvent, idleEvent: NetworkMonitorEvent, isIdle(recorder: NetworkMonitor): boolean, pretendDCLAlreadyFired?: boolean}} networkQuietOptions
|
|
78
|
+
* @return {CancellableWait}
|
|
79
|
+
*/
|
|
80
|
+
export function waitForNetworkIdle(session: LH.Gatherer.FRProtocolSession, networkMonitor: NetworkMonitor, networkQuietOptions: {
|
|
81
|
+
networkQuietThresholdMs: number;
|
|
82
|
+
busyEvent: NetworkMonitorEvent;
|
|
83
|
+
idleEvent: NetworkMonitorEvent;
|
|
84
|
+
isIdle(recorder: NetworkMonitor): boolean;
|
|
85
|
+
pretendDCLAlreadyFired?: boolean | undefined;
|
|
86
|
+
}): CancellableWait;
|
|
87
|
+
/**
|
|
88
|
+
* Resolves when there have been no long tasks for at least waitForCPUQuiet ms.
|
|
89
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
90
|
+
* @param {number} waitForCPUQuiet
|
|
91
|
+
* @return {CancellableWait}
|
|
92
|
+
*/
|
|
93
|
+
export function waitForCPUIdle(session: LH.Gatherer.FRProtocolSession, waitForCPUQuiet: number): CancellableWait;
|
|
94
|
+
/**
|
|
95
|
+
* Returns a promise that resolves when:
|
|
96
|
+
* - All of the following conditions have been met:
|
|
97
|
+
* - page has no security issues
|
|
98
|
+
* - pauseAfterLoadMs milliseconds have passed since the load event.
|
|
99
|
+
* - networkQuietThresholdMs milliseconds have passed since the last network request that exceeded
|
|
100
|
+
* 2 inflight requests (network-2-quiet has been reached).
|
|
101
|
+
* - cpuQuietThresholdMs have passed since the last long task after network-2-quiet.
|
|
102
|
+
* - maxWaitForLoadedMs milliseconds have passed.
|
|
103
|
+
* See https://github.com/GoogleChrome/lighthouse/issues/627 for more.
|
|
104
|
+
* @param {LH.Gatherer.FRProtocolSession} session
|
|
105
|
+
* @param {NetworkMonitor} networkMonitor
|
|
106
|
+
* @param {WaitOptions} options
|
|
107
|
+
* @return {Promise<{timedOut: boolean}>}
|
|
108
|
+
*/
|
|
109
|
+
export function waitForFullyLoaded(session: LH.Gatherer.FRProtocolSession, networkMonitor: NetworkMonitor, options: WaitOptions): Promise<{
|
|
110
|
+
timedOut: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* @param {LH.Gatherer.FRTransitionalDriver} driver
|
|
114
|
+
*/
|
|
115
|
+
export function waitForUserToContinue(driver: LH.Gatherer.FRTransitionalDriver): Promise<void>;
|
|
116
|
+
//# sourceMappingURL=wait-for-condition.d.ts.map
|