lighthouse 9.5.0-dev.20230123 → 9.5.0-dev.20230125
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/.codecov.yml +0 -5
- package/core/audits/accessibility/accesskeys.js +1 -1
- package/core/audits/accessibility/aria-allowed-attr.js +1 -1
- package/core/audits/accessibility/aria-command-name.js +1 -1
- package/core/audits/accessibility/aria-hidden-body.js +1 -1
- package/core/audits/accessibility/aria-hidden-focus.js +1 -1
- package/core/audits/accessibility/aria-input-field-name.js +1 -1
- package/core/audits/accessibility/aria-meter-name.js +1 -1
- package/core/audits/accessibility/aria-progressbar-name.js +1 -1
- package/core/audits/accessibility/aria-required-attr.js +1 -1
- package/core/audits/accessibility/aria-required-children.js +1 -1
- package/core/audits/accessibility/aria-required-parent.js +1 -1
- package/core/audits/accessibility/aria-roles.js +1 -1
- package/core/audits/accessibility/aria-toggle-field-name.js +1 -1
- package/core/audits/accessibility/aria-tooltip-name.js +1 -1
- package/core/audits/accessibility/aria-treeitem-name.js +1 -1
- package/core/audits/accessibility/aria-valid-attr-value.js +1 -1
- package/core/audits/accessibility/aria-valid-attr.js +1 -1
- package/core/audits/accessibility/button-name.js +1 -1
- package/core/audits/accessibility/bypass.js +1 -1
- package/core/audits/accessibility/color-contrast.js +1 -1
- package/core/audits/accessibility/definition-list.js +1 -1
- package/core/audits/accessibility/dlitem.js +1 -1
- package/core/audits/accessibility/document-title.js +1 -1
- package/core/audits/accessibility/duplicate-id-active.js +1 -1
- package/core/audits/accessibility/duplicate-id-aria.js +1 -1
- package/core/audits/accessibility/form-field-multiple-labels.js +1 -1
- package/core/audits/accessibility/frame-title.js +1 -1
- package/core/audits/accessibility/heading-order.js +1 -1
- package/core/audits/accessibility/html-has-lang.js +1 -1
- package/core/audits/accessibility/html-lang-valid.js +1 -1
- package/core/audits/accessibility/image-alt.js +1 -1
- package/core/audits/accessibility/input-image-alt.js +1 -1
- package/core/audits/accessibility/label.js +1 -1
- package/core/audits/accessibility/link-name.js +1 -1
- package/core/audits/accessibility/list.js +1 -1
- package/core/audits/accessibility/listitem.js +1 -1
- package/core/audits/accessibility/meta-refresh.js +1 -1
- package/core/audits/accessibility/meta-viewport.js +1 -1
- package/core/audits/accessibility/object-alt.js +1 -1
- package/core/audits/accessibility/tabindex.js +1 -1
- package/core/audits/accessibility/td-headers-attr.js +1 -1
- package/core/audits/accessibility/th-has-data-cells.js +1 -1
- package/core/audits/accessibility/valid-lang.js +1 -1
- package/core/audits/accessibility/video-caption.js +1 -1
- package/core/audits/audit.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +1 -0
- package/core/audits/byte-efficiency/legacy-javascript.js +7 -3
- package/core/audits/dobetterweb/uses-http2.d.ts +5 -2
- package/core/audits/dobetterweb/uses-http2.js +12 -7
- package/core/audits/network-requests.js +7 -6
- package/core/audits/third-party-facades.d.ts +3 -2
- package/core/audits/third-party-facades.js +12 -9
- package/core/audits/third-party-summary.d.ts +7 -6
- package/core/audits/third-party-summary.js +16 -14
- package/core/audits/valid-source-maps.d.ts +5 -3
- package/core/audits/valid-source-maps.js +11 -9
- package/core/computed/entity-classification.d.ts +29 -0
- package/core/computed/entity-classification.js +102 -0
- package/core/computed/metrics/responsiveness.js +5 -2
- package/core/computed/page-dependency-graph.js +1 -1
- package/core/computed/resource-summary.d.ts +4 -2
- package/core/computed/resource-summary.js +8 -5
- package/core/gather/gatherers/accessibility.js +3 -1
- package/core/lib/network-request.d.ts +2 -0
- package/core/lib/network-request.js +3 -0
- package/core/lib/stack-packs.js +4 -0
- package/core/lib/tracehouse/trace-processor.d.ts +14 -5
- package/core/lib/tracehouse/trace-processor.js +85 -30
- package/core/lib/traces/metric-trace-events.js +1 -1
- package/core/lib/url-utils.js +1 -1
- package/core/runner.d.ts +10 -0
- package/core/runner.js +48 -0
- package/dist/report/bundle.esm.js +724 -687
- package/dist/report/flow.js +25 -15
- package/dist/report/standalone.js +25 -15
- package/flow-report/src/common.tsx +1 -1
- package/flow-report/src/i18n/i18n.tsx +17 -16
- package/flow-report/src/sidebar/sidebar.tsx +2 -2
- package/flow-report/src/summary/category.tsx +6 -6
- package/flow-report/src/summary/summary.tsx +2 -2
- package/package.json +7 -8
- package/report/renderer/category-renderer.js +19 -17
- package/report/renderer/crc-details-renderer.js +6 -6
- package/report/renderer/details-renderer.js +7 -6
- package/report/renderer/dom.js +1 -1
- package/report/renderer/element-screenshot-renderer.js +3 -3
- package/report/renderer/performance-category-renderer.js +17 -15
- package/report/renderer/pwa-category-renderer.js +5 -4
- package/report/renderer/report-globals.d.ts +21 -0
- package/report/renderer/report-globals.js +49 -0
- package/report/renderer/report-renderer.js +22 -20
- package/report/renderer/report-ui-features.js +9 -8
- package/report/renderer/report-utils.d.ts +116 -0
- package/report/renderer/{util.js → report-utils.js} +81 -429
- package/report/renderer/snippet-renderer.js +3 -2
- package/report/test/renderer/category-renderer-test.js +9 -4
- package/report/test/renderer/crc-details-renderer-test.js +7 -3
- package/report/test/renderer/details-renderer-test.js +7 -3
- package/report/test/renderer/dom-test.js +7 -3
- package/report/test/renderer/element-screenshot-renderer-test.js +8 -4
- package/report/test/renderer/performance-category-renderer-test.js +14 -9
- package/report/test/renderer/pwa-category-renderer-test.js +10 -5
- package/report/test/renderer/report-renderer-test.js +2 -2
- package/report/test/renderer/report-ui-features-test.js +3 -3
- package/report/test/renderer/{util-test.js → report-utils-test.js} +36 -234
- package/report/test/renderer/snippet-renderer-test.js +7 -3
- package/shared/localization/format.js +5 -2
- package/shared/localization/locales/ar-XB.json +50 -50
- package/shared/localization/locales/ar.json +50 -50
- package/shared/localization/locales/bg.json +50 -50
- package/shared/localization/locales/ca.json +50 -50
- package/shared/localization/locales/cs.json +50 -50
- package/shared/localization/locales/da.json +50 -50
- package/shared/localization/locales/de.json +50 -50
- package/shared/localization/locales/el.json +50 -50
- package/shared/localization/locales/en-GB.json +50 -50
- package/shared/localization/locales/en-US.json +128 -98
- package/shared/localization/locales/en-XA.json +50 -50
- package/shared/localization/locales/en-XL.json +128 -98
- package/shared/localization/locales/es-419.json +50 -50
- package/shared/localization/locales/es.json +50 -50
- package/shared/localization/locales/fi.json +50 -50
- package/shared/localization/locales/fil.json +50 -50
- package/shared/localization/locales/fr.json +50 -50
- package/shared/localization/locales/he.json +50 -50
- package/shared/localization/locales/hi.json +50 -50
- package/shared/localization/locales/hr.json +50 -50
- package/shared/localization/locales/hu.json +50 -50
- package/shared/localization/locales/id.json +50 -50
- package/shared/localization/locales/it.json +50 -50
- package/shared/localization/locales/ja.json +50 -50
- package/shared/localization/locales/ko.json +50 -50
- package/shared/localization/locales/lt.json +50 -50
- package/shared/localization/locales/lv.json +50 -50
- package/shared/localization/locales/nl.json +50 -50
- package/shared/localization/locales/no.json +50 -50
- package/shared/localization/locales/pl.json +50 -50
- package/shared/localization/locales/pt-PT.json +50 -50
- package/shared/localization/locales/pt.json +50 -50
- package/shared/localization/locales/ro.json +50 -50
- package/shared/localization/locales/ru.json +50 -50
- package/shared/localization/locales/sk.json +50 -50
- package/shared/localization/locales/sl.json +50 -50
- package/shared/localization/locales/sr-Latn.json +50 -50
- package/shared/localization/locales/sr.json +50 -50
- package/shared/localization/locales/sv.json +50 -50
- package/shared/localization/locales/ta.json +50 -50
- package/shared/localization/locales/te.json +50 -50
- package/shared/localization/locales/th.json +50 -50
- package/shared/localization/locales/tr.json +50 -50
- package/shared/localization/locales/uk.json +50 -50
- package/shared/localization/locales/vi.json +50 -50
- package/shared/localization/locales/zh-HK.json +50 -50
- package/shared/localization/locales/zh-TW.json +50 -50
- package/shared/localization/locales/zh.json +50 -50
- package/shared/test/util-test.js +214 -0
- package/shared/util.d.ts +122 -0
- package/shared/util.js +332 -0
- package/tsconfig.json +0 -2
- package/types/artifacts.d.ts +21 -2
- package/types/lhr/lhr.d.ts +33 -0
- package/core/lib/minify-trace.d.ts +0 -6
- package/core/lib/minify-trace.js +0 -172
- package/core/util.cjs +0 -845
- package/core/util.d.cts +0 -342
- package/report/renderer/util.d.ts +0 -342
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 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
|
+
import {UIStrings} from './report-utils.js';
|
|
8
|
+
|
|
9
|
+
/** @typedef {import('./i18n-formatter').I18nFormatter} I18nFormatter */
|
|
10
|
+
|
|
11
|
+
let svgSuffix = 0;
|
|
12
|
+
|
|
13
|
+
class Globals {
|
|
14
|
+
/** @type {I18nFormatter} */
|
|
15
|
+
// @ts-expect-error: Set in report renderer.
|
|
16
|
+
static i18n = null;
|
|
17
|
+
|
|
18
|
+
/** @type {typeof UIStrings} */
|
|
19
|
+
// @ts-expect-error: Set in report renderer.
|
|
20
|
+
static strings = {};
|
|
21
|
+
|
|
22
|
+
/** @type {LH.ReportResult | null} */
|
|
23
|
+
static reportJson = null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {{providedStrings: Record<string, string>; i18n: I18nFormatter; reportJson: LH.ReportResult | null}} options
|
|
27
|
+
*/
|
|
28
|
+
static apply(options) {
|
|
29
|
+
Globals.strings = {
|
|
30
|
+
// Set missing renderer strings to default (english) values.
|
|
31
|
+
...UIStrings,
|
|
32
|
+
...options.providedStrings,
|
|
33
|
+
};
|
|
34
|
+
Globals.i18n = options.i18n;
|
|
35
|
+
Globals.reportJson = options.reportJson;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static getUniqueSuffix() {
|
|
39
|
+
return svgSuffix++;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static resetUniqueSuffix() {
|
|
43
|
+
svgSuffix = 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
Globals,
|
|
49
|
+
};
|
|
@@ -26,8 +26,8 @@ import {ElementScreenshotRenderer} from './element-screenshot-renderer.js';
|
|
|
26
26
|
import {I18nFormatter} from './i18n-formatter.js';
|
|
27
27
|
import {PerformanceCategoryRenderer} from './performance-category-renderer.js';
|
|
28
28
|
import {PwaCategoryRenderer} from './pwa-category-renderer.js';
|
|
29
|
-
import {
|
|
30
|
-
|
|
29
|
+
import {ReportUtils} from './report-utils.js';
|
|
30
|
+
import {Globals} from './report-globals.js';
|
|
31
31
|
|
|
32
32
|
export class ReportRenderer {
|
|
33
33
|
/**
|
|
@@ -67,7 +67,7 @@ export class ReportRenderer {
|
|
|
67
67
|
|
|
68
68
|
this._dom.setLighthouseChannel(lhr.configSettings.channel || 'unknown');
|
|
69
69
|
|
|
70
|
-
const report =
|
|
70
|
+
const report = ReportUtils.prepareReportResult(lhr);
|
|
71
71
|
|
|
72
72
|
this._dom.rootEl.textContent = ''; // Remove previous report.
|
|
73
73
|
this._dom.rootEl.append(this._renderReport(report));
|
|
@@ -108,7 +108,7 @@ export class ReportRenderer {
|
|
|
108
108
|
|
|
109
109
|
this._renderMetaBlock(report, footer);
|
|
110
110
|
|
|
111
|
-
this._dom.find('.lh-footer__version_issue', footer).textContent =
|
|
111
|
+
this._dom.find('.lh-footer__version_issue', footer).textContent = Globals.strings.footerIssue;
|
|
112
112
|
this._dom.find('.lh-footer__version', footer).textContent = report.lighthouseVersion;
|
|
113
113
|
return footer;
|
|
114
114
|
}
|
|
@@ -118,7 +118,7 @@ export class ReportRenderer {
|
|
|
118
118
|
* @param {DocumentFragment} footer
|
|
119
119
|
*/
|
|
120
120
|
_renderMetaBlock(report, footer) {
|
|
121
|
-
const envValues =
|
|
121
|
+
const envValues = ReportUtils.getEmulationDescriptions(report.configSettings || {});
|
|
122
122
|
const match = report.userAgent.match(/(\w*Chrome\/[\d.]+)/); // \w* to include 'HeadlessChrome'
|
|
123
123
|
const chromeVer = Array.isArray(match)
|
|
124
124
|
? match[1].replace('/', ' ').replace('Chrome', 'Chromium')
|
|
@@ -128,35 +128,35 @@ export class ReportRenderer {
|
|
|
128
128
|
const axeVersion = report.environment.credits?.['axe-core'];
|
|
129
129
|
|
|
130
130
|
const devicesTooltipTextLines = [
|
|
131
|
-
`${
|
|
132
|
-
`${
|
|
131
|
+
`${Globals.strings.runtimeSettingsBenchmark}: ${benchmarkIndex}`,
|
|
132
|
+
`${Globals.strings.runtimeSettingsCPUThrottling}: ${envValues.cpuThrottling}`,
|
|
133
133
|
];
|
|
134
134
|
if (envValues.screenEmulation) {
|
|
135
135
|
devicesTooltipTextLines.push(
|
|
136
|
-
`${
|
|
136
|
+
`${Globals.strings.runtimeSettingsScreenEmulation}: ${envValues.screenEmulation}`);
|
|
137
137
|
}
|
|
138
138
|
if (axeVersion) {
|
|
139
|
-
devicesTooltipTextLines.push(`${
|
|
139
|
+
devicesTooltipTextLines.push(`${Globals.strings.runtimeSettingsAxeVersion}: ${axeVersion}`);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// [CSS icon class, textContent, tooltipText]
|
|
143
143
|
const metaItems = [
|
|
144
144
|
['date',
|
|
145
|
-
`Captured at ${
|
|
145
|
+
`Captured at ${Globals.i18n.formatDateTime(report.fetchTime)}`],
|
|
146
146
|
['devices',
|
|
147
147
|
`${envValues.deviceEmulation} with Lighthouse ${report.lighthouseVersion}`,
|
|
148
148
|
devicesTooltipTextLines.join('\n')],
|
|
149
149
|
['samples-one',
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
Globals.strings.runtimeSingleLoad,
|
|
151
|
+
Globals.strings.runtimeSingleLoadTooltip],
|
|
152
152
|
['stopwatch',
|
|
153
|
-
|
|
153
|
+
Globals.strings.runtimeAnalysisWindow],
|
|
154
154
|
['networkspeed',
|
|
155
155
|
`${envValues.summary}`,
|
|
156
|
-
`${
|
|
156
|
+
`${Globals.strings.runtimeSettingsNetworkThrottling}: ${envValues.networkThrottling}`],
|
|
157
157
|
['chrome',
|
|
158
158
|
`Using ${chromeVer}` + (channel ? ` with ${channel}` : ''),
|
|
159
|
-
`${
|
|
159
|
+
`${Globals.strings.runtimeSettingsUANetwork}: "${report.environment.networkUserAgent}"`],
|
|
160
160
|
];
|
|
161
161
|
|
|
162
162
|
const metaItemsEl = this._dom.find('.lh-meta__items', footer);
|
|
@@ -184,7 +184,7 @@ export class ReportRenderer {
|
|
|
184
184
|
|
|
185
185
|
const container = this._dom.createComponent('warningsToplevel');
|
|
186
186
|
const message = this._dom.find('.lh-warnings__msg', container);
|
|
187
|
-
message.textContent =
|
|
187
|
+
message.textContent = Globals.strings.toplevelWarningsMessage;
|
|
188
188
|
|
|
189
189
|
const warnings = [];
|
|
190
190
|
for (const warningString of report.runWarnings) {
|
|
@@ -238,7 +238,7 @@ export class ReportRenderer {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
|
|
241
|
-
if (
|
|
241
|
+
if (ReportUtils.isPluginCategory(category.id)) {
|
|
242
242
|
pluginGauges.push(categoryGauge);
|
|
243
243
|
} else if (renderer.renderCategoryScore === categoryRenderer.renderCategoryScore) {
|
|
244
244
|
// The renderer for default categories is just the default CategoryRenderer.
|
|
@@ -260,9 +260,11 @@ export class ReportRenderer {
|
|
|
260
260
|
* @return {!DocumentFragment}
|
|
261
261
|
*/
|
|
262
262
|
_renderReport(report) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
Globals.apply({
|
|
264
|
+
providedStrings: report.i18n.rendererFormattedStrings,
|
|
265
|
+
i18n: new I18nFormatter(report.configSettings.locale),
|
|
266
|
+
reportJson: report,
|
|
267
|
+
});
|
|
266
268
|
|
|
267
269
|
const detailsRenderer = new DetailsRenderer(this._dom, {
|
|
268
270
|
fullPageScreenshot: report.fullPageScreenshot ?? undefined,
|
|
@@ -26,8 +26,9 @@ import {ElementScreenshotRenderer} from './element-screenshot-renderer.js';
|
|
|
26
26
|
import {toggleDarkTheme} from './features-util.js';
|
|
27
27
|
import {openTreemap} from './open-tab.js';
|
|
28
28
|
import {TopbarFeatures} from './topbar-features.js';
|
|
29
|
-
import {Util} from '
|
|
29
|
+
import {Util} from '../../shared/util.js';
|
|
30
30
|
import {getLhrFilenamePrefix} from '../generator/file-namer.js';
|
|
31
|
+
import {Globals} from './report-globals.js';
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* @param {HTMLTableElement} tableEl
|
|
@@ -106,7 +107,7 @@ export class ReportUIFeatures {
|
|
|
106
107
|
this.json.audits['script-treemap-data'] && this.json.audits['script-treemap-data'].details;
|
|
107
108
|
if (showTreemapApp) {
|
|
108
109
|
this.addButton({
|
|
109
|
-
text:
|
|
110
|
+
text: Globals.strings.viewTreemapLabel,
|
|
110
111
|
icon: 'treemap',
|
|
111
112
|
onClick: () => openTreemap(this.json),
|
|
112
113
|
});
|
|
@@ -115,8 +116,8 @@ export class ReportUIFeatures {
|
|
|
115
116
|
if (this._opts.onViewTrace) {
|
|
116
117
|
this.addButton({
|
|
117
118
|
text: lhr.configSettings.throttlingMethod === 'simulate' ?
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
Globals.strings.viewOriginalTraceLabel :
|
|
120
|
+
Globals.strings.viewTraceLabel,
|
|
120
121
|
onClick: () => this._opts.onViewTrace?.(),
|
|
121
122
|
});
|
|
122
123
|
}
|
|
@@ -127,11 +128,11 @@ export class ReportUIFeatures {
|
|
|
127
128
|
|
|
128
129
|
// Fill in all i18n data.
|
|
129
130
|
for (const node of this._dom.findAll('[data-i18n]', this._dom.rootEl)) {
|
|
130
|
-
// These strings are guaranteed to (at least) have a default English string in
|
|
131
|
+
// These strings are guaranteed to (at least) have a default English string in UIStrings,
|
|
131
132
|
// so this cannot be undefined as long as `report-ui-features.data-i18n` test passes.
|
|
132
133
|
const i18nKey = node.getAttribute('data-i18n');
|
|
133
|
-
const i18nAttr = /** @type {keyof typeof
|
|
134
|
-
node.textContent =
|
|
134
|
+
const i18nAttr = /** @type {keyof typeof Globals.strings} */ (i18nKey);
|
|
135
|
+
node.textContent = Globals.strings[i18nAttr];
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -273,7 +274,7 @@ export class ReportUIFeatures {
|
|
|
273
274
|
this._dom.find('.lh-3p-filter-count', filterTemplate).textContent =
|
|
274
275
|
`${thirdPartyRows.length}`;
|
|
275
276
|
this._dom.find('.lh-3p-ui-string', filterTemplate).textContent =
|
|
276
|
-
|
|
277
|
+
Globals.strings.thirdPartyResourcesLabel;
|
|
277
278
|
|
|
278
279
|
const allThirdParty = thirdPartyRows.length === rowEls.length;
|
|
279
280
|
const allFirstParty = !thirdPartyRows.length;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export class ReportUtils {
|
|
2
|
+
/**
|
|
3
|
+
* Returns a new LHR that's reshaped for slightly better ergonomics within the report rendereer.
|
|
4
|
+
* Also, sets up the localized UI strings used within renderer and makes changes to old LHRs to be
|
|
5
|
+
* compatible with current renderer.
|
|
6
|
+
* The LHR passed in is not mutated.
|
|
7
|
+
* TODO(team): we all agree the LHR shape change is technical debt we should fix
|
|
8
|
+
* @param {LH.Result} result
|
|
9
|
+
* @return {LH.ReportResult}
|
|
10
|
+
*/
|
|
11
|
+
static prepareReportResult(result: LH.Result): LH.ReportResult;
|
|
12
|
+
/**
|
|
13
|
+
* @param {LH.Result['configSettings']} settings
|
|
14
|
+
* @return {!{deviceEmulation: string, screenEmulation?: string, networkThrottling: string, cpuThrottling: string, summary: string}}
|
|
15
|
+
*/
|
|
16
|
+
static getEmulationDescriptions(settings: LH.Result['configSettings']): {
|
|
17
|
+
deviceEmulation: string;
|
|
18
|
+
screenEmulation?: string | undefined;
|
|
19
|
+
networkThrottling: string;
|
|
20
|
+
cpuThrottling: string;
|
|
21
|
+
summary: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Used to determine if the "passed" for the purposes of showing up in the "failed" or "passed"
|
|
25
|
+
* sections of the report.
|
|
26
|
+
*
|
|
27
|
+
* @param {{score: (number|null), scoreDisplayMode: string}} audit
|
|
28
|
+
* @return {boolean}
|
|
29
|
+
*/
|
|
30
|
+
static showAsPassed(audit: {
|
|
31
|
+
score: (number | null);
|
|
32
|
+
scoreDisplayMode: string;
|
|
33
|
+
}): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Convert a score to a rating label.
|
|
36
|
+
* TODO: Return `'error'` for `score === null && !scoreDisplayMode`.
|
|
37
|
+
*
|
|
38
|
+
* @param {number|null} score
|
|
39
|
+
* @param {string=} scoreDisplayMode
|
|
40
|
+
* @return {string}
|
|
41
|
+
*/
|
|
42
|
+
static calculateRating(score: number | null, scoreDisplayMode?: string | undefined): string;
|
|
43
|
+
/**
|
|
44
|
+
* @param {LH.ReportResult.Category} category
|
|
45
|
+
*/
|
|
46
|
+
static calculateCategoryFraction(category: LH.ReportResult.Category): {
|
|
47
|
+
numPassed: number;
|
|
48
|
+
numPassableAudits: number;
|
|
49
|
+
numInformative: number;
|
|
50
|
+
totalWeight: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} categoryId
|
|
54
|
+
*/
|
|
55
|
+
static isPluginCategory(categoryId: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @param {LH.Result.GatherMode} gatherMode
|
|
58
|
+
*/
|
|
59
|
+
static shouldDisplayAsFraction(gatherMode: LH.Result.GatherMode): boolean;
|
|
60
|
+
}
|
|
61
|
+
export namespace UIStrings {
|
|
62
|
+
const varianceDisclaimer: string;
|
|
63
|
+
const calculatorLink: string;
|
|
64
|
+
const showRelevantAudits: string;
|
|
65
|
+
const opportunityResourceColumnLabel: string;
|
|
66
|
+
const opportunitySavingsColumnLabel: string;
|
|
67
|
+
const errorMissingAuditInfo: string;
|
|
68
|
+
const errorLabel: string;
|
|
69
|
+
const warningHeader: string;
|
|
70
|
+
const warningAuditsGroupTitle: string;
|
|
71
|
+
const passedAuditsGroupTitle: string;
|
|
72
|
+
const notApplicableAuditsGroupTitle: string;
|
|
73
|
+
const manualAuditsGroupTitle: string;
|
|
74
|
+
const toplevelWarningsMessage: string;
|
|
75
|
+
const crcInitialNavigation: string;
|
|
76
|
+
const crcLongestDurationLabel: string;
|
|
77
|
+
const snippetExpandButtonLabel: string;
|
|
78
|
+
const snippetCollapseButtonLabel: string;
|
|
79
|
+
const lsPerformanceCategoryDescription: string;
|
|
80
|
+
const labDataTitle: string;
|
|
81
|
+
const thirdPartyResourcesLabel: string;
|
|
82
|
+
const viewTreemapLabel: string;
|
|
83
|
+
const viewTraceLabel: string;
|
|
84
|
+
const viewOriginalTraceLabel: string;
|
|
85
|
+
const dropdownPrintSummary: string;
|
|
86
|
+
const dropdownPrintExpanded: string;
|
|
87
|
+
const dropdownCopyJSON: string;
|
|
88
|
+
const dropdownSaveHTML: string;
|
|
89
|
+
const dropdownSaveJSON: string;
|
|
90
|
+
const dropdownViewer: string;
|
|
91
|
+
const dropdownSaveGist: string;
|
|
92
|
+
const dropdownDarkTheme: string;
|
|
93
|
+
const runtimeSettingsDevice: string;
|
|
94
|
+
const runtimeSettingsNetworkThrottling: string;
|
|
95
|
+
const runtimeSettingsCPUThrottling: string;
|
|
96
|
+
const runtimeSettingsUANetwork: string;
|
|
97
|
+
const runtimeSettingsBenchmark: string;
|
|
98
|
+
const runtimeSettingsAxeVersion: string;
|
|
99
|
+
const runtimeSettingsScreenEmulation: string;
|
|
100
|
+
const footerIssue: string;
|
|
101
|
+
const runtimeNoEmulation: string;
|
|
102
|
+
const runtimeMobileEmulation: string;
|
|
103
|
+
const runtimeDesktopEmulation: string;
|
|
104
|
+
const runtimeUnknown: string;
|
|
105
|
+
const runtimeSingleLoad: string;
|
|
106
|
+
const runtimeAnalysisWindow: string;
|
|
107
|
+
const runtimeSingleLoadTooltip: string;
|
|
108
|
+
const throttlingProvided: string;
|
|
109
|
+
const show: string;
|
|
110
|
+
const hide: string;
|
|
111
|
+
const expandView: string;
|
|
112
|
+
const collapseView: string;
|
|
113
|
+
const runtimeSlow4g: string;
|
|
114
|
+
const runtimeCustom: string;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=report-utils.d.ts.map
|