import { WorkerService, remoteGraphRoutes, workerCanvasRoutes, nodeTemplates //GPUService, } from 'graphscript'//'../../graphscript/index'//'graphscript'// import { streamWorkerRoutes } from './stream.routes'; import { webglPlotRoutes } from 'graphscript-services'; //"../../graphscript/extras/index.services"// import {Devices} from './devices/third_party/index' import { csvRoutes, BFSRoutes } from 'graphscript-services.storage'//'../../graphscript/src/extras/index.storage.services'//'graphscript-services.storage'//"../../GraphServiceRouter/extras/index.storage.services"//'graphscript-services'//"../../GraphServiceRouter/extras/index.services" import { algorithms } from 'graphscript-services' import { gpualgorithms } from 'graphscript-services.gpu' //'graphscript-services'; // Object.assign(nodeTemplates, algorithms); Object.assign(nodeTemplates, gpualgorithms); declare var WorkerGlobalScope; if(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { globalThis.Devices = Devices; //access all devices incl third party (bloated) const worker = new WorkerService({ //props:{} //could set the props instead of globalThis but it really does not matter unless you want to bake in for more complex service modules roots:{ //GPUService as any, ...workerCanvasRoutes, //unsafeRoutes, //allows dynamic route loading ...remoteGraphRoutes, ...BFSRoutes, ...csvRoutes, ...streamWorkerRoutes, ...webglPlotRoutes } }); console.log('worker', worker) } export default self as any;