Skip to content

writeBuffer issue with AllowSharedBufferSource more narrow than before #178

@johnnybenson

Description

@johnnybenson

Hi! Not sure if this is the right place to file an issue.

A change in 0.1.58 makes writeTexture's typing more narrow than before and we are seeing type errors on working code.

SharedArrayBuffer was explicitly included in @types/webgpu in 0.1.56 and removed in 0.1.58.

Image v0.1.56...v0.1.58

It looks like AllowSharedBufferSource should include SharedArrayBuffer in its type definition looking at this:

AllowSharedBufferSource https://webidl.spec.whatwg.org/#AllowSharedBufferSource

Image

It is not, however, in the Typescript lib.dom type definition. lib/dom.generated.d.ts#L29329

type AllowSharedBufferSource = ArrayBuffer | ArrayBufferView;
type BufferSource = ArrayBufferView | ArrayBuffer;

Not sure where in this tool chain this should be addressed. Is Typescript's type definition wrong? Or if this is an intentional change and SharedArrayBuffer should not be used with textures.

Downgrading @types/webgpu to 0.1.56 for now. Thanks for any insights

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions