Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve exports
  • Loading branch information
pavelsavara committed Nov 24, 2021
commit 6f84e2a6e12b7a674638edc4e9bb29e7608a212e
11 changes: 9 additions & 2 deletions src/mono/wasm/runtime/export-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
import { DotNetPublicAPI } from "./exports";
import { EmscriptenModuleConfig } from "./types";

// -----------------------------------------------------------
// this files has all public exports from the dotnet.js module
// -----------------------------------------------------------

declare function createDotnetRuntime(moduleFactory: (api: DotNetPublicAPI) => EmscriptenModuleConfig): Promise<DotNetPublicAPI>;
export default createDotnetRuntime;

export declare function getDotnetRuntime(runtimeId: number): DotNetPublicAPI | undefined;
// Here, declare things that go in the global namespace, or augment existing declarations in the global namespace
declare global {
function getDotnetRuntime(runtimeId: number): DotNetPublicAPI | undefined;
}

export default createDotnetRuntime;
16 changes: 10 additions & 6 deletions src/mono/wasm/runtime/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ function initializeImportsAndExports(
BINDING: exports.binding,
INTERNAL: exports.internal,
Module: module,
productVersion,
configuration
RuntimeBuildInfo: {
productVersion,
configuration
}
};

if (module.configSrc) {
Expand Down Expand Up @@ -222,7 +224,7 @@ function initializeImportsAndExports(
else {
list = globalThisAny.getDotnetRuntime.list;
}
api.runtimeId = globalThisAny.getDotnetRuntime.list.length;
api.RuntimeId = globalThisAny.getDotnetRuntime.list.length;
list.push(create_weak_ref(api));

return api;
Expand Down Expand Up @@ -371,7 +373,9 @@ export interface DotNetPublicAPI {
MONO: MONO,
BINDING: BINDING,
Module: any,
runtimeId: number,
productVersion: string,
configuration: string,
RuntimeId: number,
RuntimeBuildInfo: {
productVersion: string,
configuration: string,
}
}