Files
react/flow/react-native-host-hooks.js
T
Sebastian Markbåge 5744571140 [RT] More predictable things (#11139)
* Inject the right event emitter

Previously this was injecting the ReactNativeEventEmitter even though
we want the ReactNativeRTEventEmitter.

RCTEventEmitter is also just an abstraction around BatchedBridge that
registers a single name. We can't register more than one with it. Removed
that abstraction for now so we don't have to add it back into the RN repo.

* Unify appendChildToDetachedParent and appendChild, separate root

Merge appendChildToDetachedParent and appendChild. We don't need the distinction.

We do however need a separate notion for the root container.
Calling this `appendChildToContext` since Context has a meaning here.

* Add a simple shallow comparison so that we don't send updates for equal props

This still sends all props if any differs. Not sure we'll want that but I
think so.

* Add BatchedBridge to bundle externals

* Lint
2017-10-06 19:08:22 -07:00

128 lines
3.2 KiB
JavaScript

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
/* eslint-disable */
declare module 'deepDiffer' {
declare function exports(one: any, two: any): bool;
}
declare module 'deepFreezeAndThrowOnMutationInDev' {
declare function exports<T>(obj : T) : T;
}
declare module 'flattenStyle' { }
declare module 'InitializeCore' { }
declare module 'RCTEventEmitter' {
declare function register(mixed) : void;
}
declare module 'TextInputState' {
declare function blurTextInput(object : any) : void;
declare function focusTextInput(object : any) : void;
}
declare module 'ExceptionsManager' {
declare function handleException(
error: Error,
isFatal: boolean,
) : void;
}
declare module 'Platform' {
declare var OS : string;
}
declare module 'UIManager' {
declare var customBubblingEventTypes : Object;
declare var customDirectEventTypes : Object;
declare function createView(
reactTag : number,
viewName : string,
rootTag : number,
props : ?Object,
) : void;
declare function manageChildren(
containerTag : number,
moveFromIndices : Array<number>,
moveToIndices : Array<number>,
addChildReactTags : Array<number>,
addAtIndices : Array<number>,
removeAtIndices : Array<number>
) : void;
declare function measure(hostComponent: mixed, callback: Function) : void;
declare function measureInWindow(
nativeTag : ?number,
callback : Function
) : void;
declare function measureLayout(
nativeTag : mixed,
nativeNode : number,
onFail : Function,
onSuccess : Function
) : void;
declare function removeRootView(containerTag : number) : void;
declare function removeSubviewsFromContainerWithID(containerId : number) : void;
declare function replaceExistingNonRootView() : void;
declare function setChildren(
containerTag : number,
reactTags : Array<number>,
) : void;
declare function updateView(
reactTag : number,
viewName : string,
props : ?Object,
) : void;
declare function __takeSnapshot(
view ?: 'window' | Element<any> | number,
options ?: {
width ?: number,
height ?: number,
format ?: 'png' | 'jpeg',
quality ?: number,
},
) : Promise<any>;
}
declare module 'View' {
declare var exports : typeof React$Component;
}
declare module 'RTManager' {
declare function createNode(
tag : number,
classType : string,
props : ?Object,
) : void;
declare function beginUpdates() : void;
declare function appendChildToContext(
contextTag : number,
childTag : number,
) : void;
declare function appendChild(
parentTag : number,
childTag : number,
) : void;
declare function prependChild(
childTag : number,
beforeTag : number,
) : void;
declare function deleteChild(
childTag : number,
) : void;
declare function updateNode(
tag : number,
props : ?Object,
) : void;
declare function completeUpdates() : void;
}
declare module 'BatchedBridge' {
declare function registerCallableModule(
name : string,
module : Object,
) : void;
}