From 6b5c9764ac8087d035ef6a3f2542bd089957035e Mon Sep 17 00:00:00 2001 From: Dean Srebnik <49134864+load1n9@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:47:28 -0500 Subject: [PATCH] chore: fix `Deno.UnsafeWindowSurface` typings (#22081) - changed `Deno.UnsafeWindowSurface` typings from accepting `Deno.UnsafePointerView` to `Deno.PointerValue` - added width and height to `GPUCanvasConfiguration` --- cli/tests/unit/webgpu_test.ts | 1 - cli/tsc/dts/lib.deno.unstable.d.ts | 4 ++-- cli/tsc/dts/lib.deno_webgpu.d.ts | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts index fcbb34be5b..bcdc6b1ff1 100644 --- a/cli/tests/unit/webgpu_test.ts +++ b/cli/tests/unit/webgpu_test.ts @@ -238,7 +238,6 @@ Deno.test({ assertThrows( () => { - // @ts-expect-error: runtime test for null handle new Deno.UnsafeWindowSurface("cocoa", null, null); }, ); diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 80bb4e327f..3318552f3d 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -783,8 +783,8 @@ declare namespace Deno { export class UnsafeWindowSurface { constructor( system: "cocoa" | "win32" | "x11", - windowHandle: UnsafePointerView, - displayHandle: UnsafePointerView | null, + windowHandle: Deno.PointerValue, + displayHandle: Deno.PointerValue, ); getContext(context: "webgpu"): GPUCanvasContext; present(): void; diff --git a/cli/tsc/dts/lib.deno_webgpu.d.ts b/cli/tsc/dts/lib.deno_webgpu.d.ts index 606c776341..50d9ecfb64 100644 --- a/cli/tsc/dts/lib.deno_webgpu.d.ts +++ b/cli/tsc/dts/lib.deno_webgpu.d.ts @@ -1325,6 +1325,8 @@ declare interface GPUCanvasConfiguration { viewFormats?: GPUTextureFormat[]; colorSpace?: "srgb" | "display-p3"; alphaMode?: GPUCanvasAlphaMode; + width: number; + height: number; } /** @category WebGPU */ declare interface GPUCanvasContext {