{"_id":"@webgpu/types@0.1.72","bugs":{"url":"https://github.com/gpuweb/types/issues"},"dist":{"shasum":"d182969c26197e0072e9a887991faeb75cc7d9fb","tarball":"http://registry-npm.ywwl.com/@webgpu/types/download/@webgpu/types-0.1.72.tgz","fileCount":4,"integrity":"sha512-0cF7RFM2edNoiIS1ODJp0/Gzv4/xSXhwoR0YCza+OWpJWtn4wmo9DvK91aLlH9+uUnwIriP7ZiC3WitmyhuzBw==","signatures":[{"sig":"MEUCIQCQGNmgy/Sdfgs9cAIVts/ZQnIsYMqn7Y/dM4joRk0s3AIgE+4NaQpVtGkGGMMtw/rQS5lBCyQyQplvTuGtM41MOZo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH/F5IXt2fbVTkRscclHvvmQSu5e+34htBo5VmUYBalfAiBNpi8/8NJKGgEf5DH6EearZVrZAeaSwy3xDg8qYZhzeA=="}],"unpackedSize":125661,"size":28890,"noattachment":false,"key":"/@webgpu/types/-/@webgpu/types-0.1.72.tgz"},"main":"","name":"@webgpu/types","types":"dist/index.d.ts","gitHead":"bcb683e961c619ae5ecf6696e55507602a07609e","license":"BSD-3-Clause","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"},"version":"0.1.72","_npmUser":{"name":"kainino","email":"kainino1@gmail.com"},"homepage":"https://github.com/gpuweb/types","repository":{"url":"git+https://github.com/gpuweb/types.git","type":"git"},"_npmVersion":"10.1.0","description":"This package defines Typescript types (`.d.ts`) for the upcoming [WebGPU standard](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status).","directories":{},"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"}],"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"prettier":"^2.2.1","bikeshed-to-ts":"file:third_party/bikeshed-to-ts"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/types_0.1.72_1787104981281_0.013736641996489718"},"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\n(only for people who have npm publish access)\n\n* One line cmd to copy-n-paste (for ssh git user, and you'd better know what you are doing, if it failed at certain steps, you might need to clean up git tags before trying again)\n  - `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`\n* Separate steps (better for publishing for the first time)\n  * Make sure you are in the upstream repo, not your forked one. And make sure you are synced to latest commit intended for publish\n    - `git checkout main`\n    - `git pull https://github.com/gpuweb/types.git main`\n      - (If you are using HTTPS regularly. You can use remote names like `origin`, just make sure you are referring to the right repo)\n    - `git submodule update --init`\n  * Create the version tag and commit, and push\n    - `npm version patch`\n    - `git push https://github.com/gpuweb/types.git main --tags`\n  * publish the package\n    - `npm publish --otp=<code>`\n      - Replace `<code>` with the one-time password from your authenticator, since two-factors authentication is required to publish.\n      - If you are doing for the first time, you will do `npm adduser` first and it will guide you through adding the npm account.\n\n","publish_time":1787104981372,"_cnpm_publish_time":1787104981372,"dist-tags":{"latest":"0.1.74"}}