borisyankov/DefinitelyTyped — pull request #3259 by vsiao (2014-12-03 05:32:37+00:00)
Title: Refactor react.d.ts for React v0.12, merging with react-addons.d.ts

This PR is broadly inspired by the official React DOM Terminology (http://facebook.github.io/react/docs/glossary.html).
The main interfaces are:

`ReactElement

`—created using `React.DOM` factories and `React.createElement` in `render()`. Contains `type`, `props`, `key`, and `ref`.
`ComponentClass

`—created using `React.createClass` from `ComponentSpec`.
`Factory

`—created using `createFactory

` from `ComponentClass

`. Produces `ReactElement

` when called with props `P`.
`ElementInstance

`—only available from `React.render` at the top-level. Contains Component API methods such as `getDOMNode()` and `setProps()`.

The `React` module is now separated into sections roughly corresponding to the sections in the React Reference (`Top-Level API`, `Component API`, `Component Specs and Lifecycle`, `Event System`, etc.).

* added: `interface XEventHandler` as shorthand for `(event: React.XEvent) => void`
* fixed: `refs` has type `{ [key: string]: ElementInstance }`, not `ElementInstance

`
* added: types for `HTMLAttributes` and `SVGAttributes` (annotated with `//` where union types are desired)
* added: `batchedUpdates` to `react/addons`
* updated: typing for `addons.update`
* added: more tests to `react-tests.ts`

cc @pspeter3