Skip to content

Commit

Permalink
Tighten type for getConfiguration() (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored Oct 2, 2024
1 parent 18d6562 commit 14c16e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 14c16e5

Please sign in to comment.