-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
AuditResult.js
167 lines (128 loc) · 3.92 KB
/
AuditResult.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
* @license
* Copyright 2016 Google Inc. All rights reserved.
*
* 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
*
* 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.
*/
/**
* Typing externs file for the result of an audit.
* @externs
*/
/**
* @struct
* @record
*/
function AuditResult() {}
/**
* The only required value in an audit result. Used as the `score` if no score
* is provided.
* @type {(boolean|number)}
*/
AuditResult.prototype.rawValue;
/** @type {(boolean|number|undefined)} */
AuditResult.prototype.score;
/** @type {(string|undefined)} */
AuditResult.prototype.displayValue;
/**
* Optional error string for helping the user figure out why they failed here.
* @type {(string|undefined)}
*/
AuditResult.prototype.debugString;
/** @type {(boolean|number|string|undefined|null)} */
AuditResult.prototype.optimalValue;
/** @type {(AuditExtendedInfo|undefined|null)} */
AuditResult.prototype.extendedInfo;
/** @type {(Object|undefined)} */
AuditResult.prototype.details;
/**
* The full audit result as generated by Audit.generateAuditResult from an
* AuditResult. See Config.assertValidAudit for audit required meta fields.
* @struct
* @record
*/
function AuditFullResult() {}
/** @type {(boolean|number)} */
AuditFullResult.prototype.score;
/** @type {string} */
AuditFullResult.prototype.scoringMode;
/** @type {string} */
AuditFullResult.prototype.displayValue;
/** @type {(boolean|number)} */
AuditFullResult.prototype.rawValue;
/**
* Optional property indicating that some error occurred either in generating an
* artifact required by this audit or within the audit itself and so the audit
* is un-scoreable. Audits can create an error by simply throwing an exception.
* @type {(boolean|undefined)}
*/
AuditFullResult.prototype.error;
/** @type {(string|undefined)} */
AuditFullResult.prototype.debugString;
/** @type {(boolean|number|string|undefined|null)} */
AuditFullResult.prototype.optimalValue;
/** @type {(AuditExtendedInfo|undefined|null)} */
AuditFullResult.prototype.extendedInfo;
/** @type {string} */
AuditFullResult.prototype.name;
/** @type {string} */
AuditFullResult.prototype.category;
/** @type {string} */
AuditFullResult.prototype.description;
/** @type {string} */
AuditFullResult.prototype.helpText;
/** @type {(Object|undefined)} */
AuditFullResult.prototype.details;
/**
* @struct
* @record
*/
function AuditExtendedInfo() {}
/** @type {string} */
AuditExtendedInfo.prototype.formatter;
/** @type {(Object|Array<UserTimingsExtendedInfo>|FirstMeaningfulPaintExtendedInfo|undefined)} */
AuditExtendedInfo.prototype.value;
/**
* @struct
* @record
*/
function UserTimingsExtendedInfo() {}
/** @type {!string} */
UserTimingsExtendedInfo.prototype.name;
/** @type {!boolean} */
UserTimingsExtendedInfo.prototype.isMark;
/** @type {!Object} */
UserTimingsExtendedInfo.prototype.args;
/** @type {!number} */
UserTimingsExtendedInfo.prototype.startTime;
/** @type {(number|undefined)} */
UserTimingsExtendedInfo.prototype.endTime;
/** @type {(number|undefined)} */
UserTimingsExtendedInfo.prototype.duration;
/**
* @struct
* @record
*/
function FirstMeaningfulPaintExtendedInfo() {}
/** @type {!FirstMeaningfulPaintTimings} */
FirstMeaningfulPaintExtendedInfo.prototype.timings;
/**
* @struct
* @record
*/
function FirstMeaningfulPaintTimings() {}
/** @type {number} */
FirstMeaningfulPaintTimings.prototype.fCP;
/** @type {number} */
FirstMeaningfulPaintTimings.prototype.fMP;
/** @type {number} */
FirstMeaningfulPaintTimings.prototype.navStart;