From bfa343358512075495fb287ef902f97421df5746 Mon Sep 17 00:00:00 2001 From: sarthak saxena Date: Wed, 18 Mar 2020 20:01:17 +0530 Subject: [PATCH] Add type for Uint8ClampedArray in KernelVariable ``` render = new GPU.GPU({ mode: "gpu" }) render(image.data, 14 * Math.sin(Date.now() / 400)) ``` Since image data is of type Uint8ClampedArray & KernelVariable does not support the same hence gives type error Ex: https://observablehq.com/@fil/image-to-gpu --- src/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index ea48fcb2..4a128002 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -407,6 +407,7 @@ export type KernelVariable = | Uint8Array | Uint16Array | Uint32Array + | Uint8ClampedArray | KernelOutput; export type ThreadFunctionResult @@ -665,4 +666,4 @@ export interface IDeclaration { valueType: string; dependencies: any; isSafe: boolean; -} \ No newline at end of file +}