constructor(templateName, targetDir, { templateParams = {}, entrypoint, noOverwriteGlobs, disabledHooks, output = 'fs', forceWrite = false, install = false, debug = false, mapBaseUrlToFolder = {}, registry = {}, compile = true } = {}) {
    const options = arguments[arguments.length - 1];
    this.verifyoptions(options);
    if (!templateName) throw new Error('No template name has been specified.');
    if (!entrypoint && !targetDir) throw new Error('No target directory has been specified.');
    if (!['fs', 'string'].includes(output)) throw new Error(`Invalid output type ${output}. Valid values are 'fs' and 'string'.`);
    /** @type {Boolean} Whether to compile the template or use the cached transpiled version provided by template in '__transpiled' folder. */
    this.compile = compile;
    /** @type {Object} Npm registry information. */
    this.registry = registry;
    /** @type {String} Name of the template to generate. */
    this.templateName = templateName;
    /** @type {String} Path to the directory where the files will be generated. */
    this.targetDir = targetDir;
    /** @type {String} Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. */
    this.entrypoint = entrypoint;
    /** @type {String[]} List of globs to skip when regenerating the template. */
    this.noOverwriteGlobs = noOverwriteGlobs || [];
    /** @type {Object<String, Boolean | String | String[]>} Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */
    this.disabledHooks = disabledHooks || {};
    /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */
    this.output = output;
    /** @type {Boolean} Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. */
    this.forceWrite = forceWrite;
    /** @type {Boolean} Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. */
    this.debug = debug;
    /** @type {Boolean} Install the template and its dependencies, even when the template has already been installed. */
    this.install = install;
    /** @type {Object} The template configuration. */
    this.templateConfig = {};
    /** @type {Object} Hooks object with hooks functions grouped by the hook type. */
    this.hooks = {};
    /** @type {Object} Maps schema URL to folder. */
    this.mapBaseUrlToFolder = mapBaseUrlToFolder;

    // Load template configuration
    /** @type {Object} The template parameters. The structure for this object is based on each individual template. */
    this.templateParams = {};
    Object.keys(templateParams).forEach(key => {
      const self = this;
      Object.defineProperty(this.templateParams, key, {
        enumerable: true,
        get() {
          if (!self.templateConfig.parameters?.[key]) {
            throw new Error(`Template parameter "${key}" has not been defined in the Generator Configuration. Please make sure it's listed there before you use it in your template.`);
          }
          return templateParams[key];
        }
      });
    });
  }
Instantiates a new Generator object.

@example
const path = require('path');
const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'));

@example <caption>Passing custom params to the template</caption>
const path = require('path');
const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'), {
  templateParams: {
    sidebarOrganization: 'byTags'
  }
});

@param {String} templateName  Name of the template to generate.
@param {String} targetDir     Path to the directory where the files will be generated.
@param {Object} options
@param {Object<string, string>} [options.templateParams]   Optional parameters to pass to the template. Each template define their own params.
@param {String} [options.entrypoint]       Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template.
@param {String[]} [options.noOverwriteGlobs] List of globs to skip when regenerating the template.
@param {Object<String, Boolean | String | String[]>} [options.disabledHooks] Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array.
@param {String} [options.output='fs'] Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set.
@param {Boolean} [options.forceWrite=false] Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false.
@param {Boolean} [options.install=false] Install the template and its dependencies, even when the template has already been installed.
@param {Boolean} [options.debug=false] Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive.
@param {Boolean} [options.compile=true] Whether to compile the template or use the cached transpiled version provided by template in '__transpiled' folder
@param {Object<String, String>} [options.mapBaseUrlToFolder] Optional parameter to map schema references from a base url to a local base folder e.g. url=https://schema.example.com/crm/  folder=./test/docs/ .
@param {Object} [options.registry]           Optional parameter with private registry configuration
@param {String} [options.registry.url]       Parameter to pass npm registry url
@param {String} [options.registry.auth]      Optional parameter to pass npm registry username and password encoded with base64, formatted like username:password value should be encoded
@param {String} [options.registry.token]     Optional parameter to pass npm registry auth token that you can grab from .npmrc file