mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Flowify a bunch of Libraries
This commit is contained in:
@@ -7,12 +7,25 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule queryLayoutByID
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ReactIOSTagHandles = require('ReactIOSTagHandles');
|
||||
var RCTUIManager = require('NativeModules').UIManager;
|
||||
|
||||
type OnSuccessCallback = (
|
||||
left: number,
|
||||
top: number,
|
||||
width: number,
|
||||
height: number,
|
||||
pageX: number,
|
||||
pageY: number
|
||||
) => void
|
||||
|
||||
// I don't know what type error is...
|
||||
type OnErrorCallback = (error: any) => void
|
||||
|
||||
/**
|
||||
* Queries the layout of a view. The layout does not reflect the element as
|
||||
* seen by the user, rather it reflects the position within the layout system,
|
||||
@@ -32,7 +45,11 @@ var RCTUIManager = require('NativeModules').UIManager;
|
||||
* @param {function} onError `func(error)`
|
||||
* @param {function} onSuccess `func(left, top, width, height, pageX, pageY)`
|
||||
*/
|
||||
var queryLayoutByID = function(rootNodeID, onError, onSuccess) {
|
||||
var queryLayoutByID = function(
|
||||
rootNodeID: string,
|
||||
onError: OnErrorCallback,
|
||||
onSuccess: OnSuccessCallback
|
||||
): void {
|
||||
// Native bridge doesn't *yet* surface errors.
|
||||
RCTUIManager.measure(
|
||||
ReactIOSTagHandles.rootNodeIDToTag[rootNodeID],
|
||||
|
||||
Reference in New Issue
Block a user