版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
1.4 KiB

  1. import HTMLCollection from '../element/HTMLCollection';
  2. import IHTMLOptGroupElement from '../html-opt-group-element/IHTMLOptGroupElement';
  3. import IHTMLSelectElement from '../html-select-element/IHTMLSelectElement';
  4. import IHTMLOptionElement from './IHTMLOptionElement';
  5. import IHTMLOptionsCollection from './IHTMLOptionsCollection';
  6. /**
  7. * HTML Options Collection.
  8. *
  9. * Reference:
  10. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection.
  11. */
  12. export default class HTMLOptionsCollection extends HTMLCollection implements IHTMLOptionsCollection {
  13. private _selectElement;
  14. /**
  15. *
  16. * @param selectElement
  17. */
  18. constructor(selectElement: IHTMLSelectElement);
  19. /**
  20. * Returns selectedIndex.
  21. *
  22. * @returns SelectedIndex.
  23. */
  24. get selectedIndex(): number;
  25. /**
  26. * Sets selectedIndex.
  27. *
  28. * @param selectedIndex SelectedIndex.
  29. */
  30. set selectedIndex(selectedIndex: number);
  31. /**
  32. * Returns item by index.
  33. *
  34. * @param index Index.
  35. */
  36. item(index: number): IHTMLOptionElement | IHTMLOptGroupElement;
  37. /**
  38. *
  39. * @param element
  40. * @param before
  41. */
  42. add(element: IHTMLOptionElement | IHTMLOptGroupElement, before?: number | IHTMLOptionElement | IHTMLOptGroupElement): void;
  43. /**
  44. * Removes indexed element from collection.
  45. *
  46. * @param index Index.
  47. */
  48. remove(index: number): void;
  49. }