@samitouri / QOS-React / commits / 82710097f6

Add flow types in getNodeForCharacterOffset (#13908)

Abdul Rauf committed Oct 21, 2018 at 23:18 UTC 82710097f604bfaef30adb34e1ce3654070f47c6
1 file changed +3 -1
packages/react-dom/src/client/getNodeForCharacterOffset.js
+3 -1
@@ -3,6 +3,8 @@
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 + * @flow
8 */
9
10 import {TEXT_NODE} from '../shared/HTMLNodeType';
@@ -43,7 +45,7 @@ function getSiblingNode(node) {
45 * @param {number} offset
46 * @return {?object}
47 */
46 -function getNodeForCharacterOffset(root, offset) {
48 +function getNodeForCharacterOffset(root: Element, offset: number): ?Object {
49 let node = getLeafNode(root);
50 let nodeStart = 0;
51 let nodeEnd = 0;