[react] Add T param to React.DOM* types

This commit is contained in:
Vincent Siao
2016-03-13 21:54:40 -07:00
parent 92cf86a3e2
commit 1917a4122a
13 changed files with 154 additions and 165 deletions

View File

@@ -19,7 +19,7 @@ var clickHandler: React.MouseEventHandler
// Tests with spec string
function spec_string () {
var result: React.ReactHTMLElement
var result: React.ReactHTMLElement<HTMLElement>
// just spec string
result = $('div')

4
jsnox/jsnox.d.ts vendored
View File

@@ -31,7 +31,7 @@ declare module 'jsnox' {
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
<P>(specString: string, children: React.ReactNode): React.DOMElement<P>
<P>(specString: string, children: React.ReactNode): React.DOMElement<P, Element>
/**
* Renders an HTML element from the given spec string, with optional props
@@ -42,7 +42,7 @@ declare module 'jsnox' {
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
<P>(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement<P>
<P>(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement<P, Element>
/**