Skip to content

[Web API type definition issue] GPUBufferUsage #2465

@ccouzens

Description

@ccouzens

Summary

Unclear on how GPUBufferUsage namespace types should be automated as not in BCD

Expected vs. Actual Behavior

Expected: GPUBufferUsage in Typescript 6.0.2
Actual:

src/renderers/webGPU.ts:73:14 - error TS2304: Cannot find name 'GPUBufferUsage'.

73       usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
                ~~~~~~~~~~~~~~

src/renderers/webGPU.ts:73:39 - error TS2304: Cannot find name 'GPUBufferUsage'.

73       usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
                                         ~~~~~~~~~~~~~~

Playground Link

https://www.typescriptlang.org/play/?#code/OIBQqgQgrgZjCmAnMBnAhgc3gOgMoBUB5AJQEFgBRIA

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

The namespace is documented here.

It is well supported by Firefox (excluding some platforms), Chrome, Safari.

I understand from the contributor documentation that https://github.com/mdn/browser-compat-data drives this repo:

If conditions are not fulfilled but you think MDN is wrong, please file an issue at https://github.com/mdn/browser-compat-data/issues/. The type will be automatically added in a few weeks when MDN fixes their data.

However https://github.com/mdn/browser-compat-data/blob/v7.3.10/docs/data-guidelines/api.md#namespaces calls out GPUBufferUsage as deliberately undocumented:

The GPUBufferUsage namespace only contains constants, which should not be documented in BCD; thus, the GPUBufferUsage namespace should not be documented.

What is the process for contributing a type that BCD deliberately omits?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions