A Product Template that is responsible for loading/unloading resources and used in creating Products, given a namespace/name and optional version.

Constructors

  • Constructor.

    Parameters

    • visual: Visual

      The visual instance that will be used when creating the ProductTemplate.

    • namespace: string

      The namespace of the Product Template.

    • name: string

      The name of the Product Template.

    • Optional version: number

      The version number of the Product Template. If the version is omitted, then the latest version of the CI that is supported by the client will be used.

    Returns ProductTemplate

Accessors

  • get destroyed(): boolean
  • State of instance destructions.

    Returns boolean

    The state of instance destructions.

  • get id(): string
  • The unique id of the Product Template.

    Returns string

    The id of the Product Template.

  • get loadTime(): number
  • Gets the time it took for the ProductTemplate to load.

    Returns number

    The time in seconds it took to load the ProductTemplate.

  • get loaded(): boolean
  • Gets the loaded state of the ProductTemplate. Will return true if the ProductTemplate has finished loading.

    Returns boolean

    The loaded state of the ProductTemplate.

  • get name(): string
  • The name of the Product Template.

    Returns string

    The name of the Product Template.

  • get namespace(): string
  • The namespace of the Product Template.

    Returns string

    The namespace of the Product Template.

  • get version(): number
  • The version of the Product Template. Will be populated after load if not specified up front

    Returns number

    The version of the Product Template.

  • get visual(): Visual
  • The visual instance that is attached to this Product Template.

    Returns Visual

    The visual instance of the Product Template.

Methods

  • Destroys the ProductTemplate and releases all of it's resources.

    Returns Promise<void>

    Resolves when the ProductTemplate is destroyed.

  • Gets a Product by its unique id that was created from this ProductTemplate.

    Parameters

    • id: string

      The unique id associated with this Product to find.

    Returns Product

    A Product that matches the unique id that was passed in.

  • Gets a list of all the Products that have been created from this template.

    Returns Product[]

    A list of Product instances that were created from this template.

  • Loads the assets and resources that are needed in order to instantiate Products based off of this ProductTemplate.

    Returns Promise<void>

    Resolves when the initial loading of the assets and resources are complete.

  • Registers an event with callback to track event progress

    Parameters

    • name: "finalLoad"

      The name of the event to track

    • Optional callback: (() => Promise<void>)

      Optional function to execute once event finishes

        • (): Promise<void>
        • Returns Promise<void>

    Returns Promise<void>

    A promise that will resolve once the event is completed

Generated using TypeDoc