developit / developit/workerize-loader

Typescript types?

Aperta
#3 16 commenti 14 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
JavaScript
Stelle
2.3k
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Its a bit difficult to write a definition file... any ideas how to handle that?

Would be easier if the export was the factory function that returns the exported functions:

```js
export default function worker() {
function expensive(time) {
let start = Date.now(), count = 0
while (Date.now() - start < time) count++
return count
}
return {expensive}
}
```

then the types would be identical if the functions return promises.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.