extends ReactElement
{}
//
// React Nodes
@@ -27,7 +26,10 @@ declare module React {
// type ReactText = string | number;
// type Fragment = ReactNode[];
- // type ReactNode = ReactElement {
+ interface ComponentFactory {
(props?: P, ...children: any/*ReactNode*/[]): ReactElement ;
}
- interface HTMLFactory extends Factory extends Factory {}
+ interface HTMLFactory extends ComponentFactory (spec: ComponentSpec ): ComponentClass ;
createElement (type: any/*ReactType*/, props: P, ...children: any/*ReactNode*/[]): ReactElement ;
- createFactory (componentClass: ComponentClass ): Factory ;
- render (element: ReactElement , container: Element, callback?: () => void): Component ;
+ createFactory (componentClass: ComponentClass ): ComponentFactory ;
+ render (element: ReactElement , container: Element, callback?: () => any): Component ;
unmountComponentAtNode(container: Element): boolean;
renderToString(element: ReactElement extends Component {
@@ -98,9 +99,9 @@ declare module React {
interface CompositeComponent extends Component , ComponentSpec {
state: S;
- setState(nextState: S, callback?: () => void): void;
- replaceState(nextState: S, callback?: () => void): void;
- forceUpdate(callback?: () => void): void;
+ setState(nextState: S, callback?: () => any): void;
+ replaceState(nextState: S, callback?: () => any): void;
+ forceUpdate(callback?: () => any): void;
refs: {
[key: string]: Component (element: ReactElement , props: P): ReactElement ;
update(value: any[], spec: UpdateArraySpec): any[];