我想在Typescript中使用異步庫;我已經安裝了定義文件,是由分型提供,但我不能使用AsyncFunction:Nodejs,Typescript,typings:如何使用異步庫
///<reference path='typings/index.d.ts' />
'use strict';
import async = require('async');
let functions : AsyncFunction<any>[] = [];
如果我編譯該提取物我得到這個錯誤:
tsc test.ts --target es2015 --module system --removeComments --forceConsistentCasingInFileNames --noEmitOnError --noFallthroughCasesInSwitch --noImplicitAny --noImplicitReturns --noImplicitUseStrict --declaration --outfile a.js
test.ts(4,17): error TS2304: Cannot find name 'AsyncFunction'.
我使用的異步定義文件這個:https://raw.githubusercontent.com/types/npm-async/ff63908a70ec51b775d9a6b8afac9945b12fbe08/2/index.d.ts
我做錯了什麼?
謝謝!
如果有人遇到同樣的問題,我的解決方案是安裝全局定義dt〜async – Steve81