版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

63 строки
1.6 KiB

  1. import IAttr from '../nodes/attr/IAttr';
  2. /**
  3. * NamedNodeMap.
  4. *
  5. * Reference:
  6. * https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.
  7. */
  8. export default interface INamedNodeMap extends Iterable<IAttr> {
  9. [index: number]: IAttr;
  10. [Symbol.toStringTag]: string;
  11. readonly length: number;
  12. /**
  13. * Returns attribute by index.
  14. *
  15. * @param index Index.
  16. */
  17. item: (index: number) => IAttr;
  18. /**
  19. * Returns attribute by name.
  20. *
  21. * @param qualifiedName Name.
  22. * @returns Attribute.
  23. */
  24. getNamedItem: (qualifiedName: string) => IAttr;
  25. /**
  26. * Returns attribute by name and namespace.
  27. *
  28. * @param namespace Namespace.
  29. * @param localName Local name of the attribute.
  30. * @returns Attribute.
  31. */
  32. getNamedItemNS: (namespace: string, localName: string) => IAttr;
  33. /**
  34. * Adds a new attribute node.
  35. *
  36. * @param attr Attribute.
  37. * @returns Replaced attribute.
  38. */
  39. setNamedItem: (attr: IAttr) => IAttr;
  40. /**
  41. * Adds a new namespaced attribute node.
  42. *
  43. * @param attr Attribute.
  44. * @returns Replaced attribute.
  45. */
  46. setNamedItemNS: (attr: IAttr) => IAttr;
  47. /**
  48. * Removes an attribute.
  49. *
  50. * @param qualifiedName Name of the attribute.
  51. * @returns Removed attribute.
  52. */
  53. removeNamedItem: (qualifiedName: string) => IAttr;
  54. /**
  55. * Removes a namespaced attribute.
  56. *
  57. * @param namespace Namespace.
  58. * @param localName Local name of the attribute.
  59. * @returns Removed attribute.
  60. */
  61. removeNamedItemNS: (namespace: string, localName: string) => IAttr;
  62. }