UNPKG

lighthouse

Version:

Automated auditing, performance metrics, and best practices for the web.

60 lines (50 loc) 1.55 kB
/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as LH from '../../types/lh.js'; /* eslint-disable no-unused-vars */ /** * Base class for all gatherers. * * @implements {LH.Gatherer.GathererInstance} */ class BaseGatherer { /** @type {LH.Gatherer.GathererMeta} */ meta = {supportedModes: []}; /** * Method to start observing a page for an arbitrary period of time. * @param {LH.Gatherer.Context} passContext * @return {Promise<void>|void} */ startInstrumentation(passContext) { } /** * Method to start observing a page when the measurements are very sensitive and * should observe as little Lighthouse-induced work as possible. * @param {LH.Gatherer.Context} passContext * @return {Promise<void>|void} */ startSensitiveInstrumentation(passContext) { } /** * Method to stop observing a page when the measurements are very sensitive and * should observe as little Lighthouse-induced work as possible. * * @param {LH.Gatherer.Context} passContext * @return {Promise<void>|void} */ stopSensitiveInstrumentation(passContext) { } /** * Method to end observing a page after an arbitrary period of time. * @param {LH.Gatherer.Context} passContext * @return {Promise<void>|void} */ stopInstrumentation(passContext) { } /** * Method to gather results about a page. * @param {LH.Gatherer.Context} passContext * @return {LH.Gatherer.PhaseResult} */ getArtifact(passContext) { } } export default BaseGatherer;