RAMP4 - v4.21.0
    Preparing search index...

    Class FixtureAPI

    A base class for anything requiring access to the InstanceApi and instance of Vue app controlled by it.

    APIScope

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The instance of RampMap API scoped to a single Vue R4MP application.

    APIScope

    Accessors

    • get $element(): App<Element>

      Returns App<Element>

    • get $vApp(): ComponentPublicInstance

      The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

      Returns ComponentPublicInstance

      APIScope

    Methods

    • Loads a (built-in) fixture or adds supplied fixture into the R4MP Vue instance.

      Parameters

      • id: string
      • Optionalconstructor: IFixtureBase

      Returns Promise<FixtureBase>

      FixtureAPI

    • Loads the set of standard, built-in fixtures to the R4MP Vue instance. This will quickly set up the vanilla version of RAMP. Note this function is automatically run by the instance startup unless the loadDefaultFixtures option is set to false. The function is exposed to allow custom pages the ability to call it at a different point in the startup. Also, a subset of standard fixtures can be provided on the optional parameter if one wishes to omit some of the standard fixtures.

      Parameters

      • OptionalfixtureNames: string[]

        list of built-in fixtures names to add. omission means all built-in fixtures will be added

      Returns Promise<FixtureBase[]>

      resolves with array of default fixtures

      FixtureAPI

    • Returns whether a given fixture exists.

      Parameters

      • id: string

        the fixture ID to be checked

      Returns boolean

      whether the fixture identified by 'id' exists

      FixtureAPI

    • Remove every fixture whose persist flag is set to false from the R4MP instance. For all other fixtures, simply call their removed hook.

      Returns void

    • Finds and returns a FixtureBase object with the id specified.

      Type Parameters

      • T extends FixtureBase = FixtureBase

        subclass of the FixtureBase; defaults to FixtureBase

      Parameters

      • item: string | FixtureBase

        fixture id or FixtureBase item

      Returns T

      FixtureAPI

    • Finds and returns a collection of FixtureBase objects given a list of ids. This can be useful when retrieving several fixtures at one time as follows:

      const [one, two, three] = rInstance.fixture.get(['fixture-one', 'fixture-two', 'fixture-three']);
      

      Type Parameters

      • T extends FixtureBase = FixtureBase

        subclass of the FixtureBase; defaults to FixtureBase

      Parameters

      • item: string[]

        a list of fixture ids

      Returns T[]

      FixtureAPI

    • Provides a promise that resolves when the fixture(s) have finished loading.

      Type Parameters

      • T extends string | string[]

      Parameters

      • fixtureId: T

        the fixture ID(s) for which the promise is requested

      Returns Promise<T extends string ? FixtureBase : FixtureBase[]>

      FixtureAPI

    • Removes the specified fixture from R4MP instance.

      Type Parameters

      • T extends FixtureBase = FixtureBase

      Parameters

      • fixtureOrId: string | FixtureBase

      Returns T

      FixtureAPI

    • Restores every remaining fixture by calling its added/initialized hooks.

      Returns void