Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Expoprt process as a worker
import * as Comlink from "comlink";
import Process from "../process/process";
Comlink.expose(Process);
// }
// // add file to output
// });
// localStream.pipeTo(remoteStream);
// }
/**
* Forward progress events to main thread
*/
async setup(handler) {
onProgress.handler = handler;
}
}
Comlink.expose(PenumbraZipWorker);
validate.BIDS(files, options, (issues, summary) =>
resolve({ issues, summary }),
)
})
async function runValidator(files, options, cb) {
let error, output
try {
output = await asyncValidateBIDS(files, options)
} catch (err) {
error = err
}
cb({ error, output })
}
Comlink.expose(runValidator)
// satisfies linters
export default null
listenForChannel().then(port => {
console.log('[AuxChannel.worker] Got port, exposing API');
expose(AuxImpl, port);
});
import { LocalPersistencePlugin } from "../helpers/LocalPersistencePlugin"
import * as Comlink from "comlink"
import { Repository } from "../../../core/models/Repository"
Repository.plugins.push(LocalPersistencePlugin)
Comlink.expose(Repository, self)
};
async function loadInstruments(instrumentIds: number[], drums?: boolean) {
const promises = instrumentIds.map(instrumentId => {
const { value } = getInstrumentById(instrumentId.toString(10));
return loadSoundFont(value);
});
const drumPromise = drums ? loadSoundFont(null, true) : undefined;
await Promise.all([...promises, ...(drumPromise ? [drumPromise] : [])]);
return midiFontData;
}
Comlink.expose(loadInstruments);
if (isNotMidi(isString(filePath) ? filePath : name)) {
const text = await res.text();
vrv.loadData(text);
const base64Midi = vrv.renderToMIDI();
arrayBuffer = base64ToArrayBuffer(base64Midi);
} else {
arrayBuffer = await res.arrayBuffer();
}
const midi = new MidiParser(arrayBuffer, name);
return midi.parse();
};
Comlink.expose(parseMidi);
importScripts("/berror.js");
importScripts("/reason.js");
const Comlink = require("comlink");
const obj = {
execute: evaluator.execute,
reset: evaluator.reset,
reasonSyntax: evaluator.reasonSyntax,
mlSyntax: evaluator.mlSyntax,
parseError: berror.parse,
};
Comlink.expose(obj, self);
'../webp/decoder');
return decode(data);
}
const exports = {
mozjpegEncode,
quantize,
rotate,
resize,
optiPngEncode,
webpEncode,
webpDecode,
};
export type ProcessorWorkerApi = typeof exports;
expose(exports, self);
export function exposeAPI(app: App) {
self.parent.postMessage({ type: 'READY', version: MAJOR_VERSION }, '*');
self.addEventListener('message', (event: MessageEvent) => {
if (event.data !== 'READY?') {
return;
}
event.stopImmediatePropagation();
self.parent.postMessage({ type: 'READY', version: MAJOR_VERSION } as ReadyMessage, '*');
});
expose(new API(app), self.parent);
}