Module 访问TypeScript中嵌套模块的接口/类

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?

我有一个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?
}
我尝试使用:

  • 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;
}

这个答案肯定比投一票更有价值;)