版博士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.

преди 1 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. }