text.d.ts 872 B

1234567891011121314151617181920212223242526272829303132
  1. import NodeType from './type';
  2. import Node from './node';
  3. import HTMLElement from './html';
  4. /**
  5. * TextNode to contain a text element in DOM tree.
  6. * @param {string} value [description]
  7. */
  8. export default class TextNode extends Node {
  9. rawText: string;
  10. constructor(rawText: string, parentNode: HTMLElement);
  11. /**
  12. * Node Type declaration.
  13. * @type {Number}
  14. */
  15. nodeType: NodeType;
  16. private _trimmedText?;
  17. /**
  18. * Returns text with all whitespace trimmed except single leading/trailing non-breaking space
  19. */
  20. get trimmedText(): string;
  21. /**
  22. * Get unescaped text value of current node and its children.
  23. * @return {string} text content
  24. */
  25. get text(): string;
  26. /**
  27. * Detect if the node contains only white space.
  28. * @return {bool}
  29. */
  30. get isWhitespace(): boolean;
  31. toString(): string;
  32. }