|
| 1 | +/** |
| 2 | + * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + * |
| 7 | + * @format |
| 8 | + * @flow strict |
| 9 | + */ |
| 10 | + |
| 11 | +// flowlint unsafe-getters-setters:off |
| 12 | + |
| 13 | +import type NodeList from '../OldStyleCollections/NodeList'; |
| 14 | +import type ReadOnlyElement from './ReadOnlyElement'; |
| 15 | + |
| 16 | +export default class ReadOnlyNode { |
| 17 | + get childNodes(): NodeList<ReadOnlyNode> { |
| 18 | + throw new TypeError('Unimplemented'); |
| 19 | + } |
| 20 | + |
| 21 | + get firstChild(): ReadOnlyNode | null { |
| 22 | + throw new TypeError('Unimplemented'); |
| 23 | + } |
| 24 | + |
| 25 | + get isConnected(): boolean { |
| 26 | + throw new TypeError('Unimplemented'); |
| 27 | + } |
| 28 | + |
| 29 | + get lastChild(): ReadOnlyNode | null { |
| 30 | + throw new TypeError('Unimplemented'); |
| 31 | + } |
| 32 | + |
| 33 | + get nextSibling(): ReadOnlyNode | null { |
| 34 | + throw new TypeError('Unimplemented'); |
| 35 | + } |
| 36 | + |
| 37 | + get nodeName(): string { |
| 38 | + throw new TypeError('Unimplemented'); |
| 39 | + } |
| 40 | + |
| 41 | + get nodeType(): number { |
| 42 | + throw new TypeError('Unimplemented'); |
| 43 | + } |
| 44 | + |
| 45 | + get nodeValue(): string | null { |
| 46 | + throw new TypeError('Unimplemented'); |
| 47 | + } |
| 48 | + |
| 49 | + get parentElement(): ReadOnlyElement | null { |
| 50 | + throw new TypeError('Unimplemented'); |
| 51 | + } |
| 52 | + |
| 53 | + get parentNode(): ReadOnlyNode | null { |
| 54 | + throw new TypeError('Unimplemented'); |
| 55 | + } |
| 56 | + |
| 57 | + get previousSibling(): ReadOnlyNode | null { |
| 58 | + throw new TypeError('Unimplemented'); |
| 59 | + } |
| 60 | + |
| 61 | + get textContent(): string | null { |
| 62 | + throw new TypeError('Unimplemented'); |
| 63 | + } |
| 64 | + |
| 65 | + compareDocumentPosition(otherNode: ReadOnlyNode): number { |
| 66 | + throw new TypeError('Unimplemented'); |
| 67 | + } |
| 68 | + |
| 69 | + contains(otherNode: ReadOnlyNode): boolean { |
| 70 | + throw new TypeError('Unimplemented'); |
| 71 | + } |
| 72 | + |
| 73 | + getRootNode(): ReadOnlyNode { |
| 74 | + throw new TypeError('Unimplemented'); |
| 75 | + } |
| 76 | + |
| 77 | + hasChildNodes(): boolean { |
| 78 | + throw new TypeError('Unimplemented'); |
| 79 | + } |
| 80 | + |
| 81 | + /* |
| 82 | + * Node types, as returned by the `nodeType` property. |
| 83 | + */ |
| 84 | + |
| 85 | + /** |
| 86 | + * Type of Element, HTMLElement and ReactNativeElement instances. |
| 87 | + */ |
| 88 | + static ELEMENT_NODE: number = 1; |
| 89 | + /** |
| 90 | + * Currently Unused in React Native. |
| 91 | + */ |
| 92 | + static ATTRIBUTE_NODE: number = 2; |
| 93 | + /** |
| 94 | + * Text nodes. |
| 95 | + */ |
| 96 | + static TEXT_NODE: number = 3; |
| 97 | + /** |
| 98 | + * @deprecated Unused in React Native. |
| 99 | + */ |
| 100 | + static CDATA_SECTION_NODE: number = 4; |
| 101 | + /** |
| 102 | + * @deprecated |
| 103 | + */ |
| 104 | + static ENTITY_REFERENCE_NODE: number = 5; |
| 105 | + /** |
| 106 | + * @deprecated |
| 107 | + */ |
| 108 | + static ENTITY_NODE: number = 6; |
| 109 | + /** |
| 110 | + * @deprecated Unused in React Native. |
| 111 | + */ |
| 112 | + static PROCESSING_INSTRUCTION_NODE: number = 7; |
| 113 | + /** |
| 114 | + * @deprecated Unused in React Native. |
| 115 | + */ |
| 116 | + static COMMENT_NODE: number = 8; |
| 117 | + /** |
| 118 | + * @deprecated Unused in React Native. |
| 119 | + */ |
| 120 | + static DOCUMENT_NODE: number = 9; |
| 121 | + /** |
| 122 | + * @deprecated Unused in React Native. |
| 123 | + */ |
| 124 | + static DOCUMENT_TYPE_NODE: number = 10; |
| 125 | + /** |
| 126 | + * @deprecated Unused in React Native. |
| 127 | + */ |
| 128 | + static DOCUMENT_FRAGMENT_NODE: number = 11; |
| 129 | + /** |
| 130 | + * @deprecated |
| 131 | + */ |
| 132 | + static NOTATION_NODE: number = 12; |
| 133 | + |
| 134 | + /* |
| 135 | + * Document position flags. Used to check the return value of |
| 136 | + * `compareDocumentPosition()`. |
| 137 | + */ |
| 138 | + |
| 139 | + /** |
| 140 | + * Both nodes are in different documents. |
| 141 | + */ |
| 142 | + static DOCUMENT_POSITION_DISCONNECTED: number = 1; |
| 143 | + /** |
| 144 | + * `otherNode` precedes the node in either a pre-order depth-first traversal of a tree containing both |
| 145 | + * (e.g., as an ancestor or previous sibling or a descendant of a previous sibling or previous sibling of an ancestor) |
| 146 | + * or (if they are disconnected) in an arbitrary but consistent ordering. |
| 147 | + */ |
| 148 | + static DOCUMENT_POSITION_PRECEDING: number = 2; |
| 149 | + /** |
| 150 | + * `otherNode` follows the node in either a pre-order depth-first traversal of a tree containing both |
| 151 | + * (e.g., as a descendant or following sibling or a descendant of a following sibling or following sibling of an ancestor) |
| 152 | + * or (if they are disconnected) in an arbitrary but consistent ordering. |
| 153 | + */ |
| 154 | + static DOCUMENT_POSITION_FOLLOWING: number = 4; |
| 155 | + /** |
| 156 | + * `otherNode` is an ancestor of the node. |
| 157 | + */ |
| 158 | + static DOCUMENT_POSITION_CONTAINS: number = 8; |
| 159 | + /** |
| 160 | + * `otherNode` is a descendant of the node. |
| 161 | + */ |
| 162 | + static DOCUMENT_POSITION_CONTAINED_BY: number = 16; |
| 163 | + /** |
| 164 | + * @deprecated Unused in React Native. |
| 165 | + */ |
| 166 | + static DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number = 32; |
| 167 | +} |
0 commit comments