Q: AngularJS 1.8 and ES6 modules: how to make an service or factory that "passes through" a class based API interface? I am gradually improving a codebase that originally had some AngularJs in various versions and some code that was not in a framework at all using various versions of a software API. (For some reason this API is available - to pages loaded through the application - on AngularJS's $window.external...go figure.)
In my pre-ES6, AngularJs 1.8 phase, I have three services that interact with the software's API (call them someAPIget, someAPIset, and someAPIforms). Something like this:
// someAPIget.service.js 
;(function () {
  var APIget = function ($window, helperfunctions) {
  function someFunc (param) {
    // Do something with $window.external.someExternalFunc
    return doSomethingWith(param)
    }
  return {
    someFunc: someFunc
    }
  }
  angular.module('someAPIModule').factory('someAPIget', ['$window', 'helperfunctions', someAPIget])
})()

I then had a service and module a level up from this, with someAPIModule as a dependency, that aggregated these functions and passed them through under one name, like this:
// apiinterface.service.js 
;(function () {
  // Change these lines to switch which API service all functions will use.
  var APIget = 'someAPIget'
  var APIset = 'someAPIset'
  var APIforms = 'someAPIforms'
  var APIInterface = function (APIget, APIset, APIforms) {
    return {
      someFunc: APIget.someFunc,
      someSettingFunc: APIset.someSettingFunc,
      someFormLoadingFunc: APIforms.someFormLoadingFunc
    }
  }
  angular.module('APIInterface').factory('APIInterface', [APIget, APIset, APIforms, APIInterface])
})()

I would then call these functions in various other controllers and services by using APIInterface.someFunc(etc). It worked fine, and if we switch to a different software provider, we can use our same pages without rewriting everything, just the interface logic.
However, I'm trying to upgrade to Typescript and ES6 so I can use import and export and build some logic accessible via command line, plus prepare for upgrading to Angular 11 or whatever the latest version is when I'm ready to do it. So I rebuilt someAPIget to a class:
// someAPIget.service.ts
export class someAPIget {
  private readonly $window
  private readonly helperfunctions
  static $inject = ['$window', 'helperfunctions']

  constructor ($window, helperfunctions) {
    this.$window = $window
    this.helperfunctions = helperfunctions
    }

  someFunc (param) {
    // Do something with this.$window.external.someExternalFunc
    return doSomethingWith(param)
    }
  }
}

angular
  .module('someAPImodule')
  .service('someAPIget', ['$window', 'helperfunctions', someAPIget])

Initially it seemed like it worked (my tests still pass, or at least after a bit of cleanup in the Typescript compilation department they do), but then when I load it into the live app... this.$window is not defined. If, however, I use a direct dependency and call someAPIget.someFunc(param) instead of through APIInterface.someFunc(param) it works fine (but I really don't want to rewrite thousands of lines of code using APIInterface for the calls, plus it will moot the whole point of wrapping it in an interface to begin with).  I've tried making APIInterface into a class and assigning getters for every function that return the imported function, but $window still isn't defined. Using console.log statements I can see that this.$window is defined inside someFunc itself, and it's defined inside the getter in APIInterface, but from what I can tell when I try to call it using APIInterface it's calling it without first running the constructor on someAPIget, even if I make sure to use $onInit() for the relevant calls.
I feel like I am missing something simple here. Is there some way to properly aggregate and rename these functions to use throughout my program? How do alias them correctly to a post-constructed version?
Edit to add: I have tried with someAPIget as both a factory and a service, and APIInterface as both a factory and a service, and by calling APIInterface in the .run() of the overall app.module.ts file, none of which works. (The last one just changes the location of the undefined error.)
Edit again: I have also tried using static for such a case, which is somewhat obviously wrong, but then at least I get the helpful error highlight in VSCode of Property 'someProp' is used before its initialization.ts(2729).
How exactly are you supposed to use a property that is assigned in the constructor? How can I force AngularJS to execute the constructor before attempting to access the class's members?

A: I am not at all convinced that I found an optimal or "correct" solution, but I did find one that works, which I'll share here in case it helps anyone else.
I ended up calling each imported function in a class method of the same name on the APIInterface class, something like this:
// apiinterface.service.ts 
// Change these lines to switch which API service all functions will use.
const APIget = 'someAPIget'
const APIset = 'someAPIset'
const APIforms = 'someAPIforms'

export class APIInterface {
  private readonly APIget
  private readonly APIset
  private readonly APIforms

  constructor (APIget, APIset, APIforms) {
    this.APIget = APIget
    this.APIset = APIset
    this.APIforms = APIforms
  }

  someFunc(param: string): string {
    return this.APIget.someFunc(param)
  }
  someSettingFunc(param: string): string {
    return this.APIset.someSettingFunc(param)
  }
  someFormLoadingFunc(param: string): string {
    return this.APIforms.someFormLoadingFunc(param)
  }
    
}

angular
  .module('APIInterface')
  .factory('APIInterface', [APIget, APIset, APIforms, APIInterface])

It feels hacky to me, but it does work.
Later Update:
I am now using Angular12, not AngularJS, so some details may be a bit different. Lately I have been looking at using the public-api.ts file that Angular12 generates to accomplish the same thing (ie, export { someAPIget as APIget } from './filename' but have not yet experimented with this, since it would still require either consolidating my functions somehow or rewriting the code that consumes them to use one of three possible solutions. It would be nice not to have to duplicate function signatures and doc strings however. It's still a question I'm trying to answer more effectively, I will update again if I find something that really works.
