Is there a way to wrap a SharedWorker in a Promise?

I tried to use webworker-promise to wrap a SharedWorker in a promise based way. But that doesn’t seem to be working. Is there a way to make this work or is there some other library available?

import WebworkerPromise from 'webworker-promise'

const worker = new WebworkerPromise(new SharedWorker('worker.ts'));

dex.js:67 Uncaught (in promise) TypeError: this._worker.postMessage is not a function
    at index.js:67:20
    at new Promise (<anonymous>)
    at Worker.postMessage (index.js:64:12)