Skip to content

Adds baseline status to html elements and attributes #202

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

Merged
merged 1 commit into from
Apr 23, 2025
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
33 changes: 32 additions & 1 deletion docs/customData.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,38 @@
"items": {
"$ref": "#/definitions/references"
}
}
},
"browsers": {
"type": "array",
"description": "Supported browsers",
"items": {
"type": "string",
"pattern": "(E|FFA|FF|SM|S|CA|C|IE|O)([\\d|\\.]+)?",
"patternErrorMessage": "Browser item must follow the format of `${browser}${version}`. `browser` is one of:\n- E: Edge\n- FF: Firefox\n- FM: Firefox Android\n- S: Safari\n- SM: Safari on iOS\n- C: Chrome\n- CM: Chrome on Android\n- IE: Internet Explorer\n- O: Opera"
}
},
"baseline": {
"type": "object",
"description": "Baseline information for the feature",
"properties": {
"status": {
"type": "string",
"description": "Baseline status",
"enum": ["high", "low", "false"]
},
"baseline_low_date": {
"type": "string",
"description": "Date when the feature became newly supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
},
"baseline_high_date": {
"type": "string",
"description": "Date when the feature became widely supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
}
}
}
}
},
Expand Down
16 changes: 15 additions & 1 deletion src/htmlLanguageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export interface ITagData {
description?: string | MarkupContent;
attributes: IAttributeData[];
references?: IReference[];
void?: boolean
void?: boolean;
browsers?: string[];
status?: BaselineStatus;
}

export interface IAttributeData {
Expand All @@ -169,12 +171,16 @@ export interface IAttributeData {
valueSet?: string;
values?: IValueData[];
references?: IReference[];
browsers?: string[];
status?: BaselineStatus;
}

export interface IValueData {
name: string;
description?: string | MarkupContent;
references?: IReference[];
browsers?: string[];
status?: BaselineStatus;
}

export interface IValueSet {
Expand All @@ -189,6 +195,14 @@ export interface HTMLDataV1 {
valueSets?: IValueSet[];
}

export interface BaselineStatus {
baseline: Baseline;
baseline_low_date?: string;
baseline_high_date?: string;
}

export type Baseline = false | 'low' | 'high';

export interface IHTMLDataProvider {
getId(): string;
isApplicable(languageId: string): boolean;
Expand Down
Loading