Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(audit): add jsdoc descriptions to the audit meta properties #5567

Merged
merged 1 commit into from
Jun 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions typings/audit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ declare global {
export type DisplayValue = string | DisplayValueArray;

export interface Meta {
/** The string identifier of the audit, in kebab case. */
id: string;
/** Short, user-visible title for the audit when successful. */
title: string;
/** Short, user-visible title for the audit when failing. */
failureTitle?: string;
/** Explanation of why the user should care about the audit. */
description: string;
/** A list of the members of LH.Artifacts that must be present for the audit to execute. */
requiredArtifacts: Array<keyof Artifacts>;
/** A string identifying how the score should be interpreted for display. */
scoreDisplayMode?: Audit.ScoreDisplayMode;
}

Expand Down Expand Up @@ -121,9 +127,21 @@ declare global {
errorMessage?: string;
warnings?: string[];
score: number|null;
/**
* A string identifying how the score should be interpreted:
* 'binary': pass/fail audit (0 and 1 are only possible scores).
* 'numeric': scores of 0-1 (map to displayed scores of 0-100).
* 'informative': the audit is an FYI only, and can't be interpreted as pass/fail. Score is null and should be ignored.
* 'not-applicable': the audit turned out to not apply to the page. Score is null and should be ignored.
* 'manual': The audit exists only to tell you to review something yourself. Score is null and should be ignored.
* 'error': There was an error while running the audit (check `errorMessage` for details). Score is null and should be ignored.
*/
scoreDisplayMode: ScoreDisplayMode;
/** Short, user-visible title for the audit. The text can change depending on if the audit passed or failed. */
title: string;
/** The string identifier of the audit, in kebab case. */
id: string;
/** A more detailed description that describes why the audit is important and links to Lighthouse documentation on the audit; markdown links supported. */
description: string;
// TODO(bckenny): define details
details?: any;
Expand Down