File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Plugins/PackageToJS/Templates Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1+ type ref = number ;
2+ type pointer = number ;
3+
14declare class Memory {
25 readonly rawMemory : WebAssembly . Memory ;
36 private readonly heap ;
@@ -18,9 +21,6 @@ declare class Memory {
1821 writeFloat64 : ( ptr : pointer , value : number ) => void ;
1922}
2023
21- type ref = number ;
22- type pointer = number ;
23-
2424/**
2525 * A thread channel is a set of functions that are used to communicate between
2626 * the main thread and the worker thread. The main thread and the worker thread
@@ -189,6 +189,7 @@ declare class SwiftRuntime {
189189 private textEncoder ;
190190 /** The thread ID of the current thread. */
191191 private tid ;
192+ UnsafeEventLoopYield : typeof UnsafeEventLoopYield ;
192193 constructor ( options ?: SwiftRuntimeOptions ) ;
193194 setInstance ( instance : WebAssembly . Instance ) : void ;
194195 main ( ) : void ;
@@ -209,6 +210,8 @@ declare class SwiftRuntime {
209210 private postMessageToMainThread ;
210211 private postMessageToWorkerThread ;
211212}
213+ declare class UnsafeEventLoopYield extends Error {
214+ }
212215
213216export { SwiftRuntime } ;
214217export type { SwiftRuntimeOptions , SwiftRuntimeThreadChannel } ;
Original file line number Diff line number Diff line change 312312 this . version = 708 ;
313313 this . textDecoder = new TextDecoder ( "utf-8" ) ;
314314 this . textEncoder = new TextEncoder ( ) ; // Only support utf-8
315+ this . UnsafeEventLoopYield = UnsafeEventLoopYield ;
315316 /** @deprecated Use `wasmImports` instead */
316317 this . importObjects = ( ) => this . wasmImports ;
317318 this . _instance = null ;
Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ class SwiftRuntime {
306306 this . version = 708 ;
307307 this . textDecoder = new TextDecoder ( "utf-8" ) ;
308308 this . textEncoder = new TextEncoder ( ) ; // Only support utf-8
309+ this . UnsafeEventLoopYield = UnsafeEventLoopYield ;
309310 /** @deprecated Use `wasmImports` instead */
310311 this . importObjects = ( ) => this . wasmImports ;
311312 this . _instance = null ;
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ export class SwiftRuntime {
3838 /** The thread ID of the current thread. */
3939 private tid : number | null ;
4040
41+ UnsafeEventLoopYield = UnsafeEventLoopYield ;
42+
4143 constructor ( options ?: SwiftRuntimeOptions ) {
4244 this . _instance = null ;
4345 this . _memory = null ;
@@ -749,4 +751,4 @@ export class SwiftRuntime {
749751/// This error is thrown to unwind the call stack of the Swift program and return the control to
750752/// the JavaScript side. Otherwise, the `swift_task_asyncMainDrainQueue` ends up with `abort()`
751753/// because the event loop expects `exit()` call before the end of the event loop.
752- export class UnsafeEventLoopYield extends Error { }
754+ class UnsafeEventLoopYield extends Error { }
You can’t perform that action at this time.
0 commit comments