Module 访问TypeScript中嵌套模块的接口/类
我有一个TS模块,它包含一个内部模块,例如:Module 访问TypeScript中嵌套模块的接口/类,module,typescript,Module,Typescript,我有一个TS模块,它包含一个内部模块,例如: module abc.customer.ratings { module abc.customer.ratings.bo { export interface RatingScale { id: number; name: string; type: string; } } var scale: ??? // how to name the inner interface here?
module abc.customer.ratings {
module abc.customer.ratings.bo {
export interface RatingScale {
id: number;
name: string;
type: string;
}
}
var scale: ??? // how to name the inner interface here?
}
我尝试使用:
,仅名称-失败RatingScale
-内部模块名称(如相对路径)+仅名称-失败bo.RatingScale
-从世界之初开始的完整模块路径-有效abc.customer.ratings.bo.RatingScale
module abc.customer.ratings {
module abc.customer.ratings.bo {
export interface RatingScale {
id: number;
name: string;
type: string;
}
}
var scale: ??? // how to name the inner interface here?
}
RatingScale
的完全限定名称是abc.customer.ratings.abc.customer.ratings.bo.RatingScale
。你可能想写的是:
module abc.customer.ratings {
module bo {
export interface RatingScale {
id: number;
name: string;
type: string;
}
}
var scale: bo.RatingScale;
}
这个答案肯定比投一票更有价值;)