在 TypeScript 中访问嵌套模块的 interface/class

Accessing interface/class of a nested module in 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 的完全限定名称是 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;
}