{"id":21156454,"url":"https://github.com/gpuweb/types","last_synced_at":"2025-05-14T20:11:03.683Z","repository":{"id":35901377,"uuid":"181588347","full_name":"gpuweb/types","owner":"gpuweb","description":"TypeScript type definitions for WebGPU https://gpuweb.github.io/types/ ","archived":false,"fork":false,"pushed_at":"2025-03-28T19:20:11.000Z","size":1689,"stargazers_count":202,"open_issues_count":15,"forks_count":38,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-13T17:46:43.408Z","etag":null,"topics":["typescript","webgpu"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@webgpu/types","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gpuweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-16T00:59:54.000Z","updated_at":"2025-04-02T21:22:59.000Z","dependencies_parsed_at":"2024-05-30T00:27:35.323Z","dependency_job_id":"c2e0a985-5f34-42d3-8c15-7471df7ae0e0","html_url":"https://github.com/gpuweb/types","commit_stats":null,"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpuweb%2Ftypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpuweb%2Ftypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpuweb%2Ftypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpuweb%2Ftypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpuweb","download_url":"https://codeload.github.com/gpuweb/types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219374,"owners_count":22034397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typescript","webgpu"],"created_at":"2024-11-20T11:45:42.476Z","updated_at":"2025-05-14T20:11:03.662Z","avatar_url":"https://github.com/gpuweb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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## 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 \u003c 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/// \u003creference types=\"@webgpu/types\" /\u003e\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 \u0026\u0026 git checkout main \u0026\u0026 git pull \u0026\u0026 popd`\n- Install dependencies: `npm ci`\n- Bug workaround: paste the `copies.bs` contents in place of its include in `index.bs` (generator doesn't support includes).\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 \u0026\u0026 git pull git@github.com:gpuweb/types.git main \u0026\u0026 git submodule update --init \u0026\u0026 npm version patch \u0026\u0026 git push git@github.com:gpuweb/types.git main --tags \u0026\u0026 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=\u003ccode\u003e`\n      - Replace `\u003ccode\u003e` 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpuweb%2Ftypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpuweb%2Ftypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpuweb%2Ftypes/lists"}