22// Copyright (c) JupyterLite Contributors
33// Distributed under the terms of the Modified BSD License.
44
5-
6- declare module globalThis {
7- let Module :any ;
5+ declare namespace globalThis {
6+ let Module : any ;
87}
9- globalThis . Module = { }
10- // // @ts -ignore
11- // var document: any = {}
12-
13- // globalThis.Module = Module
8+ globalThis . Module = { } ;
149
1510// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1611// @ts -ignore
1712import createXeusModule from './xpython_wasm.js' ;
18- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19- // @ts -ignore
20- // import populate from './python_data.js';
21- // // import populate from './python_data.js';
22- // // import populate from './python_data.js';
23- // // console.log("populate",populate)
24-
25-
26- // populate()
2713
2814// We alias self to ctx and give it our newly created type
2915const ctx : Worker = self as any ;
3016let raw_xkernel : any ;
3117let raw_xserver : any ;
3218
33-
34-
3519async function waitRunDependency ( ) {
36- const promise = new Promise ( ( r :any ) => {
37- globalThis . Module . monitorRunDependencies = ( n :number ) => {
20+ const promise = new Promise ( ( r : any ) => {
21+ globalThis . Module . monitorRunDependencies = ( n : number ) => {
3822 if ( n === 0 ) {
39- console . log ( " all `RunDependencies` loaded" )
23+ console . log ( ' all `RunDependencies` loaded' ) ;
4024 r ( ) ;
4125 }
4226 } ;
4327 } ) ;
4428 // If there are no pending dependencies left, monitorRunDependencies will
4529 // never be called. Since we can't check the number of dependencies,
4630 // manually trigger a call.
47- globalThis . Module . addRunDependency ( " dummy" ) ;
48- globalThis . Module . removeRunDependency ( " dummy" ) ;
31+ globalThis . Module . addRunDependency ( ' dummy' ) ;
32+ globalThis . Module . removeRunDependency ( ' dummy' ) ;
4933 return promise ;
5034}
5135
@@ -64,14 +48,13 @@ ctx.get_stdin = get_stdin;
6448// @ts -ignore: breaks typedoc
6549let resolveInputReply : any ;
6650
67-
6851async function loadCppModule ( moduleFactory : any ) : Promise < any > {
6952 const options : any = { } ;
7053 globalThis . Module = await moduleFactory ( options ) ;
7154
7255 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7356 // @ts -ignore
74- await import ( " ./python_data" ) ;
57+ await import ( ' ./python_data' ) ;
7558
7659 await waitRunDependency ( ) ;
7760 raw_xkernel = new globalThis . Module . xkernel ( ) ;
0 commit comments