Class FixtureAPI

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

Export

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

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

Memberof

APIScope

Accessors

  • get $element(): App<Element>
  • Returns App<Element>

  • get $vApp(): ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>
  • The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

    Memberof

    APIScope

    Returns ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>

Methods

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

    Memberof

    FixtureAPI

    Parameters

    • id: string
    • Optional constructor: IFixtureBase

    Returns Promise<FixtureBase>

  • 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.

    Memberof

    FixtureAPI

    Parameters

    • Optional fixtureNames: 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

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

    Memberof

    FixtureAPI

    Type Parameters

    • T extends FixtureBase = FixtureBase

      subclass of the FixtureBase; defaults to FixtureBase

    Parameters

    • item: string | FixtureBase

      fixture id or FixtureBase item

    Returns T

  • 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']);
    

    Memberof

    FixtureAPI

    Type Parameters

    • T extends FixtureBase = FixtureBase

      subclass of the FixtureBase; defaults to FixtureBase

    Parameters

    • item: string[]

      a list of fixture ids

    Returns T[]

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

    Memberof

    FixtureAPI

    Parameters

    • fixtureId: string | string[]

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

    Returns Promise<any>

  • Removes the specified fixture from R4MP instance.

    Memberof

    FixtureAPI

    Type Parameters

    • T extends FixtureBase = FixtureBase

    Parameters

    • fixtureOrId: string | FixtureBase

    Returns T

Generated using TypeDoc