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

misc: remove lhr-lite.d.ts #7991

Merged
merged 2 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
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
19 changes: 17 additions & 2 deletions types/audit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ declare global {
}

export interface ScoreDisplayModes {
/** Scores of 0-1 (map to displayed scores of 0-100). */
NUMERIC: 'numeric';
/** Pass/fail audit (0 and 1 are only possible scores). */
BINARY: 'binary';
/** The audit exists only to tell you to review something yourself. Score is null and should be ignored. */
MANUAL: 'manual';
/** The audit is an FYI only, and can't be interpreted as pass/fail. Score is null and should be ignored. */
INFORMATIVE: 'informative';
/** The audit turned out to not apply to the page. Score is null and should be ignored. */
NOT_APPLICABLE: 'notApplicable';
/** There was an error while running the audit (check `errorMessage` for details). Score is null and should be ignored. */
ERROR: 'error';
}

Expand All @@ -45,7 +51,7 @@ declare global {
title: string;
/** Short, user-visible title for the audit when failing. */
failureTitle?: string;
/** Explanation of why the user should care about the audit. */
/** A more detailed description that describes why the audit is important and links to Lighthouse documentation on the audit; markdown links supported. */
description: string;
/** A list of the members of LH.Artifacts that must be present for the audit to execute. */
requiredArtifacts: Array<keyof Artifacts>;
Expand All @@ -64,23 +70,31 @@ declare global {
export interface Product {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somewhat unrelated, but instead of duplicating should this Pick<> + extend from Result?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somewhat unrelated, but instead of duplicating should this Pick<> + extend from Result?

yeah, I was thinking about the same thing while doing this, I think it's worth trying to make it work.

rawValue: boolean | number | null;
displayValue?: string;
/** An explanation of why the audit failed on the test page. */
explanation?: string;
/** Error message from any exception thrown while running this audit. */
errorMessage?: string;
warnings?: string[];
/** The scored value of the audit, provided in the range `0-1`, or null if `scoreDisplayMode` indicates not scored. */
score?: number;
/** Deprecated and does not make its way into the Lighthouse report. */
extendedInfo?: {[p: string]: any};
/** Overrides scoreDisplayMode with notApplicable if set to true */
notApplicable?: boolean;
/** Extra information about the page provided by some types of audits, in one of several possible forms that can be rendered in the HTML report. */
details?: Audit.Details;
}

/* Audit result returned in Lighthouse report. All audits offer a description and score of 0-1 */
/* Audit result returned in Lighthouse report. All audits offer a description and score of 0-1. */
export interface Result {
rawValue: boolean | number | null;
displayValue?: string;
/** An explanation of why the audit failed on the test page. */
explanation?: string;
/** Error message from any exception thrown while running this audit. */
errorMessage?: string;
warnings?: string[];
/** The scored value of the audit, provided in the range `0-1`, or null if `scoreDisplayMode` indicates not scored. */
score: number|null;
/**
* A string identifying how the score should be interpreted:
Expand All @@ -98,6 +112,7 @@ declare global {
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;
/** Extra information about the page provided by some types of audits, in one of several possible forms that can be rendered in the HTML report. */
details?: Audit.Details;
}

Expand Down
82 changes: 0 additions & 82 deletions types/lhr-lite.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions types/lhr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ declare global {
/** Descriptions of the groups referenced by CategoryMembers. */
categoryGroups?: Record<string, Result.ReportGroup>;


// Additional non-LHR-lite information.
/** The config settings used for these results. */
configSettings: Config.Settings;
/** List of top-level warnings for this Lighthouse run. */
Expand Down