lighthouse 9.5.0-dev.20230123 → 9.5.0-dev.20230124
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/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/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/resource-summary.d.ts +4 -2
- package/core/computed/resource-summary.js +8 -5
- package/core/lib/url-utils.js +1 -1
- package/core/runner.d.ts +10 -0
- package/core/runner.js +48 -0
- package/core/util.cjs +1 -1
- 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 +4 -4
- 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 +54 -54
- package/shared/localization/locales/en-XA.json +50 -50
- package/shared/localization/locales/en-XL.json +54 -54
- 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/types/artifacts.d.ts +14 -0
- package/types/lhr/lhr.d.ts +33 -0
- package/report/renderer/util.d.ts +0 -342
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
export type I18nFormatter = import('./i18n-formatter').I18nFormatter;
|
|
2
|
-
export class Util {
|
|
3
|
-
/** @type {I18nFormatter} */
|
|
4
|
-
static i18n: I18nFormatter;
|
|
5
|
-
static strings: {
|
|
6
|
-
/** Disclaimer shown to users below the metric values (First Contentful Paint, Time to Interactive, etc) to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. */
|
|
7
|
-
varianceDisclaimer: string;
|
|
8
|
-
/** Text link pointing to an interactive calculator that explains Lighthouse scoring. The link text should be fairly short. */
|
|
9
|
-
calculatorLink: string;
|
|
10
|
-
/** Label preceding a radio control for filtering the list of audits. The radio choices are various performance metrics (FCP, LCP, TBT), and if chosen, the audits in the report are hidden if they are not relevant to the selected metric. */
|
|
11
|
-
showRelevantAudits: string;
|
|
12
|
-
/** Column heading label for the listing of opportunity audits. Each audit title represents an opportunity. There are only 2 columns, so no strict character limit. */
|
|
13
|
-
opportunityResourceColumnLabel: string;
|
|
14
|
-
/** Column heading label for the estimated page load savings of opportunity audits. Estimated Savings is the total amount of time (in seconds) that Lighthouse computed could be reduced from the total page load time, if the suggested action is taken. There are only 2 columns, so no strict character limit. */
|
|
15
|
-
opportunitySavingsColumnLabel: string;
|
|
16
|
-
/** An error string displayed next to a particular audit when it has errored, but not provided any specific error message. */
|
|
17
|
-
errorMissingAuditInfo: string;
|
|
18
|
-
/** A label, shown next to an audit title or metric title, indicating that there was an error computing it. The user can hover on the label to reveal a tooltip with the extended error message. Translation should be short (< 20 characters). */
|
|
19
|
-
errorLabel: string;
|
|
20
|
-
/** This label is shown above a bulleted list of warnings. It is shown directly below an audit that produced warnings. Warnings describe situations the user should be aware of, as Lighthouse was unable to complete all the work required on this audit. For example, The 'Unable to decode image (biglogo.jpg)' warning may show up below an image encoding audit. */
|
|
21
|
-
warningHeader: string;
|
|
22
|
-
/** Section heading shown above a list of passed audits that contain warnings. Audits under this section do not negatively impact the score, but Lighthouse has generated some potentially actionable suggestions that should be reviewed. This section is expanded by default and displays after the failing audits. */
|
|
23
|
-
warningAuditsGroupTitle: string;
|
|
24
|
-
/** Section heading shown above a list of audits that are passing. 'Passed' here refers to a passing grade. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
|
|
25
|
-
passedAuditsGroupTitle: string;
|
|
26
|
-
/** Section heading shown above a list of audits that do not apply to the page. For example, if an audit is 'Are images optimized?', but the page has no images on it, the audit will be marked as not applicable. This is neither passing or failing. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
|
|
27
|
-
notApplicableAuditsGroupTitle: string;
|
|
28
|
-
/** Section heading shown above a list of audits that were not computed by Lighthouse. They serve as a list of suggestions for the user to go and manually check. For example, Lighthouse can't automate testing cross-browser compatibility, so that is listed within this section, so the user is reminded to test it themselves. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
|
|
29
|
-
manualAuditsGroupTitle: string;
|
|
30
|
-
/** Label shown preceding any important warnings that may have invalidated the entire report. For example, if the user has Chrome extensions installed, they may add enough performance overhead that Lighthouse's performance metrics are unreliable. If shown, this will be displayed at the top of the report UI. */
|
|
31
|
-
toplevelWarningsMessage: string;
|
|
32
|
-
/** String of text shown in a graphical representation of the flow of network requests for the web page. This label represents the initial network request that fetches an HTML page. This navigation may be redirected (eg. Initial navigation to http://example.com redirects to https://www.example.com). */
|
|
33
|
-
crcInitialNavigation: string;
|
|
34
|
-
/** Label of value shown in the summary of critical request chains. Refers to the total amount of time (milliseconds) of the longest critical path chain/sequence of network requests. Example value: 2310 ms */
|
|
35
|
-
crcLongestDurationLabel: string;
|
|
36
|
-
/** Label for button that shows all lines of the snippet when clicked */
|
|
37
|
-
snippetExpandButtonLabel: string;
|
|
38
|
-
/** Label for button that only shows a few lines of the snippet when clicked */
|
|
39
|
-
snippetCollapseButtonLabel: string;
|
|
40
|
-
/** Explanation shown to users below performance results to inform them that the test was done with a 4G network connection and to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. 'Lighthouse' becomes link text to additional documentation. */
|
|
41
|
-
lsPerformanceCategoryDescription: string;
|
|
42
|
-
/** Title of the lab data section of the Performance category. Within this section are various speed metrics which quantify the pageload performance into values presented in seconds and milliseconds. "Lab" is an abbreviated form of "laboratory", and refers to the fact that the data is from a controlled test of a website, not measurements from real users visiting that site. */
|
|
43
|
-
labDataTitle: string;
|
|
44
|
-
/** This label is for a checkbox above a table of items loaded by a web page. The checkbox is used to show or hide third-party (or "3rd-party") resources in the table, where "third-party resources" refers to items loaded by a web page from URLs that aren't controlled by the owner of the web page. */
|
|
45
|
-
thirdPartyResourcesLabel: string;
|
|
46
|
-
/** This label is for a button that opens a new tab to a webapp called "Treemap", which is a nested visual representation of a heierarchy of data related to the reports (script bytes and coverage, resource breakdown, etc.) */
|
|
47
|
-
viewTreemapLabel: string;
|
|
48
|
-
/** This label is for a button that will show the user a trace of the page. */
|
|
49
|
-
viewTraceLabel: string;
|
|
50
|
-
/** This label is for a button that will show the user a trace of the page. */
|
|
51
|
-
viewOriginalTraceLabel: string;
|
|
52
|
-
/** Option in a dropdown menu that opens a small, summary report in a print dialog. */
|
|
53
|
-
dropdownPrintSummary: string;
|
|
54
|
-
/** Option in a dropdown menu that opens a full Lighthouse report in a print dialog. */
|
|
55
|
-
dropdownPrintExpanded: string;
|
|
56
|
-
/** Option in a dropdown menu that copies the Lighthouse JSON object to the system clipboard. */
|
|
57
|
-
dropdownCopyJSON: string;
|
|
58
|
-
/** Option in a dropdown menu that saves the Lighthouse report HTML locally to the system as a '.html' file. */
|
|
59
|
-
dropdownSaveHTML: string;
|
|
60
|
-
/** Option in a dropdown menu that saves the Lighthouse JSON object to the local system as a '.json' file. */
|
|
61
|
-
dropdownSaveJSON: string;
|
|
62
|
-
/** Option in a dropdown menu that opens the current report in the Lighthouse Viewer Application. */
|
|
63
|
-
dropdownViewer: string;
|
|
64
|
-
/** Option in a dropdown menu that saves the current report as a new GitHub Gist. */
|
|
65
|
-
dropdownSaveGist: string;
|
|
66
|
-
/** Option in a dropdown menu that toggles the themeing of the report between Light(default) and Dark themes. */
|
|
67
|
-
dropdownDarkTheme: string;
|
|
68
|
-
/** Label for a row in a table that describes the kind of device that was emulated for the Lighthouse run. Example values for row elements: 'No Emulation', 'Emulated Desktop', etc. */
|
|
69
|
-
runtimeSettingsDevice: string;
|
|
70
|
-
/** Label for a row in a table that describes the network throttling conditions that were used during a Lighthouse run, if any. */
|
|
71
|
-
runtimeSettingsNetworkThrottling: string;
|
|
72
|
-
/** Label for a row in a table that describes the CPU throttling conditions that were used during a Lighthouse run, if any.*/
|
|
73
|
-
runtimeSettingsCPUThrottling: string;
|
|
74
|
-
/** Label for a row in a table that shows the User Agent that was used to send out all network requests during the Lighthouse run. */
|
|
75
|
-
runtimeSettingsUANetwork: string;
|
|
76
|
-
/** Label for a row in a table that shows the estimated CPU power of the machine running Lighthouse. Example row values: 532, 1492, 783. */
|
|
77
|
-
runtimeSettingsBenchmark: string;
|
|
78
|
-
/** Label for a row in a table that shows the version of the Axe library used. Example row values: 2.1.0, 3.2.3 */
|
|
79
|
-
runtimeSettingsAxeVersion: string;
|
|
80
|
-
/** Label for a row in a table that shows the screen resolution and DPR that was emulated for the Lighthouse run. Example values: '800x600, DPR: 3' */
|
|
81
|
-
runtimeSettingsScreenEmulation: string;
|
|
82
|
-
/** Label for button to create an issue against the Lighthouse GitHub project. */
|
|
83
|
-
footerIssue: string;
|
|
84
|
-
/** Descriptive explanation for emulation setting when no device emulation is set. */
|
|
85
|
-
runtimeNoEmulation: string;
|
|
86
|
-
/** Descriptive explanation for emulation setting when emulating a Moto G4 mobile device. */
|
|
87
|
-
runtimeMobileEmulation: string;
|
|
88
|
-
/** Descriptive explanation for emulation setting when emulating a generic desktop form factor, as opposed to a mobile-device like form factor. */
|
|
89
|
-
runtimeDesktopEmulation: string;
|
|
90
|
-
/** Descriptive explanation for a runtime setting that is set to an unknown value. */
|
|
91
|
-
runtimeUnknown: string;
|
|
92
|
-
/** Descriptive label that this analysis run was from a single pageload of a browser (not a summary of hundreds of loads) */
|
|
93
|
-
runtimeSingleLoad: string;
|
|
94
|
-
/** Descriptive label that this analysis only considers the initial load of the page, and no interaction beyond when the page had "fully loaded" */
|
|
95
|
-
runtimeAnalysisWindow: string;
|
|
96
|
-
/** Descriptive explanation that this analysis run was from a single pageload of a browser, whereas field data often summarizes hundreds+ of page loads */
|
|
97
|
-
runtimeSingleLoadTooltip: string;
|
|
98
|
-
/** Descriptive explanation for environment throttling that was provided by the runtime environment instead of provided by Lighthouse throttling. */
|
|
99
|
-
throttlingProvided: string;
|
|
100
|
-
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
|
|
101
|
-
show: string;
|
|
102
|
-
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
|
|
103
|
-
hide: string;
|
|
104
|
-
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
|
|
105
|
-
expandView: string;
|
|
106
|
-
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
|
|
107
|
-
collapseView: string;
|
|
108
|
-
/** Label indicating that Lighthouse throttled the page to emulate a slow 4G network connection. */
|
|
109
|
-
runtimeSlow4g: string;
|
|
110
|
-
/** Label indicating that Lighthouse throttled the page using custom throttling settings. */
|
|
111
|
-
runtimeCustom: string;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* @param {Record<string, string>} providedStrings
|
|
115
|
-
*/
|
|
116
|
-
static applyStrings(providedStrings: Record<string, string>): void;
|
|
117
|
-
static get PASS_THRESHOLD(): number;
|
|
118
|
-
static get MS_DISPLAY_VALUE(): string;
|
|
119
|
-
/**
|
|
120
|
-
* If LHR is older than 10.0 it will not have the `finalDisplayedUrl` property.
|
|
121
|
-
* Old LHRs should have the `finalUrl` property which will work fine for the report.
|
|
122
|
-
*
|
|
123
|
-
* @param {LH.Result} lhr
|
|
124
|
-
*/
|
|
125
|
-
static getFinalDisplayedUrl(lhr: LH.Result): string;
|
|
126
|
-
/**
|
|
127
|
-
* If LHR is older than 10.0 it will not have the `mainDocumentUrl` property.
|
|
128
|
-
* Old LHRs should have the `finalUrl` property which is the same as `mainDocumentUrl`.
|
|
129
|
-
*
|
|
130
|
-
* @param {LH.Result} lhr
|
|
131
|
-
*/
|
|
132
|
-
static getMainDocumentUrl(lhr: LH.Result): string | undefined;
|
|
133
|
-
/**
|
|
134
|
-
* Returns a new LHR that's reshaped for slightly better ergonomics within the report rendereer.
|
|
135
|
-
* Also, sets up the localized UI strings used within renderer and makes changes to old LHRs to be
|
|
136
|
-
* compatible with current renderer.
|
|
137
|
-
* The LHR passed in is not mutated.
|
|
138
|
-
* TODO(team): we all agree the LHR shape change is technical debt we should fix
|
|
139
|
-
* @param {LH.Result} result
|
|
140
|
-
* @return {LH.ReportResult}
|
|
141
|
-
*/
|
|
142
|
-
static prepareReportResult(result: LH.Result): LH.ReportResult;
|
|
143
|
-
/**
|
|
144
|
-
* @param {LH.Result} lhr
|
|
145
|
-
* @return {LH.Result.FullPageScreenshot=}
|
|
146
|
-
*/
|
|
147
|
-
static getFullPageScreenshot(lhr: LH.Result): LH.Result.FullPageScreenshot | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* Used to determine if the "passed" for the purposes of showing up in the "failed" or "passed"
|
|
150
|
-
* sections of the report.
|
|
151
|
-
*
|
|
152
|
-
* @param {{score: (number|null), scoreDisplayMode: string}} audit
|
|
153
|
-
* @return {boolean}
|
|
154
|
-
*/
|
|
155
|
-
static showAsPassed(audit: {
|
|
156
|
-
score: (number | null);
|
|
157
|
-
scoreDisplayMode: string;
|
|
158
|
-
}): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Convert a score to a rating label.
|
|
161
|
-
* TODO: Return `'error'` for `score === null && !scoreDisplayMode`.
|
|
162
|
-
*
|
|
163
|
-
* @param {number|null} score
|
|
164
|
-
* @param {string=} scoreDisplayMode
|
|
165
|
-
* @return {string}
|
|
166
|
-
*/
|
|
167
|
-
static calculateRating(score: number | null, scoreDisplayMode?: string | undefined): string;
|
|
168
|
-
/**
|
|
169
|
-
* Split a string by markdown code spans (enclosed in `backticks`), splitting
|
|
170
|
-
* into segments that were enclosed in backticks (marked as `isCode === true`)
|
|
171
|
-
* and those that outside the backticks (`isCode === false`).
|
|
172
|
-
* @param {string} text
|
|
173
|
-
* @return {Array<{isCode: true, text: string}|{isCode: false, text: string}>}
|
|
174
|
-
*/
|
|
175
|
-
static splitMarkdownCodeSpans(text: string): Array<{
|
|
176
|
-
isCode: true;
|
|
177
|
-
text: string;
|
|
178
|
-
} | {
|
|
179
|
-
isCode: false;
|
|
180
|
-
text: string;
|
|
181
|
-
}>;
|
|
182
|
-
/**
|
|
183
|
-
* Split a string on markdown links (e.g. [some link](https://...)) into
|
|
184
|
-
* segments of plain text that weren't part of a link (marked as
|
|
185
|
-
* `isLink === false`), and segments with text content and a URL that did make
|
|
186
|
-
* up a link (marked as `isLink === true`).
|
|
187
|
-
* @param {string} text
|
|
188
|
-
* @return {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>}
|
|
189
|
-
*/
|
|
190
|
-
static splitMarkdownLink(text: string): Array<{
|
|
191
|
-
isLink: true;
|
|
192
|
-
text: string;
|
|
193
|
-
linkHref: string;
|
|
194
|
-
} | {
|
|
195
|
-
isLink: false;
|
|
196
|
-
text: string;
|
|
197
|
-
}>;
|
|
198
|
-
/**
|
|
199
|
-
* @param {URL} parsedUrl
|
|
200
|
-
* @param {{numPathParts?: number, preserveQuery?: boolean, preserveHost?: boolean}=} options
|
|
201
|
-
* @return {string}
|
|
202
|
-
*/
|
|
203
|
-
static getURLDisplayName(parsedUrl: URL, options?: {
|
|
204
|
-
numPathParts?: number | undefined;
|
|
205
|
-
preserveQuery?: boolean | undefined;
|
|
206
|
-
preserveHost?: boolean | undefined;
|
|
207
|
-
} | undefined): string;
|
|
208
|
-
/**
|
|
209
|
-
* Split a URL into a file, hostname and origin for easy display.
|
|
210
|
-
* @param {string} url
|
|
211
|
-
* @return {{file: string, hostname: string, origin: string}}
|
|
212
|
-
*/
|
|
213
|
-
static parseURL(url: string): {
|
|
214
|
-
file: string;
|
|
215
|
-
hostname: string;
|
|
216
|
-
origin: string;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* @param {string|URL} value
|
|
220
|
-
* @return {!URL}
|
|
221
|
-
*/
|
|
222
|
-
static createOrReturnURL(value: string | URL): URL;
|
|
223
|
-
/**
|
|
224
|
-
* Gets the tld of a domain
|
|
225
|
-
*
|
|
226
|
-
* @param {string} hostname
|
|
227
|
-
* @return {string} tld
|
|
228
|
-
*/
|
|
229
|
-
static getTld(hostname: string): string;
|
|
230
|
-
/**
|
|
231
|
-
* Returns a primary domain for provided hostname (e.g. www.example.com -> example.com).
|
|
232
|
-
* @param {string|URL} url hostname or URL object
|
|
233
|
-
* @return {string}
|
|
234
|
-
*/
|
|
235
|
-
static getRootDomain(url: string | URL): string;
|
|
236
|
-
/**
|
|
237
|
-
* @param {LH.Result['configSettings']} settings
|
|
238
|
-
* @return {!{deviceEmulation: string, screenEmulation?: string, networkThrottling: string, cpuThrottling: string, summary: string}}
|
|
239
|
-
*/
|
|
240
|
-
static getEmulationDescriptions(settings: LH.Result['configSettings']): {
|
|
241
|
-
deviceEmulation: string;
|
|
242
|
-
screenEmulation?: string | undefined;
|
|
243
|
-
networkThrottling: string;
|
|
244
|
-
cpuThrottling: string;
|
|
245
|
-
summary: string;
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* Returns only lines that are near a message, or the first few lines if there are
|
|
249
|
-
* no line messages.
|
|
250
|
-
* @param {LH.Audit.Details.SnippetValue['lines']} lines
|
|
251
|
-
* @param {LH.Audit.Details.SnippetValue['lineMessages']} lineMessages
|
|
252
|
-
* @param {number} surroundingLineCount Number of lines to include before and after
|
|
253
|
-
* the message. If this is e.g. 2 this function might return 5 lines.
|
|
254
|
-
*/
|
|
255
|
-
static filterRelevantLines(lines: LH.Audit.Details.SnippetValue['lines'], lineMessages: LH.Audit.Details.SnippetValue['lineMessages'], surroundingLineCount: number): {
|
|
256
|
-
content: string;
|
|
257
|
-
lineNumber: number;
|
|
258
|
-
truncated?: boolean | undefined;
|
|
259
|
-
}[];
|
|
260
|
-
/**
|
|
261
|
-
* @param {string} categoryId
|
|
262
|
-
*/
|
|
263
|
-
static isPluginCategory(categoryId: string): boolean;
|
|
264
|
-
/**
|
|
265
|
-
* @param {LH.Result.GatherMode} gatherMode
|
|
266
|
-
*/
|
|
267
|
-
static shouldDisplayAsFraction(gatherMode: LH.Result.GatherMode): boolean;
|
|
268
|
-
/**
|
|
269
|
-
* @param {LH.ReportResult.Category} category
|
|
270
|
-
*/
|
|
271
|
-
static calculateCategoryFraction(category: LH.ReportResult.Category): {
|
|
272
|
-
numPassed: number;
|
|
273
|
-
numPassableAudits: number;
|
|
274
|
-
numInformative: number;
|
|
275
|
-
totalWeight: number;
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
export namespace Util {
|
|
279
|
-
export const reportJson: LH.ReportResult | null;
|
|
280
|
-
/**
|
|
281
|
-
* An always-increasing counter for making unique SVG ID suffixes.
|
|
282
|
-
*/
|
|
283
|
-
export function getUniqueSuffix(): number;
|
|
284
|
-
export function resetUniqueSuffix(): void;
|
|
285
|
-
export { UIStrings };
|
|
286
|
-
}
|
|
287
|
-
export namespace UIStrings {
|
|
288
|
-
const varianceDisclaimer: string;
|
|
289
|
-
const calculatorLink: string;
|
|
290
|
-
const showRelevantAudits: string;
|
|
291
|
-
const opportunityResourceColumnLabel: string;
|
|
292
|
-
const opportunitySavingsColumnLabel: string;
|
|
293
|
-
const errorMissingAuditInfo: string;
|
|
294
|
-
const errorLabel: string;
|
|
295
|
-
const warningHeader: string;
|
|
296
|
-
const warningAuditsGroupTitle: string;
|
|
297
|
-
const passedAuditsGroupTitle: string;
|
|
298
|
-
const notApplicableAuditsGroupTitle: string;
|
|
299
|
-
const manualAuditsGroupTitle: string;
|
|
300
|
-
const toplevelWarningsMessage: string;
|
|
301
|
-
const crcInitialNavigation: string;
|
|
302
|
-
const crcLongestDurationLabel: string;
|
|
303
|
-
const snippetExpandButtonLabel: string;
|
|
304
|
-
const snippetCollapseButtonLabel: string;
|
|
305
|
-
const lsPerformanceCategoryDescription: string;
|
|
306
|
-
const labDataTitle: string;
|
|
307
|
-
const thirdPartyResourcesLabel: string;
|
|
308
|
-
const viewTreemapLabel: string;
|
|
309
|
-
const viewTraceLabel: string;
|
|
310
|
-
const viewOriginalTraceLabel: string;
|
|
311
|
-
const dropdownPrintSummary: string;
|
|
312
|
-
const dropdownPrintExpanded: string;
|
|
313
|
-
const dropdownCopyJSON: string;
|
|
314
|
-
const dropdownSaveHTML: string;
|
|
315
|
-
const dropdownSaveJSON: string;
|
|
316
|
-
const dropdownViewer: string;
|
|
317
|
-
const dropdownSaveGist: string;
|
|
318
|
-
const dropdownDarkTheme: string;
|
|
319
|
-
const runtimeSettingsDevice: string;
|
|
320
|
-
const runtimeSettingsNetworkThrottling: string;
|
|
321
|
-
const runtimeSettingsCPUThrottling: string;
|
|
322
|
-
const runtimeSettingsUANetwork: string;
|
|
323
|
-
const runtimeSettingsBenchmark: string;
|
|
324
|
-
const runtimeSettingsAxeVersion: string;
|
|
325
|
-
const runtimeSettingsScreenEmulation: string;
|
|
326
|
-
const footerIssue: string;
|
|
327
|
-
const runtimeNoEmulation: string;
|
|
328
|
-
const runtimeMobileEmulation: string;
|
|
329
|
-
const runtimeDesktopEmulation: string;
|
|
330
|
-
const runtimeUnknown: string;
|
|
331
|
-
const runtimeSingleLoad: string;
|
|
332
|
-
const runtimeAnalysisWindow: string;
|
|
333
|
-
const runtimeSingleLoadTooltip: string;
|
|
334
|
-
const throttlingProvided: string;
|
|
335
|
-
const show: string;
|
|
336
|
-
const hide: string;
|
|
337
|
-
const expandView: string;
|
|
338
|
-
const collapseView: string;
|
|
339
|
-
const runtimeSlow4g: string;
|
|
340
|
-
const runtimeCustom: string;
|
|
341
|
-
}
|
|
342
|
-
//# sourceMappingURL=util.d.ts.map
|