motely-wasm 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ import { RuntimeConfig, RuntimeAPI } from "./modules";
2
+ import { BootResources } from "./resources";
3
+ /** Lifecycle status of the runtime module. */
4
+ export declare enum BootStatus {
5
+ /** Ready to boot. */
6
+ Standby = 0,
7
+ /** Async boot process is in progress. */
8
+ Booting = 1,
9
+ /** Booted and ready for interop. */
10
+ Booted = 2
11
+ }
12
+ /** Boot process configuration. */
13
+ export type BootOptions = {
14
+ /** Absolute path to the directory where boot resources are hosted (eg, <code>/bin</code>). */
15
+ readonly root?: string;
16
+ /** Resources required to boot .NET runtime. */
17
+ readonly resources?: BootResources;
18
+ /** .NET runtime configuration. */
19
+ readonly config?: RuntimeConfig;
20
+ /** Creates .NET runtime instance. */
21
+ readonly create?: (config: RuntimeConfig) => Promise<RuntimeAPI>;
22
+ /** Binds imported C# APIs. */
23
+ readonly import?: (runtime: RuntimeAPI) => Promise<void>;
24
+ /** Starts .NET runtime. */
25
+ readonly run?: (runtime: RuntimeAPI) => Promise<void>;
26
+ /** Binds exported C# APIs. */
27
+ readonly export?: (runtime: RuntimeAPI) => Promise<void>;
28
+ };
29
+ /** Returns current runtime module lifecycle state. */
30
+ export declare function getStatus(): BootStatus;
31
+ /** Initializes .NET runtime and binds C# APIs.
32
+ * @param options Specify to configure the boot process.
33
+ * @return Promise that resolves into .NET runtime instance. */
34
+ export declare function boot(options?: BootOptions): Promise<RuntimeAPI>;
35
+ /** Terminates .NET runtime and removes WASM module from memory.
36
+ * @param code Exit code; will use 0 (normal exit) by default.
37
+ * @param reason Exit reason description (optional). */
38
+ export declare function exit(code?: number, reason?: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { RuntimeConfig } from "./modules";
2
+ import { BootResources } from "./resources";
3
+ /** Builds .NET runtime configuration.
4
+ * @param resources Resources required for runtime initialization.
5
+ * @param root When specified, assumes boot resources are side-loaded from the specified root. */
6
+ export declare function buildConfig(resources: BootResources, root?: string): Promise<RuntimeConfig>;
@@ -0,0 +1 @@
1
+ export declare function decodeBase64(source: string): ArrayBuffer;