developit / developit/workerize-loader

Typescript types?

未關閉
#3 16 則留言 14 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
JavaScript
星號
2.3k
分支
85
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。