This package defines Typescript types (.d.ts) for the upcoming WebGPU standard.
This package matches the work-in-progress WebGPU API, which is currently unstable!
Use this package to augment the ambient "dom" type definitions with the new definitions for WebGPU.
See the TypeScript handbook.
- npm:
npm install --save @webgpu/types - yarn:
yarn add @webgpu/types
In tsconfig.json:
{
// ...
"compilerOptions": {
// ...
"typeRoots": [ "./node_modules/@webgpu/types", "./node_modules/@types"]
}
}In webpack.config.js add:
"types": ["@webgpu/types"](may not be necessary with tsc config above - untested)
/// <reference types="@webgpu/types" />Please contribute a PR to add instructions for other setups or improve existing instructions. :)