2
我試圖內的NodeJS使用Dictionary類從typescript-collections:的NodeJS,打字稿及打字稿的集合
/// <reference path="../../../scripts/collections.ts" />
var collections = require('../../../scripts/collections');
export class AsyncProcessorCommand implements interfaces.IAsyncProcessorCommand
{
public static Type = 'RabbitMon.AsyncProcessorCommand:RabbitMon';
public GetType =() => 'RabbitMon.AsyncProcessorCommand:RabbitMon';
public ID: string;
constructor(public Action: string, public Arguments?: collections.Dictionary<string, string>) {
this.ID = uuid.v4();
this.Arguments = new collections.Dictionary<string, string>();
//I've also tried the following
//this.Arguments = new collections.Dictionary<string, string>((key: string) => sha1(key));
}
}
但我不斷收到對new Dictionary
以下錯誤:
TypeError: undefined is not a function
任何人都知道這裏發生了什麼?我也非常樂意用一個更好的TS收藏庫替代...
它感覺有點凌亂,但是,是的,這工作。 – Michael