Options
All
  • Public
  • Public/Protected
  • All
Menu

A base class for classes that must be constructed and initialized asynchronously.

Type parameters

  • O

Hierarchy

  • AsyncCreatable

Index

Constructors

Methods

Constructors

constructor

  • Constructs a new AsyncCreatable instance. For internal and subclass use only. New subclass instances must be created with the static create method.

    Parameters

    • options: O

      An options object providing initialization params.

    Returns AsyncCreatable

Methods

Protected Abstract init

  • init(): Promise<void>
  • Asynchronously initializes newly constructed instances of a concrete subclass.

    Returns Promise<void>

Static create

  • create<P, T>(this: object, options: P): Promise<T>
  • Asynchronously constructs and initializes a new instance of a concrete subclass with the provided options.

    Type parameters

    Parameters

    • this: object
    • options: P

      An options object providing initialization params to the async constructor.

    Returns Promise<T>