Skip to content

Commit bfa3433

Browse files
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
1 parent 8cfbf0c commit bfa3433

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ export type KernelVariable =
407407
| Uint8Array
408408
| Uint16Array
409409
| Uint32Array
410+
| Uint8ClampedArray
410411
| KernelOutput;
411412

412413
export type ThreadFunctionResult
@@ -665,4 +666,4 @@ export interface IDeclaration {
665666
valueType: string;
666667
dependencies: any;
667668
isSafe: boolean;
668-
}
669+
}

0 commit comments

Comments
 (0)