File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,15 @@ declare namespace Emscripten {
2323 }
2424}
2525
26+ // Infers the type only in TypeScript environments where GPU types are available
27+ type MaybeGPUDevice = Navigator extends {
28+ gpu : {
29+ requestAdapter ( ...args : any [ ] ) : Promise < null | {
30+ requestDevice ( ...args : any [ ] ) : Promise < null | infer T >
31+ } >
32+ }
33+ } ? T : never ;
34+
2635interface EmscriptenModule {
2736 print ( str : string ) : void ;
2837 printErr ( str : string ) : void ;
@@ -34,6 +43,7 @@ interface EmscriptenModule {
3443 onAbort : { ( what : any ) : void } ;
3544 onRuntimeInitialized : { ( ) : void } ;
3645 preinitializedWebGLContext : WebGLRenderingContext ;
46+ preinitializedWebGPUDevice : MaybeGPUDevice ;
3747 noInitialRun : boolean ;
3848 noExitRuntime : boolean ;
3949 logReadFiles : boolean ;
You can’t perform that action at this time.
0 commit comments