From 14c16e52a69193703c2687e17dc119da7bd56663 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Wed, 2 Oct 2024 15:43:36 -0700 Subject: [PATCH] Tighten type for getConfiguration() (#157) --- README.md | 2 +- dist/index.d.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d30f7a..43e6901 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/dist/index.d.ts b/dist/index.d.ts index 48fbec5..36e615a 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -653,6 +653,11 @@ interface GPUCanvasConfiguration { alphaMode?: GPUCanvasAlphaMode; } +type GPUCanvasConfigurationOut = + Required & { + viewFormats: GPUTextureFormat[]; + }; + interface GPUCanvasToneMapping { mode?: GPUCanvasToneMappingMode; } @@ -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.