Docs (4.0.0)
class ConfigOptions method

init

Returns an instance of the options object, from the argument passed to a constructor or factory function.

static

static init<TInstance extends ConfigOptions>(this: new () => TInstance, configArg?: ConfigOptions.Arg<TInstance>): TInstance

Notes

  • If the argument is an instance of the options object, it is returned as-is
  • If the argument is a callback (configuration) function, it is called with a new instance of the options object, and the instance is returned
  • If the argument is undefined, a new instance of the options object is returned

Parameters

  • configArg — The argument that was passed to the constructor or factory function, and will be used to initialize the options object

Related

  • class ConfigOptions abstractA base class for options objects that can be passed to a constructor or factory function.