This package, `new-javascript`, provides TypeScript type definitions for cutting-edge and experimental Web APIs and JavaScript features that are not yet incorporated into TypeScript's standard `dom` library or `@types/web`. As of version 0.4.7, it covers a wide range of specifications from groups like WICG, including the File System Access API, View Transitions, and Compression Streams. The project's release cadence is driven by the evolution of these web standards and TypeScript's integration schedule. A key differentiator is its proactive approach to providing types for early-stage APIs, using automated WebIDL-to-TypeScript conversion with manual refinement. It also uniquely includes worker-exclusive interfaces by default and offers specific type declarations for various worklet types through distinct import paths, helping developers target specific environments.
npm install new-javascriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and configure `new-javascript` types via `tsconfig.json` and a reference directive, then utilizes types from the File System Access API and View Transitions API in a runnable TypeScript example.
Regularly review TypeScript release notes and official `@types` packages for updates to the Web API landscape. If conflicts occur, you may need to selectively exclude conflicting files from `new-javascript` or remove the package entirely if official types suffice. Consider pinning `new-javascript` to a specific version to control updates.
Currently, `new-javascript` does not offer an option to disable the inclusion of worker-exclusive types. Developers should be mindful of the context in which they are building and avoid using these types outside of actual Web Worker environments. For other worker types (Service Worker, Shared Worker), refer to the `Better-TypeScript` package.
Always review the changelog before updating `new-javascript`. Consider pinning the package to exact versions or using a tool that flags updates for manual review. Stay informed about the status of the upstream Web API specifications you are using.
Ensure `new-javascript` is installed as a dev dependency (`npm i -D new-javascript`) and add `"new-javascript"` to the `compilerOptions.types` array in your `tsconfig.json`. Alternatively, add `/// <reference types="new-javascript" />` to the top of your TypeScript files.
Verify that `new-javascript` is included in your `tsconfig.json`'s `compilerOptions.types` array. Also, ensure your `compilerOptions.lib` includes `"dom"` and potentially `"dom.iterable"` and `"esnext"` to cover a broad range of browser APIs and modern JavaScript features.
Check your TypeScript version; if it's recently updated, it might natively include the type. You may need to remove `new-javascript` if the official types are sufficient, or find a way to exclude the specific conflicting type definition from `new-javascript` (e.g., via `tsconfig.json` `files` or `exclude` if granular enough, or wait for an `new-javascript` update that defers to native types).
No dependency data recorded yet.