text.js 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. CKEDITOR.define( [], () => {
  7. /**
  8. * Data structure for text with attributes. Note that the `Text` is not a {@link document.Node},
  9. * because it will never be part of the document tree. {@link document.Character is a node}.
  10. *
  11. * @class document.Text
  12. */
  13. class Text {
  14. /**
  15. * Creates a text with attributes.
  16. *
  17. * @param {String} text Described text.
  18. * @param {Iterable} attrs Iterable collection of {@link document.Attribute attributes}.
  19. * @constructor
  20. */
  21. constructor( text, attrs ) {
  22. /**
  23. * Text.
  24. *
  25. * @readonly
  26. * @property {String}
  27. */
  28. this.text = text;
  29. /**
  30. * Iterable collection of {@link document.Attribute attributes}.
  31. *
  32. * @property {Iterable}
  33. */
  34. this.attrs = attrs;
  35. }
  36. }
  37. return Text;
  38. } );