Range.hx 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (C)2005-2013 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated, do not edit!
  23. package js.html;
  24. /** <p>The <code>Range</code> object represents a fragment of a document that can contain nodes and parts of text nodes in a given document.</p>
  25. <p>A range can be created using the <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/Document.createRange">Document.createRange</a></code>
  26. &nbsp;method of the&nbsp;<code><a rel="custom" href="https://developer.mozilla.org/en/DOM/Document">Document</a></code>
  27. &nbsp;object. Range objects can also be retrieved by using the <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Selection.getRangeAt" class="new">Selection.getRangeAt</a></code>
  28. &nbsp;method of the&nbsp;<code><a rel="custom" href="/api/js/html/DOMSelection">Selection</a></code>
  29. &nbsp;object.</p><br><br>
  30. Documentation for this class was provided by <a href="https://developer.mozilla.org/en/DOM/range">MDN</a>. */
  31. @:native("Range")
  32. extern class Range
  33. {
  34. static inline var END_TO_END : Int = 2;
  35. static inline var END_TO_START : Int = 3;
  36. static inline var NODE_AFTER : Int = 1;
  37. static inline var NODE_BEFORE : Int = 0;
  38. static inline var NODE_BEFORE_AND_AFTER : Int = 2;
  39. static inline var NODE_INSIDE : Int = 3;
  40. static inline var START_TO_END : Int = 1;
  41. static inline var START_TO_START : Int = 0;
  42. /** Returns a&nbsp;<code>boolean</code>&nbsp;indicating whether the range's start and end points are at the same position. Getter throws DOMException. */
  43. var collapsed(default,null) : Bool;
  44. /** Returns the deepest&nbsp;<code><a rel="custom" href="https://developer.mozilla.org/en/DOM/Node">Node</a></code>
  45. &nbsp;that contains the startContainer and endContainer Nodes. Getter throws DOMException. */
  46. var commonAncestorContainer(default,null) : Node;
  47. /** Returns the&nbsp;<code><a rel="custom" href="https://developer.mozilla.org/en/DOM/Node">Node</a></code>
  48. &nbsp;within which the Range ends. Getter throws DOMException. */
  49. var endContainer(default,null) : Node;
  50. /** Returns a number representing where in the endContainer the Range ends. Getter throws DOMException. */
  51. var endOffset(default,null) : Int;
  52. /** Returns the&nbsp;<code><a rel="custom" href="https://developer.mozilla.org/en/DOM/Node">Node</a></code>
  53. &nbsp;within which the Range starts. Getter throws DOMException. */
  54. var startContainer(default,null) : Node;
  55. /** Returns a number representing where in the startContainer the Range starts. Getter throws DOMException. */
  56. var startOffset(default,null) : Int;
  57. function cloneContents() : DocumentFragment;
  58. function cloneRange() : Range;
  59. function collapse( toStart : Bool ) : Void;
  60. function compareBoundaryPoints( how : Int, sourceRange : Range ) : Int;
  61. function compareNode( refNode : Node ) : Int;
  62. function comparePoint( refNode : Node, offset : Int ) : Int;
  63. function createContextualFragment( html : String ) : DocumentFragment;
  64. function deleteContents() : Void;
  65. function detach() : Void;
  66. function expand( unit : String ) : Void;
  67. function extractContents() : DocumentFragment;
  68. function getBoundingClientRect() : ClientRect;
  69. function getClientRects() : ClientRectList;
  70. function insertNode( newNode : Node ) : Void;
  71. function intersectsNode( refNode : Node ) : Bool;
  72. function isPointInRange( refNode : Node, offset : Int ) : Bool;
  73. function selectNode( refNode : Node ) : Void;
  74. function selectNodeContents( refNode : Node ) : Void;
  75. function setEnd( refNode : Node, offset : Int ) : Void;
  76. function setEndAfter( refNode : Node ) : Void;
  77. function setEndBefore( refNode : Node ) : Void;
  78. function setStart( refNode : Node, offset : Int ) : Void;
  79. function setStartAfter( refNode : Node ) : Void;
  80. function setStartBefore( refNode : Node ) : Void;
  81. function surroundContents( newParent : Node ) : Void;
  82. function toString() : String;
  83. }