forked from web-platform-dx/web-features
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
49 lines (43 loc) · 1.71 KB
/
types.ts
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
/** Web platform feature */
export interface FeatureData {
/** Short name */
name: string;
/** Short description of the feature, as a plain text string */
description: string;
/** Short description of the feature, as an HTML string */
description_html: string;
/** Alias identifier */
alias?: string | [string, string, ...string[]];
/** Specification */
spec: specification_url | [specification_url, specification_url, ...specification_url[]];
/** caniuse.com identifier */
caniuse?: string | [string, string, ...string[]];
/** Whether a feature is considered a "baseline" web platform feature and when it achieved that status */
status: SupportStatus;
/** Sources of support data for this feature */
compat_features?: string[];
/** Usage stats */
usage_stats?: usage_stats_url | [usage_stats_url, usage_stats_url, ...usage_stats_url[]]; // A single URL or an array of two or more
}
type browserIdentifier = "chrome" | "chrome_android" | "edge" | "firefox" | "firefox_android" | "safari" | "safari_ios";
type BaselineHighLow = "high" | "low";
interface SupportStatus {
/** Whether the feature is Baseline (low substatus), Baseline (high substatus), or not (false) */
baseline: BaselineHighLow | false;
/** Date the feature achieved Baseline low status */
baseline_low_date?: string;
/** Date the feature achieved Baseline high status */
baseline_high_date?: string;
/** Browser versions that most-recently introduced the feature */
support: {
[K in browserIdentifier]?: string;
};
}
/** Specification URL
* @format uri
*/
type specification_url = string;
/** Usage stats URL
* @format uri
*/
type usage_stats_url = string;