Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@webgpu/types
Advanced tools
This package defines Typescript types (`.d.ts`) for the upcoming [WebGPU standard](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status).
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.
This repo also generates typedoc docs here: https://gpuweb.github.io/types
See the TypeScript handbook.
npm install --save @webgpu/types
yarn add @webgpu/types
tsc
and tsc
-based bundlersIn 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. :)
git submodule update --init
gpuweb
changes: pushd gpuweb && git checkout main && git pull && popd
npm ci
generated/index.d.ts
: npm run generate
generated/index.d.ts
and dist/index.d.ts
.
The generated file is tracked by Git so you can see what has changed.
Update the latter according to changes from the former.
Note the generated/
and dist/
files are not the same.
See below for intentional differences.npm run format
Most or all of these should be fixed in the generator over time.
Array
changed to Iterable
for WebIDL sequence
s in argument positions.any
changed to object
for WebIDL object
.| SharedArrayBuffer
added for [AllowShared] BufferSource
.The following differences are TODO: should be changed in the final result.
The following differences will remain.
onuncapturederror
strongly typed.getContext
definitions.GPUExtent3DStrict
and GPUOrigin2DStrict
.(only for people who have npm publish access)
git checkout main && git pull git@github.com:gpuweb/types.git main && git submodule update --init && npm version patch && git push git@github.com:gpuweb/types.git main --tags && npm publish
git checkout main
git pull https://github.com/gpuweb/types.git main
origin
, just make sure you are referring to the right repo)git submodule update --init
npm version patch
git push https://github.com/gpuweb/types.git main --tags
npm publish --otp=<code>
<code>
with the one-time password from your authenticator, since two-factors authentication is required to publish.npm adduser
first and it will guide you through adding the npm account.FAQs
This package defines Typescript types (`.d.ts`) for the upcoming [WebGPU standard](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status).
The npm package @webgpu/types receives a total of 549,843 weekly downloads. As such, @webgpu/types popularity was classified as popular.
We found that @webgpu/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.