|
| 1 | +/** |
| 2 | + * The top-level web-features data package |
| 3 | + */ |
| 4 | +export interface WebFeaturesData { |
| 5 | + /** |
| 6 | + * Browsers and browser release data |
| 7 | + */ |
| 8 | + browsers: Browsers; |
| 9 | + /** |
| 10 | + * Feature identifiers and data |
| 11 | + */ |
| 12 | + features: { [key: string]: FeatureData }; |
| 13 | + /** |
| 14 | + * Group identifiers and data |
| 15 | + */ |
| 16 | + groups: { [key: string]: GroupData }; |
| 17 | + /** |
| 18 | + * Snapshot identifiers and data |
| 19 | + */ |
| 20 | + snapshots?: { [key: string]: SnapshotData }; |
| 21 | +} |
| 22 | + |
| 23 | +/** |
| 24 | + * Browsers and browser release data |
| 25 | + */ |
| 26 | +export interface Browsers { |
| 27 | + chrome: BrowserData; |
| 28 | + chrome_android: BrowserData; |
| 29 | + edge: BrowserData; |
| 30 | + firefox: BrowserData; |
| 31 | + firefox_android: BrowserData; |
| 32 | + safari: BrowserData; |
| 33 | + safari_ios: BrowserData; |
| 34 | +} |
| 35 | + |
| 36 | +/** |
| 37 | + * Browser information |
| 38 | + */ |
| 39 | +export interface BrowserData { |
| 40 | + /** |
| 41 | + * The name of the browser, as in "Edge" or "Safari on iOS" |
| 42 | + */ |
| 43 | + name: string; |
| 44 | + releases: Release[]; |
| 45 | +} |
| 46 | + |
| 47 | +/** |
| 48 | + * Browser release information |
| 49 | + */ |
| 50 | +export interface Release { |
| 51 | + /** |
| 52 | + * The release date, as in "2023-12-11" |
| 53 | + */ |
| 54 | + date: string; |
| 55 | + /** |
| 56 | + * The version string, as in "10" or "17.1" |
| 57 | + */ |
| 58 | + version: string; |
| 59 | +} |
| 60 | + |
| 61 | +/** |
| 62 | + * A feature data entry |
| 63 | + */ |
| 64 | +export interface FeatureData { |
| 65 | + /** |
| 66 | + * caniuse.com identifier(s) |
| 67 | + */ |
| 68 | + caniuse?: string[] | string; |
| 69 | + /** |
| 70 | + * Sources of support data for this feature |
| 71 | + */ |
| 72 | + compat_features?: string[]; |
| 73 | + /** |
| 74 | + * Short description of the feature, as a plain text string |
| 75 | + */ |
| 76 | + description: string; |
| 77 | + /** |
| 78 | + * Short description of the feature, as an HTML string |
| 79 | + */ |
| 80 | + description_html: string; |
| 81 | + /** |
| 82 | + * Whether developers are formally discouraged from using this feature |
| 83 | + */ |
| 84 | + discouraged?: Discouraged; |
| 85 | + /** |
| 86 | + * Group identifier(s) |
| 87 | + */ |
| 88 | + group?: string[] | string; |
| 89 | + /** |
| 90 | + * Short name |
| 91 | + */ |
| 92 | + name: string; |
| 93 | + /** |
| 94 | + * Snapshot identifier(s) |
| 95 | + */ |
| 96 | + snapshot?: string[] | string; |
| 97 | + /** |
| 98 | + * Specification URL(s) |
| 99 | + */ |
| 100 | + spec: string[] | string; |
| 101 | + /** |
| 102 | + * Whether a feature is considered a "Baseline" web platform feature and when it achieved |
| 103 | + * that status |
| 104 | + */ |
| 105 | + status?: StatusHeadline; |
| 106 | + [property: string]: any; |
| 107 | +} |
| 108 | + |
| 109 | +/** |
| 110 | + * Whether developers are formally discouraged from using this feature |
| 111 | + */ |
| 112 | +export interface Discouraged { |
| 113 | + /** |
| 114 | + * Links to a formal discouragement notice, such as specification text, intent-to-unship, |
| 115 | + * etc. |
| 116 | + */ |
| 117 | + according_to: string[]; |
| 118 | + /** |
| 119 | + * IDs for features that substitute some or all of this feature's utility |
| 120 | + */ |
| 121 | + alternatives?: string[]; |
| 122 | +} |
| 123 | + |
| 124 | +/** |
| 125 | + * Whether a feature is considered a "Baseline" web platform feature and when it achieved |
| 126 | + * that status |
| 127 | + */ |
| 128 | +export interface StatusHeadline { |
| 129 | + /** |
| 130 | + * Whether the feature is Baseline (low substatus), Baseline (high substatus), or not (false) |
| 131 | + */ |
| 132 | + baseline: boolean | BaselineEnum; |
| 133 | + /** |
| 134 | + * Date the feature achieved Baseline high status |
| 135 | + */ |
| 136 | + baseline_high_date?: string; |
| 137 | + /** |
| 138 | + * Date the feature achieved Baseline low status |
| 139 | + */ |
| 140 | + baseline_low_date?: string; |
| 141 | + /** |
| 142 | + * Browser versions that most-recently introduced the feature |
| 143 | + */ |
| 144 | + support: Support; |
| 145 | + /** |
| 146 | + * Statuses for each key in the feature's compat_features list, if applicable. Not available |
| 147 | + * to the npm release of web-features. |
| 148 | + */ |
| 149 | + by_compat_key?: { [key: string]: Status }; |
| 150 | + [property: string]: any; |
| 151 | +} |
| 152 | + |
| 153 | +export type BaselineEnum = "high" | "low"; |
| 154 | + |
| 155 | +export interface Status { |
| 156 | + /** |
| 157 | + * Whether the feature is Baseline (low substatus), Baseline (high substatus), or not (false) |
| 158 | + */ |
| 159 | + baseline: boolean | BaselineEnum; |
| 160 | + /** |
| 161 | + * Date the feature achieved Baseline high status |
| 162 | + */ |
| 163 | + baseline_high_date?: string; |
| 164 | + /** |
| 165 | + * Date the feature achieved Baseline low status |
| 166 | + */ |
| 167 | + baseline_low_date?: string; |
| 168 | + /** |
| 169 | + * Browser versions that most-recently introduced the feature |
| 170 | + */ |
| 171 | + support: Support; |
| 172 | + [property: string]: any; |
| 173 | +} |
| 174 | + |
| 175 | +/** |
| 176 | + * Browser versions that most-recently introduced the feature |
| 177 | + */ |
| 178 | +export interface Support { |
| 179 | + chrome?: string; |
| 180 | + chrome_android?: string; |
| 181 | + edge?: string; |
| 182 | + firefox?: string; |
| 183 | + firefox_android?: string; |
| 184 | + safari?: string; |
| 185 | + safari_ios?: string; |
| 186 | +} |
| 187 | + |
| 188 | +export interface GroupData { |
| 189 | + /** |
| 190 | + * Short name |
| 191 | + */ |
| 192 | + name: string; |
| 193 | + /** |
| 194 | + * Identifier of parent group |
| 195 | + */ |
| 196 | + parent?: string; |
| 197 | +} |
| 198 | + |
| 199 | +export interface SnapshotData { |
| 200 | + /** |
| 201 | + * Short name |
| 202 | + */ |
| 203 | + name?: string; |
| 204 | + /** |
| 205 | + * Specification |
| 206 | + */ |
| 207 | + spec?: string; |
| 208 | + [property: string]: any; |
| 209 | +} |
0 commit comments