UNPKG

signalk-server

Version:

An implementation of a [Signal K](http://signalk.org) server for boats.

40 lines 1.79 kB
/** * WASM Weather Provider Support * * Handles weather provider registration and handler invocation for WASM plugins. * Integrates with Signal K's Weather API at /signalk/v2/api/weather */ import { WasmWeatherProvider, WasmPluginInstance } from '../types'; /** * Registered weather providers from WASM plugins * Key: pluginId */ export declare const wasmWeatherProviders: Map<string, WasmWeatherProvider>; /** * Call a WASM weather handler function * Handles both AssemblyScript and Rust plugins with Asyncify support for async operations */ export declare function callWasmWeatherHandler(pluginInstance: WasmPluginInstance, handlerName: string, requestJson: string): Promise<string | null>; /** * Update weather provider references with a newly loaded plugin instance */ export declare function updateWeatherProviderInstance(pluginId: string, pluginInstance: WasmPluginInstance): void; /** * Clean up weather provider registrations for a plugin * @param pluginId The plugin ID * @param app The Signal K app (optional, if provided will also unregister from WeatherApi) */ export declare function cleanupWeatherProviders(pluginId: string, app?: any): void; /** * Create the sk_register_weather_provider host binding * * WASM plugins call this to register as a weather provider. * The plugin must export handler functions: * - weather_get_observations(requestJson) -> responseJson * - weather_get_forecasts(requestJson) -> responseJson * - weather_get_warnings(requestJson) -> responseJson */ export declare function createWeatherProviderBinding(pluginId: string, capabilities: { weatherProvider?: boolean; }, app: any, readUtf8String: (ptr: number, len: number) => string): (namePtr: number, nameLen: number) => number; //# sourceMappingURL=weather-provider.d.ts.map