我正在上课比赛:
export class Competition {
competitionName: string;
game: {};
competitors: never[];
winners: never[];
winningAmount: number;
competitionStatus: string;
entryFee: number;
stages: never[];
constructor() {
this.competitionName = "";
this.game = {};
this.competitors = [];
this.winners = [];
this.winningAmount = 0;
this.competitionStatus = "";
this.entryFee = 0;
this.stages = [];
}
}
我正在尝试将其用作另一个类中的函数参数,但我一直在获取
不能使用名称空间“竞争”作为类型。
这是我在其中使用的功能。
import mongoose = require('mongoose');
import competition = require('../models/Competition')
exports.update = function (competitionObject: competition, callback) { CompetitionODM.updateOne(competitionObject,function(err,updatedCompetition) {
callback(err, updatedCompetition);
});
};
请问为什么?