From c4205e036f4946c9ca0ba636862c0495c2bc78c1 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Fri, 18 Oct 2024 09:27:14 -0400 Subject: [PATCH] Make `getConfiguration().toneMapping` optional Assuming we land https://github.com/gpuweb/gpuweb/pull/4922, `toneMapping` will be optional in practice until all browsers implement it. --- dist/index.d.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index fda2f19..feadba9 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -654,10 +654,20 @@ interface GPUCanvasConfiguration { alphaMode?: GPUCanvasAlphaMode; } -type GPUCanvasConfigurationOut = - Required & { - viewFormats: GPUTextureFormat[]; - }; +interface GPUCanvasConfigurationOut + extends Required< + Omit< + GPUCanvasConfiguration, + "toneMapping" + > + > { + /** {@inheritDoc GPUCanvasConfiguration.viewFormats} */ + viewFormats: GPUTextureFormat[]; + /** + * {@inheritDoc GPUCanvasConfiguration.toneMapping} + */ + toneMapping?: GPUCanvasToneMapping; +} interface GPUCanvasToneMapping { mode?: GPUCanvasToneMappingMode;