signalk-server
Version:
An implementation of a [Signal K](http://signalk.org) server for boats.
72 lines • 2.42 kB
TypeScript
/**
* WASM Runtime Management
*
* Handles WASM runtime initialization, module loading,
* and instance lifecycle management for Signal K WASM plugins.
*
* This is the main entry point that coordinates the various loaders
* and bindings for different WASM plugin formats.
*/
export { WasmCapabilities, WasmFormat, WasmPluginInstance, WasmPluginExports, WasmResourceProvider } from './types';
export { detectWasmFormat } from './utils/format-detection';
import { wasmResourceProviders } from './bindings/resource-provider';
import { wasmWeatherProviders } from './bindings/weather-provider';
import { WasmPluginInstance, WasmCapabilities } from './types';
export { wasmResourceProviders, wasmWeatherProviders };
export declare class WasmRuntime {
private instances;
private enabled;
constructor();
/**
* Check if WASM support is enabled
*/
isEnabled(): boolean;
/**
* Enable or disable WASM plugin support
*/
setEnabled(enabled: boolean): void;
/**
* Load and instantiate a WASM plugin module
*/
loadPlugin(pluginId: string, wasmPath: string, vfsRoot: string, capabilities: WasmCapabilities, app?: any): Promise<WasmPluginInstance>;
/**
* Unload a WASM plugin instance
* @param pluginId The plugin ID to unload
* @param app Optional Signal K app reference for proper API cleanup
*/
unloadPlugin(pluginId: string, app?: any): Promise<void>;
/**
* Reload a WASM plugin (unload + load)
*/
reloadPlugin(pluginId: string): Promise<WasmPluginInstance>;
/**
* Get a loaded plugin instance
*/
getInstance(pluginId: string): WasmPluginInstance | undefined;
/**
* Get all loaded plugin instances
*/
getAllInstances(): WasmPluginInstance[];
/**
* Check if a plugin is loaded
*/
isPluginLoaded(pluginId: string): boolean;
/**
* Shutdown the WASM runtime and unload all plugins
*/
shutdown(): Promise<void>;
}
/**
* Get the global WASM runtime instance
*/
export declare function getWasmRuntime(): WasmRuntime;
/**
* Initialize the WASM runtime
*/
export declare function initializeWasmRuntime(): WasmRuntime;
/**
* Reset the WASM runtime singleton (for hotplug support)
* This should be called after shutdown to allow re-initialization
*/
export declare function resetWasmRuntime(): void;
//# sourceMappingURL=wasm-runtime.d.ts.map