Skip to content

Commit 31a1168

Browse files
authored
baseline status for html elements and attributes (#202)
1 parent 61bc1c7 commit 31a1168

6 files changed

Lines changed: 6184 additions & 271 deletions

File tree

docs/customData.schema.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,38 @@
164164
"items": {
165165
"$ref": "#/definitions/references"
166166
}
167-
}
167+
},
168+
"browsers": {
169+
"type": "array",
170+
"description": "Supported browsers",
171+
"items": {
172+
"type": "string",
173+
"pattern": "(E|FFA|FF|SM|S|CA|C|IE|O)([\\d|\\.]+)?",
174+
"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"
175+
}
176+
},
177+
"baseline": {
178+
"type": "object",
179+
"description": "Baseline information for the feature",
180+
"properties": {
181+
"status": {
182+
"type": "string",
183+
"description": "Baseline status",
184+
"enum": ["high", "low", "false"]
185+
},
186+
"baseline_low_date": {
187+
"type": "string",
188+
"description": "Date when the feature became newly supported in all major browsers",
189+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
190+
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
191+
},
192+
"baseline_high_date": {
193+
"type": "string",
194+
"description": "Date when the feature became widely supported in all major browsers",
195+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
196+
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
197+
}
198+
}
168199
}
169200
}
170201
},

src/htmlLanguageTypes.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ export interface ITagData {
160160
description?: string | MarkupContent;
161161
attributes: IAttributeData[];
162162
references?: IReference[];
163-
void?: boolean
163+
void?: boolean;
164+
browsers?: string[];
165+
status?: BaselineStatus;
164166
}
165167

166168
export interface IAttributeData {
@@ -169,12 +171,16 @@ export interface IAttributeData {
169171
valueSet?: string;
170172
values?: IValueData[];
171173
references?: IReference[];
174+
browsers?: string[];
175+
status?: BaselineStatus;
172176
}
173177

174178
export interface IValueData {
175179
name: string;
176180
description?: string | MarkupContent;
177181
references?: IReference[];
182+
browsers?: string[];
183+
status?: BaselineStatus;
178184
}
179185

180186
export interface IValueSet {
@@ -189,6 +195,14 @@ export interface HTMLDataV1 {
189195
valueSets?: IValueSet[];
190196
}
191197

198+
export interface BaselineStatus {
199+
baseline: Baseline;
200+
baseline_low_date?: string;
201+
baseline_high_date?: string;
202+
}
203+
204+
export type Baseline = false | 'low' | 'high';
205+
192206
export interface IHTMLDataProvider {
193207
getId(): string;
194208
isApplicable(languageId: string): boolean;

0 commit comments

Comments
 (0)