Skip to content

Tool for generating dom related TypeScript and JavaScript library files

License

Notifications You must be signed in to change notification settings

dogben/TypeScript-WebCodecs-generator

 
 

Repository files navigation

WebCodecs Typescript lib generator

This repo is forked from https://github.com/microsoft/TypeScript-DOM-lib-generator to generate TypeScript bindings from the WebCodecs IDL files in the Chromium repo.

Build Instructions

To get things setup:

npm install

To generate the .d.ts files

cat /path/to/chromium/src/third_party/blink/renderer/modules/webcodecs/*.idl > inputfiles/idl/webcodecs.widl
npm run build
npm run baseline-accept

You can then run git diff to look at the changes. Then,

cp baselines/webcodecs.generated.d.ts /path/to/DefinitelyTyped/types/dom-webcodecs/

If there are diffs to baselines/dom.generated.d.ts, these will need to be handled manually.

For WebCodecs, we assume that all APIs are exposed to both Window and DedicatedWorker, including AudioBuffer (part of the Web Audio spec). If this assumption does not hold in the future, we may need to split the declarations into two sets. Note that inputfiles/idl/Web Audio.widl has been manually edited in this repo and running fetch-idl will overwrite these edits.

About

Tool for generating dom related TypeScript and JavaScript library files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.5%
  • JavaScript 1.4%
  • Other 0.1%