Skip to content

Commit c8c17b2

Browse files
Merge pull request #391 from swiftwasm/yt/add-non-class-type
PackageToJS: Use non-class type for SwiftRuntime in instantiate.d.ts
2 parents 5b56aa4 + 951aca8 commit c8c17b2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Plugins/PackageToJS/Templates/instantiate.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import type { /* #if USE_SHARED_MEMORY */SwiftRuntimeThreadChannel, /* #endif */SwiftRuntime } from "./runtime.js";
1+
/* #if USE_SHARED_MEMORY */
2+
import type { SwiftRuntimeThreadChannel } from "./runtime.js";
3+
/* #endif */
24

35
/* #if HAS_BRIDGE */
46
export type { Imports, Exports } from "./bridge-js.js";
@@ -50,6 +52,12 @@ export interface WASI {
5052
extractFile?(path: string): Uint8Array | undefined
5153
}
5254

55+
export type SwiftRuntime = {
56+
UnsafeEventLoopYield: { [Symbol.hasInstance]: (value: unknown) => boolean }
57+
main(): void;
58+
startThread(tid: number, startArg: number): void;
59+
}
60+
5361
export type ModuleSource = WebAssembly.Module | ArrayBufferView | ArrayBuffer | Response | PromiseLike<Response>
5462

5563
/**

0 commit comments

Comments
 (0)