Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten type for getConfiguration() #157

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Please contribute a PR to add instructions for other setups or improve existing

Most or all of these should be fixed in the generator over time.

- `Array` changed to `Iterable` for WebIDL `sequence`s in argument positions.
- `Array` changed to `Iterable` for WebIDL `sequence`s in argument positions (but not in return positions).
- `any` changed to `object` for WebIDL `object`.
- `| SharedArrayBuffer` added for `[AllowShared] BufferSource`.

Expand Down
7 changes: 6 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,11 @@ interface GPUCanvasConfiguration {
alphaMode?: GPUCanvasAlphaMode;
}

type GPUCanvasConfigurationOut =
Required<GPUCanvasConfiguration> & {
viewFormats: GPUTextureFormat[];
};

interface GPUCanvasToneMapping {
mode?: GPUCanvasToneMappingMode;
}
Expand Down Expand Up @@ -2073,7 +2078,7 @@ interface GPUCanvasContext {
/**
* Returns the context configuration.
*/
getConfiguration(): GPUCanvasConfiguration | null;
getConfiguration(): GPUCanvasConfigurationOut | null;
/**
* Get the {@link GPUTexture} that will be composited to the document by the {@link GPUCanvasContext}
* next.
Expand Down
Loading