createInstance vs createInstanceWithArguments

I am trying to generate Typescript definitions from the LibreOffice IDL (via Doxygen-generated XML).

The XMultiServiceFactory interface has two methods for creating instances: createInstance and createInstanceWithArguments. However, I can’t seem to find which types require arguments and what they are, and which types don’t require arguments.

This would be of great value in creating these definitions, because Typescript supports multiple overloads based on different values of string parameters. For example, given the following definitions:

namespace {
    namespace lang {
        interface ServiceManager extends XMultiServiceFactory { }
        interface XMultiServiceFactory {
    namespace frame {
        interface theDesktop {
            // members defined here

// This is using the Automation bridge, but the definitions could be written just as easily
// for Javascript macros running via the Rhino interpreter
interface ActiveXObject {
    new(progid: ''):;

Typescript will recognize the appropriate types:

// automatically typed as
let objServiceManager = new ActiveXObject('');

// automatically typed as
let desktop = objServiceManager.createInstance('');

and will issue errors when trying to use a method via desktop that isn’t available on the theDesktop singleton:

// will fail compilation

The alternative is to explicitly cast values to the appropriate type:

let desktop = objServiceManager.createInstance('') as;

How can I know from the documentation whether a given type needs arguments or not, and what those arguments are?

LibreOffice 5.3.5

Windows 10 64-bit