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

62 строки
2.4 KiB

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. * Child node utility.
  5. */
  6. class CharacterDataUtility {
  7. /**
  8. * Appends the given DOMString to the CharacterData.data string; when this method returns, data contains the concatenated DOMString.
  9. *
  10. * @param characterData Character data.
  11. * @param data Data.
  12. */
  13. static appendData(characterData, data) {
  14. characterData.data += data;
  15. }
  16. /**
  17. * Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data string; when this method returns, data contains the shortened DOMString.
  18. *
  19. * @param characterData Character data.
  20. * @param offset Offset.
  21. * @param count Count.
  22. */
  23. static deleteData(characterData, offset, count) {
  24. characterData.data =
  25. characterData.data.substring(0, offset) + characterData.data.substring(offset + count);
  26. }
  27. /**
  28. * Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method returns, data contains the modified DOMString.
  29. *
  30. * @param characterData Character data.
  31. * @param offset Offset.
  32. * @param data Data.
  33. */
  34. static insertData(characterData, offset, data) {
  35. characterData.data =
  36. characterData.data.substring(0, offset) + data + characterData.data.substring(offset);
  37. }
  38. /**
  39. * Replaces the specified amount of characters, starting at the specified offset, with the specified DOMString; when this method returns, data contains the modified DOMString.
  40. *
  41. * @param characterData Character data.
  42. * @param offset Offset.
  43. * @param count Count.
  44. * @param data Data.
  45. */
  46. static replaceData(characterData, offset, count, data) {
  47. characterData.data =
  48. characterData.data.substring(0, offset) + data + characterData.data.substring(offset + count);
  49. }
  50. /**
  51. * Returns a DOMString containing the part of CharacterData.data of the specified length and starting at the specified offset.
  52. *
  53. * @param characterData Character data.
  54. * @param offset Offset.
  55. * @param count Count.
  56. */
  57. static substringData(characterData, offset, count) {
  58. return characterData.data.substring(offset, offset + count);
  59. }
  60. }
  61. exports.default = CharacterDataUtility;
  62. //# sourceMappingURL=CharacterDataUtility.js.map