declare namespace __Legacy {
  export class LegacyClass {}
}

declare module "legacy" {
  export = __Legacy;
}

declare namespace LegacyGlobals {
  import Legacy = __Legacy;
  
  class LegacySubclass extends Legacy.LegacyClass {}
}
