@mdn/browser-compat-data
Version:
Browser compatibility data provided by MDN Web Docs
247 lines (243 loc) • 6.51 kB
TypeScript
/* This file is a part of @mdn/browser-compat-data
* See LICENSE file for more information. */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema files in
* schemas/*, and run "npm run gentypes" to regenerate this file.
*/
export type Identifier = {[key: string]: Identifier} & {__compat?: CompatStatement};
/**
* Data about browsers, such as name, type and releases.
*/
export type Browsers = Record<BrowserName, BrowserStatement>;
/**
* Platform the browser runs on.
*/
export type BrowserType = "desktop" | "mobile" | "xr" | "server";
/**
* Browser engine.
*/
export type BrowserEngine = "Blink" | "EdgeHTML" | "Gecko" | "Presto" | "Trident" | "WebKit" | "V8";
/**
* Browser ID.
*/
export type BrowserName =
| "bun"
| "chrome"
| "chrome_android"
| "deno"
| "edge"
| "firefox"
| "firefox_android"
| "ie"
| "nodejs"
| "oculus"
| "opera"
| "opera_android"
| "safari"
| "safari_ios"
| "samsunginternet_android"
| "webview_android"
| "webview_ios";
/**
* Upstream browser ID.
*/
export type UpstreamBrowserName = "chrome" | "chrome_android" | "firefox" | "safari" | "safari_ios";
/**
* Lifetime cycle status of a browser release.
*/
export type BrowserStatus = "retired" | "current" | "beta" | "nightly" | "esr" | "planned";
/**
* Browser version that added this feature, or false if not supported.
*/
export type VersionValue = string | false;
export type SupportStatement =
SimpleSupportStatement | [SimpleSupportStatement, SimpleSupportStatement, ...SimpleSupportStatement[]];
/**
* Browser support data for this feature.
*/
export type SupportBlock = Partial<Record<BrowserName, SupportStatement>>;
/**
* Published BCD data.
*/
export interface CompatData {
__meta: MetaBlock;
api: Identifier;
browsers: Browsers;
css: Identifier;
html: Identifier;
http: Identifier;
javascript: Identifier;
manifests: Identifier;
mathml: Identifier;
mediatypes: Identifier;
svg: Identifier;
webassembly: Identifier;
webdriver: Identifier;
webextensions: Identifier;
}
/**
* Release metadata.
*/
export interface MetaBlock {
/**
* Package version number of this BCD release.
*
* Examples: "5.6.14", "6.0.0"
*/
version: string;
/**
* Timestamp of when this BCD release was built.
*
* Examples: "2025-06-15T14:32:00.000Z"
*/
timestamp: string;
}
export interface BrowserStatement {
/**
* Name of the browser.
*
* Examples: "Firefox", "Firefox Android", "Chrome"
*/
name: string;
type: BrowserType;
upstream?: UpstreamBrowserName;
/**
* Name of the browser's preview channel.
*
* Examples: "Nightly", "TP"
*/
preview_name?: string;
/**
* URL of the page where feature flags can be changed.
*
* Examples: "about:config", "chrome://flags"
*/
pref_url?: string;
/**
* Whether the browser supports feature flags that enable or disable features.
*/
accepts_flags: boolean;
/**
* Whether the browser supports extensions.
*/
accepts_webextensions: boolean;
/**
* Releases of this browser.
*/
releases: Record<string, ReleaseStatement>;
}
export interface ReleaseStatement {
/**
* When this version was released or will be released (`YYYY-MM-DD`).
*/
release_date?: string;
/**
* Link to the release notes or changelog.
*/
release_notes?: string;
status: BrowserStatus;
engine?: BrowserEngine;
/**
* Engine version used in this release.
*/
engine_version?: string;
}
export interface SimpleSupportStatement {
version_added: VersionValue;
/**
* Browser version that removed this feature.
*/
version_removed?: string;
/**
* Last browser version that supported this feature.
*/
version_last?: string;
/**
* Prefix for the subfeature name. Leading and trailing '-' must be included if applicable.
*/
prefix?: string;
/**
* Alternative name for the feature, when implemented under an entirely different name.
*/
alternative_name?: string;
/**
* Feature flags that must be configured for this browser to support this feature.
*
* @minItems 1
*/
flags?: [FlagStatement, ...FlagStatement[]];
/**
* Link to the bug or issue that tracks the implementation of this feature.
*/
impl_url?: string | [string, string, ...string[]];
/**
* Set if the browser's support does not implement mandatory specified behavior, is inconsistent with other browsers, causes confusing feature detection results, and has a demonstrable negative impact on web developers.
*/
partial_implementation?: true;
/**
* Additional information about the feature's support.
*/
notes?: string | [string, string, ...string[]];
}
export interface FlagStatement {
/**
* Flag type.
*/
type: "preference" | "runtime_flag";
/**
* Name of the flag or preference to configure.
*/
name: string;
/**
* Value to set the flag to.
*/
value_to_set?: string;
}
/**
* Information about the stability of the feature.
*/
export interface StatusBlock {
/**
* @deprecated
* (This property is deprecated. Prefer using more well-defined stability calculations, such as Baseline, instead.) Usually, this value is true for single-implementer features and false for multiple-implementer features or single-implementer features that are not expected to change.
*/
experimental: boolean;
/**
* Whether the feature is part of an active specification or specification process.
*/
standard_track: boolean;
/**
* Whether the feature is no longer recommended. It might be removed in the future or kept only for compatibility purposes.
*/
deprecated: boolean;
}
/**
* The compatibility data for a feature, nested under the `__compat` property of an identifier.
*/
export interface CompatStatement {
/**
* Human-readable description of the feature.
*/
description?: string;
/**
* Link to the MDN reference page documenting the feature.
*/
mdn_url?: string;
/**
* URL(s) for specific parts of a specification in which this feature is defined.
*/
spec_url?: string | [string, string, ...string[]];
/**
* Tags assigned to the feature.
*
* @minItems 1
*/
tags?: [string, ...string[]];
/**
* Path to the file defining this feature, relative to the repository root. Automatically generated at build time.
*/
source_file: string;
support: SupportBlock;
status?: StatusBlock;
}