@baseline-types/dom-2025
v1.0.20260712
Published
DOM types for web APIs that reached Baseline "Newly available" by 2025
Readme
@baseline-types/dom-2025 - DOM types frozen to Baseline 2025
This package contains the DOM types for the web APIs that reached
Baseline Newly available status in 2025 or
earlier. It is a drop-in replacement for @types/web / the built-in dom library
that lets you pin your project to the web platform surface that was broadly
available by a given year, instead of always tracking the latest specs.
The types are generated from
the same spec data (@webref/idl + @mdn/browser-compat-data) as @types/web,
then cut down with compute-baseline
to the Baseline 2025 set. The cut is referentially closed, so the output is a
valid superset of the strict "Baseline ≤ 2025" set (an older API that depends on
a type which only reached Baseline later keeps that type).
Installation
With TypeScript 4.5+ using lib replacement, swap the built-in DOM lib for this package:
npm install @typescript/lib-dom@npm:@baseline-types/dom-2025 --save-dev
pnpm add @typescript/lib-dom@npm:@baseline-types/dom-2025 --save-dev
yarn add @typescript/lib-dom@npm:@baseline-types/dom-2025 --devIf you are using TypeScript 6.0+, set libReplacement
to true in your tsconfig.json.
That's all — your project now sees only the DOM APIs that were Baseline Newly available by 2025.
Install the dependency:
npm install @baseline-types/dom-2025 --save-dev.Update your
tsconfig.json. There are two cases depending on whether you havelibdefined.- Without "lib" - Add
"lib": []plus the entry matching your"target"(e.g."lib": ["es2017"]for"target": "es2017"). - With "lib" - Remove
"dom".
- Without "lib" - Add
Removing "dom" lets this package provide the global declarations instead.
What "Baseline 2025" means here
- Newly available, not Widely available: an API is included if every core
browser shipped it by the end of 2025 (
baseline_low_date). - A few references that can't be satisfied in a given scope (e.g. an enum whose
only interface was cut) are degraded to
any. - When unsure whether an API has Baseline data at all (e.g.
WebAssembly), it is kept rather than dropped.
SemVer
This project does not respect semantic versioning — the underlying spec data and
Baseline computation change over time, and any update could add or remove types.
The year in the package name is the stable axis. The version's patch component is
the release date (1.0.YYYYMMDD, e.g. 1.0.20260707), so the version simply
records the day each data refresh was cut.
Deploy Metadata
You can read what changed in version 1.0.20260712 at https://github.com/uhyo/TypeScript-Baseline-Types/releases/tag/%40baseline-types%2Fdom-2025%401.0.20260712.
