Class EventAPI

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

Export

Hierarchy

Constructors

Properties

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

Memberof

APIScope

_eventBus: any

A vue instance that provides an event bus for all events.

Memberof

EventAPI

_eventRegister: EventHandler[]
_funCounter: number
_nameRegister: string[]

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

  • Returns any active event handlers, filtered to an event name if desired.

    Memberof

    EventAPI

    Parameters

    • Optional event: string = ''

      name of the event. Omission will return all active handlers

    Returns string[]

    list of handler names

  • Loads the set of standard, built-in event handlers 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 loadDefaultEvents 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 event handlers can be provided on the optional parameter if one wishes to omit some of the standard handlers.

    Memberof

    EventAPI

    Parameters

    • Optional eventHandlerNames: string[]

      list of built-in event handler names to add. omission means all built-in event handlers will be added

    Returns string[]

    resolves with array of event handler names

  • Private

    Will apply the implementation of default events handlers

    Memberof

    EventAPI

    Parameters

    • handlerName: string

      the name of the default event handler to create

    Returns string

    name of the event handler

  • Triggers an event.

    Memberof

    EventAPI

    Parameters

    • event: string

      the name of the event

    • Rest ...args: any[]

      any arguements the event is expecting

    Returns void

  • A list of event names that have been registered with the bus.

    Memberof

    EventAPI

    Returns string[]

    list of event names

  • Private

    Locates a registered handler by name, or undefined if not found

    Memberof

    EventAPI

    Parameters

    • handlerName: string

      the name of the event handler

    Returns undefined | EventHandler

    handler information or undefined

  • Private

    Generates an event handler name. Used when caller doesnt provide one.

    Memberof

    EventAPI

    Parameters

    • eventName: string

      the name of the event the handler is handling

    Returns string

    a handler name

  • Removes an event handler from an event.

    Memberof

    EventAPI

    Parameters

    • handlerName: string

      name of the handler to remove

    Returns void

  • Removes all event handlers, filtered to an event name if desired.

    Parameters

    • Optional event: string = ''

      name of the event. Omission will remove all handlers for all events

    Returns void

  • Adds an event handler to an event.

    Memberof

    EventAPI

    Parameters

    • event: string

      name of the event to react to

    • callback: Function

      function to execute when event triggers

    • Optional handlerName: string = ''

      name of the handler (for reference). a name will be generated if not provided.

    Returns string

    the handler name

  • Adds an event handler to an event that will be respected once. After the handler reacts to the event, it will be removed.

    Memberof

    EventAPI

    Parameters

    • event: string

      name of the event to react to once

    • callback: Function

      function to execute when event triggers

    • Optional handlerName: string = ''

      name of the handler (for reference). a name will be generated if not provided.

    Returns string

    the handler name

  • Adds event names to the names registry of the event bus.

    Memberof

    EventAPI

    Parameters

    • names: string | string[]

      event names or names to register

    Returns void

Generated using TypeDoc