chromium/third_party/polymer/v3_0/components-chromium/iron-selector/iron-selection.d.ts

/**
 * DO NOT EDIT
 *
 * This file was automatically generated by
 *   https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
 *
 * To modify these typings, edit the source file(s):
 *   iron-selection.js
 */

export {IronSelection};

declare class IronSelection {
  constructor(selectCallback: Function);

  /**
   * Retrieves the selected item(s).
   *
   * @returns Returns the selected item(s). If the multi property is true,
   * `get` will return an array, otherwise it will return
   * the selected item or undefined if there is no selection.
   */
  get(): any;

  /**
   * Clears all the selection except the ones indicated.
   *
   * @param excludes items to be excluded.
   */
  clear(excludes: any[]|null): void;

  /**
   * Indicates if a given item is selected.
   *
   * @param item The item whose selection state should be checked.
   * @returns Returns true if `item` is selected.
   */
  isSelected(item: any): boolean;

  /**
   * Sets the selection state for a given item to either selected or deselected.
   *
   * @param item The item to select.
   * @param isSelected True for selected, false for deselected.
   */
  setItemSelected(item: any, isSelected: boolean): void;

  /**
   * Sets the selection state for a given item. If the `multi` property
   * is true, then the selected state of `item` will be toggled; otherwise
   * the `item` will be selected.
   *
   * @param item The item to select.
   */
  select(item: any): void;

  /**
   * Toggles the selection state for `item`.
   *
   * @param item The item to toggle.
   */
  toggle(item: any): void;
}