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.

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

    Memberof

    APIScope

Methods

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

    Parameters

    • Optional event: string = ''

      name of the event. Omission will return all active handlers

    Returns string[]

    list of handler names

    Memberof

    EventAPI

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

    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

    Memberof

    EventAPI

  • Private

    Will apply the implementation of default events handlers

    Parameters

    • handlerName: string

      the name of the default event handler to create

    Returns string

    name of the event handler

    Memberof

    EventAPI

  • Triggers an event.

    Parameters

    • event: string

      the name of the event

    • Rest ...args: any[]

      any arguements the event is expecting

    Returns void

    Memberof

    EventAPI

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

    Returns string[]

    list of event names

    Memberof

    EventAPI

  • Private

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

    Parameters

    • handlerName: string

      the name of the event handler

    Returns undefined | EventHandler

    handler information or undefined

    Memberof

    EventAPI

  • Private

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

    Parameters

    • eventName: string

      the name of the event the handler is handling

    Returns string

    a handler name

    Memberof

    EventAPI

  • Removes an event handler from an event.

    Parameters

    • handlerName: string

      name of the handler to remove

    Returns void

    Memberof

    EventAPI

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

    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

    Memberof

    EventAPI

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

    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

    Memberof

    EventAPI

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

    Parameters

    • names: string | string[]

      event names or names to register

    Returns void

    Memberof

    EventAPI

Generated using TypeDoc