chore: fix Deno.UnsafeWindowSurface typings (#22081)

- changed `Deno.UnsafeWindowSurface` typings from accepting
`Deno.UnsafePointerView` to `Deno.PointerValue`
- added width and height to `GPUCanvasConfiguration`
This commit is contained in:
Dean Srebnik 2024-01-24 10:47:28 -05:00 committed by GitHub
parent a5a973e93c
commit 6b5c9764ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View File

@ -238,7 +238,6 @@ Deno.test({
assertThrows(
() => {
// @ts-expect-error: runtime test for null handle
new Deno.UnsafeWindowSurface("cocoa", null, null);
},
);

View File

@ -783,8 +783,8 @@ declare namespace Deno {
export class UnsafeWindowSurface {
constructor(
system: "cocoa" | "win32" | "x11",
windowHandle: UnsafePointerView,
displayHandle: UnsafePointerView | null,
windowHandle: Deno.PointerValue<unknown>,
displayHandle: Deno.PointerValue<unknown>,
);
getContext(context: "webgpu"): GPUCanvasContext;
present(): void;

View File

@ -1325,6 +1325,8 @@ declare interface GPUCanvasConfiguration {
viewFormats?: GPUTextureFormat[];
colorSpace?: "srgb" | "display-p3";
alphaMode?: GPUCanvasAlphaMode;
width: number;
height: number;
}
/** @category WebGPU */
declare interface GPUCanvasContext {