summaryrefslogtreecommitdiff
path: root/cli/tsc
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tsc')
-rw-r--r--cli/tsc/dts/lib.deno.unstable.d.ts26
-rw-r--r--cli/tsc/dts/lib.deno_webgpu.d.ts19
2 files changed, 45 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts
index 827c95556..f0f6f4571 100644
--- a/cli/tsc/dts/lib.deno.unstable.d.ts
+++ b/cli/tsc/dts/lib.deno.unstable.d.ts
@@ -3,6 +3,7 @@
/// <reference no-default-lib="true" />
/// <reference lib="deno.ns" />
/// <reference lib="deno.broadcast_channel" />
+/// <reference lib="deno.webgpu" />
/// <reference lib="esnext" />
/// <reference lib="es2022.intl" />
@@ -766,6 +767,31 @@ declare namespace Deno {
/** **UNSTABLE**: New API, yet to be vetted.
*
+ * Creates a presentable WebGPU surface from given window and
+ * display handles.
+ *
+ * The parameters correspond to the table below:
+ *
+ * | system | winHandle | displayHandle |
+ * | ----------------- | ------------- | --------------- |
+ * | "cocoa" (macOS) | `NSView*` | - |
+ * | "win32" (Windows) | `HWND` | `HINSTANCE` |
+ * | "x11" (Linux) | Xlib `Window` | Xlib `Display*` |
+ *
+ * @category WebGPU
+ */
+ export class UnsafeWindowSurface {
+ constructor(
+ system: "cocoa" | "win32" | "x11",
+ windowHandle: UnsafePointerView,
+ displayHandle: UnsafePointerView | null,
+ );
+ getContext(context: "webgpu"): GPUCanvasContext;
+ present(): void;
+ }
+
+ /** **UNSTABLE**: New API, yet to be vetted.
+ *
* These are unstable options which can be used with {@linkcode Deno.run}.
*
* @category Sub Process
diff --git a/cli/tsc/dts/lib.deno_webgpu.d.ts b/cli/tsc/dts/lib.deno_webgpu.d.ts
index f83ea5aa5..606c77634 100644
--- a/cli/tsc/dts/lib.deno_webgpu.d.ts
+++ b/cli/tsc/dts/lib.deno_webgpu.d.ts
@@ -1313,3 +1313,22 @@ declare interface GPUExtent3DDict {
/** @category WebGPU */
declare type GPUExtent3D = number[] | GPUExtent3DDict;
+
+/** @category WebGPU */
+declare type GPUCanvasAlphaMode = "opaque" | "premultiplied";
+
+/** @category WebGPU */
+declare interface GPUCanvasConfiguration {
+ device: GPUDevice;
+ format: GPUTextureFormat;
+ usage?: GPUTextureUsageFlags;
+ viewFormats?: GPUTextureFormat[];
+ colorSpace?: "srgb" | "display-p3";
+ alphaMode?: GPUCanvasAlphaMode;
+}
+/** @category WebGPU */
+declare interface GPUCanvasContext {
+ configure(configuration: GPUCanvasConfiguration): undefined;
+ unconfigure(): undefined;
+ getCurrentTexture(): GPUTexture;
+}