UNPKG

2.72 kBTypeScriptView Raw
1// Type definitions for React v0.14 (react-dom)
2// Project: http://facebook.github.io/react/
3// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference path="react-dom.server.d.ts" />
7
8export as namespace ReactDOM;
9export = ReactDOM;
10
11import { ReactInstance, Component, ComponentState,
12 ReactElement, SFCElement, CElement,
13 DOMAttributes, DOMElement } from 'react';
14
15declare namespace ReactDOM {
16 function findDOMNode<E extends Element>(instance: ReactInstance): E;
17 function findDOMNode(instance: ReactInstance): Element;
18
19 function render<P extends DOMAttributes<T>, T extends Element>(
20 element: DOMElement<P, T>,
21 container: Element,
22 callback?: (element: T) => any): T;
23 function render<P>(
24 element: SFCElement<P>,
25 container: Element,
26 callback?: () => any): void;
27 function render<P, T extends Component<P, ComponentState>>(
28 element: CElement<P, T>,
29 container: Element,
30 callback?: (component: T) => any): T;
31 function render<P>(
32 element: ReactElement<P>,
33 container: Element,
34 callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
35
36 function unmountComponentAtNode(container: Element): boolean;
37
38 var version: string;
39
40 function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
41 function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
42 function unstable_batchedUpdates(callback: () => any): void;
43
44 function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>, T extends Element>(
45 parentComponent: Component<any, any>,
46 element: DOMElement<P, T>,
47 container: Element,
48 callback?: (element: T) => any): T;
49 function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
50 parentComponent: Component<any, any>,
51 element: CElement<P, T>,
52 container: Element,
53 callback?: (component: T) => any): T;
54 function render<P>(
55 parentComponent: Component<any, any>,
56 element: SFCElement<P>,
57 container: Element,
58 callback?: () => any): void;
59 function unstable_renderSubtreeIntoContainer<P>(
60 parentComponent: Component<any, any>,
61 element: ReactElement<P>,
62 container: Element,
63 callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
64}