UNPKG

signalk-server

Version:

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

43 lines 1.43 kB
"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ /** * WASM Interface * * Manages the WASM runtime as a Signal K interface. * Can be enabled/disabled via settings.interfaces.wasm */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const wasm_1 = require("../wasm"); const debug = (0, debug_1.default)('signalk:interfaces:wasm'); module.exports = (app) => { const api = {}; api.start = () => { debug('Starting WASM interface'); try { const { wasmRuntime, wasmSubscriptionManager } = (0, wasm_1.initializeWasm)(); app.wasmRuntime = wasmRuntime; app.wasmSubscriptionManager = wasmSubscriptionManager; debug('WASM runtime initialized successfully'); return { enabled: true }; } catch (error) { debug('WASM runtime initialization failed:', error); return { enabled: false, error }; } }; api.stop = () => { debug('Stopping WASM interface'); try { (0, wasm_1.shutdownAllWasmPlugins)(); } catch (error) { debug('WASM shutdown error:', error); } }; return api; }; //# sourceMappingURL=wasm.js.map