{"name":"@webgpu/types","version":"0.1.73","license":"BSD-3-Clause","_id":"@webgpu/types@0.1.73","maintainers":[{"name":"kainino","email":"kainino1@gmail.com"},{"name":"kangz","email":"corentin@wallez.net"},{"name":"toji","email":"tojiro@gmail.com"},{"name":"shrekshao","email":"shrekshao@gmail.com"}],"homepage":"https://github.com/gpuweb/types","bugs":{"url":"https://github.com/gpuweb/types/issues"},"dist":{"shasum":"17aea9155f76066a6ffdb9d1db6d4ce155f73364","tarball":"http://registry-npm.ywwl.com/@webgpu/types/download/@webgpu/types-0.1.73.tgz","fileCount":4,"integrity":"sha512-oQdO1i64qs6sdtQe2OZ5n9vh3lnxDCvkPFPvS7RVKkR3nmyjbaDsAzQI4m9jJ5txgfjyawTanP8EuMHJlbdjfw==","signatures":[{"sig":"MEYCIQDwJF181euNDObNYrcSzSUBiv5su9yvz/vbifrMoOTFBAIhAOj1cisuBKNe37pJHR7RzyIFiJBO3xZnv7xLHCkNDdkn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDiDjyTx9OYz6BzvHAtSwKjh6NYtov4gR75Iz0hOVuJTAIhAI24Kas9fuxCpNCu2GU+j4L5P2MEbkcWYQFrww4cOsYU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@webgpu%2ftypes@0.1.73","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":124821,"size":28672,"noattachment":false,"key":"/@webgpu/types/-/@webgpu/types-0.1.73.tgz"},"main":"","types":"dist/index.d.ts","gitHead":"e01d77ac44c42e4ef83dafb5b8d446f0a8242758","scripts":{"test":"for t in tests/*/ ; do echo \"\\n======== $t ========\" ; (cd \"$t\" && npm i && npm test); done","format":"prettier -w dist/index.d.ts","generate":"node generate.mjs","build-docs":"cd tsdoc-src && npm ci && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f053432e-c131-436e-bd82-6c6b5e8d1281"}},"repository":{"url":"git+https://github.com/gpuweb/types.git","type":"git"},"_npmVersion":"11.19.0","description":"This package defines Typescript types (`.d.ts`) for the upcoming [WebGPU standard](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status).","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"devDependencies":{"prettier":"^2.2.1","bikeshed-to-ts":"file:third_party/bikeshed-to-ts"},"_npmOperationalInternal":{"tmp":"tmp/types_0.1.73_1789783206208_0.6431549019614957","host":"s3://npm-registry-packages-npm-production"},"readme":"# Typescript Type Definitions for WebGPU\n\nThis package defines Typescript types (`.d.ts`) for the upcoming [WebGPU standard](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status).\n\nUse this package to augment the ambient [`\"dom\"`](https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options) type definitions with the new definitions for WebGPU.\n\n## API style docs\n\nThis repo also generates typedoc docs here: https://gpuweb.github.io/types\n\n## What are declaration files?\n\nSee the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html).\n\n\n## Integration into `\"dom\"` type definitions.\n\nWebGPU types have been integrated into the [`\"dom\"`](https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options) starting with TypeScript 6. It appears that\nv6.0.4 and above will include a full set of WebGPU types and thus should not need the supplemental types from this repo.\n\nUnfortunately some versions of TypeScript include a `\"dom\"` library which only contained a partial set of WebGPU types, preventing WebGPU code from building cleanly. This is confirmed\nthe case in TypeScript v6.0.3 and lower and TypeScript v7.0.2 and lower. To build WebGPU with the affected versions install the [`@types/web`](https://www.npmjs.com/package/@types/web)\nto be package v0.0.352 or greater, and use it instead of the built-in `\"dom\"` library:\n\nInstall:\n```\nnpm install @types/web\n```\n\nUsage in `tsconfig.json`:\n```js\n{\n  // ...\n  \"compilerOptions\": {\n    // ...\n    \"lib\": [\"esnext\"], // Do not include \"dom\"!\n    \"types\": [\"@types/web\"],\n  }\n}\n```\n\nFor TypeScript v5 and below, this library is still necessary to provide WebGPU types.\n\n\n\n## How can I use them?\n\n### Install\n\n- npm: `npm install --save-dev @webgpu/types`\n- yarn: `yarn add --dev @webgpu/types`\n- pnpm: `pnpm add -D @webgpu/types`\n\nIf you are on TypeScript < 5.1, you will also need to install `@types/dom-webcodecs`\nas a sibling dependency. The version you need depends on the TypeScript version;\nsee the [tests](tests/) for examples.\n\n### Configure\n\nSince this package is outside DefinitelyTyped, the dependency won't be picked up automatically.\nThere are several ways to add a additional TypeScript type definition dependencies to your TypeScript project:\n\n#### TypeScript `tsc` and `tsc`-based bundlers\n\nIn `tsconfig.json`:\n\n```js\n{\n  // ...\n  \"compilerOptions\": {\n    // ...\n    \"types\": [\"@webgpu/types\"]\n  }\n}\n```\n\nOr you can use `typeRoots`:\n\n```js\n{\n  // ...\n  \"compilerOptions\": {\n    // ...\n    \"typeRoots\": [\"./node_modules/@webgpu/types\", \"./node_modules/@types\"]\n  }\n}\n```\n\n#### Inline in TypeScript\n\nThis may work better if your toolchain doesn't read `tsconfig.json`.\n\n```ts\n/// <reference types=\"@webgpu/types\" />\n```\n\n#### Webpack\n\nIf you use Webpack and the options above aren't sufficient (this has not been verified),\nyou may need the following in `webpack.config.js`:\n\n```js\n\"types\": [\"@webgpu/types\"]\n```\n\n#### Others?\n\nPlease contribute a PR to add instructions for other setups or improve existing instructions. :)\n\n\n## How to update these types\n\n- Make sure the submodule is checked out: `git submodule update --init`\n- Pull `gpuweb` changes: `pushd gpuweb && git checkout main && git pull && popd`\n- Install dependencies: `npm ci`\n- Generate `generated/index.d.ts`: `npm run generate`\n- Open a diff between `generated/index.d.ts` and `dist/index.d.ts`.\n    The generated file is tracked by Git so you can see what has changed.\n    Update the latter according to changes from the former.\n    Note the `generated/` and `dist/` files are not the same.\n    See below for intentional differences.\n- Format the result: `npm run format`\n\n### Intentional differences between generator output and final result\n\nMost or all of these should be fixed in the generator over time.\n\n- `any` changed to `object` for WebIDL `object`.\n\nThe following differences are TODO: should be changed in the final result.\n\n- Deprecated items should be removed.\n- TODO items should be fixed (e.g. make new additions no longer optional).\n- Addition of Compatibility Mode items like `textureBindingViewDimension`.\n\nThe following differences will remain.\n\n- `onuncapturederror` strongly typed.\n- `addEventListener('uncapturederror')` type support.\n- `getContext` definitions.\n- `GPUExtent3DStrict` and `GPUOrigin2DStrict`.\n\n### Publish a new npm package version\n\nNew patch releases are published to NPM and tagged in Git automatically by [GitHub Actions](.github/workflows/build-deploy-publish.yml) on pushes to `main` when `dist/index.d.ts` has changed since the last release.\n\n`package.json` intentionally omits a `version` field in Git; the workflow finds the latest version tag in Git, increments the patch version, publishes the package, and pushes the new Git tag.\n\n","publish_time":1789783206294,"_cnpm_publish_time":1789783206294,"dist-tags":{"latest":"0.1.74"}}