请求/请求承诺的 TypeScript 定义不正确:缺少选项 "time"

Incorrect TypeScript definition for request / request-promise: option "time" is missing

在 NodeJS 上使用 TypeScript 并使用 npm request-promise(包装 npm 请求)。

我想使用 "time" 选项来记录记录的往返时间 here "time - If true, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's elapsedTime property" and which is available within the npm as evidenced here

 if (options.time) {
    self.timing = true
    self.elapsedTime = self.elapsedTime || 0
 }

但我能找到的任何请求定义似乎都不支持此选项。

所以我的第一个问题是 - 我读错了吗?

如果没有,我的第二个问题是 - 它不存在有什么原因吗?

最后,如果它应该在那里 - 我可以修改我的本地定义副本,但是,当然,更好的方法是修复存储库定义,我只是不确定最好的方法关于这样做,所以谁能指出我正确的方向?

请求包的类型定义中缺少时间选项的定义:https://github.com/louy/typed-request/blob/master/index.d.ts

类型定义适用于请求包 (https://github.com/typings/registry/blob/master/npm/request.json) 的 2.69 版,可能没有那个时间选项

要修复存储库定义,您可以要求类型请求存储库的作者修复它,或者您可以分叉主存储库,进行更新并向原作者发出拉取请求。 同时,您仍然可以通过以下方式将更新的定义安装到您的项目中:

typings install --save github:<YourGithubUsername>/<RepositoryName>#<CommitSha>