forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Flow is moving the react-dom libdef to flow-typed. To prepare for that, we should add `react-dom_v16.x.x` to the react-native library definitions Changelog: [Internal] Reviewed By: samwgoldman Differential Revision: D19726257 fbshipit-source-id: b2dcbc938b482b73947cc2683b87229873b573dd
- Loading branch information
1 parent
5ad964b
commit 93c4c24
Showing
1 changed file
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* react-dom v16.x.x libdefs from flow-typed | ||
* | ||
* @noformat | ||
*/ | ||
declare module 'react-dom' { | ||
declare function findDOMNode( | ||
componentOrElement: Element | ?React$Component<any, any>, | ||
): null | Element | Text; | ||
|
||
declare function render<ElementType: React$ElementType>( | ||
element: React$Element<ElementType>, | ||
container: Element, | ||
callback?: () => void, | ||
): React$ElementRef<ElementType>; | ||
|
||
declare function hydrate<ElementType: React$ElementType>( | ||
element: React$Element<ElementType>, | ||
container: Element, | ||
callback?: () => void, | ||
): React$ElementRef<ElementType>; | ||
|
||
declare function createPortal( | ||
node: React$Node, | ||
container: Element, | ||
): React$Portal; | ||
|
||
declare function unmountComponentAtNode(container: any): boolean; | ||
declare var version: string; | ||
|
||
declare function unstable_batchedUpdates<A, B, C, D, E>( | ||
callback: (a: A, b: B, c: C, d: D, e: E) => mixed, | ||
a: A, | ||
b: B, | ||
c: C, | ||
d: D, | ||
e: E, | ||
): void; | ||
declare function unstable_renderSubtreeIntoContainer< | ||
ElementType: React$ElementType, | ||
>( | ||
parentComponent: React$Component<any, any>, | ||
nextElement: React$Element<ElementType>, | ||
container: any, | ||
callback?: () => void, | ||
): React$ElementRef<ElementType>; | ||
} | ||
|
||
declare module 'react-dom/server' { | ||
declare function renderToString(element: React$Node): string; | ||
declare function renderToStaticMarkup(element: React$Node): string; | ||
declare function renderToNodeStream(element: React$Node): stream$Readable; | ||
declare function renderToStaticNodeStream( | ||
element: React$Node, | ||
): stream$Readable; | ||
declare var version: string; | ||
} | ||
|
||
type Thenable = { then(resolve: () => mixed, reject?: () => mixed): mixed, ... }; | ||
|
||
declare module 'react-dom/test-utils' { | ||
declare var Simulate: { [eventName: string]: (element: Element, eventData?: Object) => void, ... }; | ||
declare function renderIntoDocument( | ||
instance: React$Element<any>, | ||
): React$Component<any, any>; | ||
declare function mockComponent( | ||
componentClass: React$ElementType, | ||
mockTagName?: string, | ||
): Object; | ||
declare function isElement(element: React$Element<any>): boolean; | ||
declare function isElementOfType( | ||
element: React$Element<any>, | ||
componentClass: React$ElementType, | ||
): boolean; | ||
declare function isDOMComponent(instance: any): boolean; | ||
declare function isCompositeComponent( | ||
instance: React$Component<any, any>, | ||
): boolean; | ||
declare function isCompositeComponentWithType( | ||
instance: React$Component<any, any>, | ||
componentClass: React$ElementType, | ||
): boolean; | ||
declare function findAllInRenderedTree( | ||
tree: React$Component<any, any>, | ||
test: (child: React$Component<any, any>) => boolean, | ||
): Array<React$Component<any, any>>; | ||
declare function scryRenderedDOMComponentsWithClass( | ||
tree: React$Component<any, any>, | ||
className: string, | ||
): Array<Element>; | ||
declare function findRenderedDOMComponentWithClass( | ||
tree: React$Component<any, any>, | ||
className: string, | ||
): ?Element; | ||
declare function scryRenderedDOMComponentsWithTag( | ||
tree: React$Component<any, any>, | ||
tagName: string, | ||
): Array<Element>; | ||
declare function findRenderedDOMComponentWithTag( | ||
tree: React$Component<any, any>, | ||
tagName: string, | ||
): ?Element; | ||
declare function scryRenderedComponentsWithType( | ||
tree: React$Component<any, any>, | ||
componentClass: React$ElementType, | ||
): Array<React$Component<any, any>>; | ||
declare function findRenderedComponentWithType( | ||
tree: React$Component<any, any>, | ||
componentClass: React$ElementType, | ||
): ?React$Component<any, any>; | ||
declare function act(callback: () => void | Thenable): Thenable; | ||
} |