Source: events.jsm

/**
 * bluebox.js - A webcomponent to display timelines
 *
 * Copyright (c) 2019, Luis Panadero Guardeño <luis.panadero(at)gmail.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * Event emited when an user changes the current selected time event
 * @event changeSelectedIndex
 * @type CustomEvent
 * @property {number} detail.index - Index of the new selected element . -1 if now it's not selected anything
 * @property {EventData} detail.event - Returns the current EventData selected by the user or null if it's not selected anything
 */
class ChangeSelectedIndexEvent extends CustomEvent {
  
  /**
   * Creates a new ChangeSelectedIndexEvent
   * @param {number} index - Index of the new selected element . -1 if now it's not selected anything
   * @param {EventData} event - Returns the current EventData selected by the user or null if it's not selected anything
   */
  constructor(index, event, options = {}) {
    options.detail = {
      'index': index,
      'event': event
    };
    super("changeSelectedIndex", options);
  }

}

export { ChangeSelectedIndexEvent };