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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

No files, tests, or entry points are named. Start by reviewing the 16-comment discussion and the current workerize-loader export behavior, then clarify whether the goal is a TypeScript definition file, a factory-function export, or both; done requires an agreed API and corresponding typings.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript, webpack
领域
build-system, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。