Take shared Props (key, ref, children) out of ReactAttributes and rename to DOMAttribtues

This commit is contained in:
Vincent Siao
2015-02-12 16:19:03 -08:00
parent 9ce634af3a
commit 92c95d8c40
4 changed files with 14 additions and 12 deletions

View File

@@ -3,7 +3,7 @@
// TODO: import "react" once 0.13.0 is released
import React = require("react/addons");
interface Props {
interface Props extends React.Props {
hello: string;
world?: string;
foo: number;

View File

@@ -308,15 +308,16 @@ declare module "react" {
interface WheelEventHandler extends EventHandler<WheelEvent> {}
//
// Attributes
// Props / DOM Attributes
// ----------------------------------------------------------------------
interface ReactAttributes {
interface Props {
children?: ReactNode;
key?: number | string;
ref?: string;
}
// Event Attributes
interface DOMAttributes extends Props {
onCopy?: ClipboardEventHandler;
onCut?: ClipboardEventHandler;
onPaste?: ClipboardEventHandler;
@@ -377,7 +378,7 @@ declare module "react" {
strokeOpacity?: number;
}
interface HTMLAttributes extends ReactAttributes {
interface HTMLAttributes extends DOMAttributes {
accept?: string;
acceptCharset?: string;
accessKey?: string;
@@ -485,7 +486,7 @@ declare module "react" {
itemType?: string;
}
interface SVGAttributes extends ReactAttributes {
interface SVGAttributes extends DOMAttributes {
cx?: SVGLength | SVGAnimatedLength;
cy?: any;
d?: string;

View File

@@ -1,7 +1,7 @@
/// <reference path="react-addons-0.13.0.d.ts" />
import React = require("react/addons");
interface Props {
interface Props extends React.Props {
hello: string;
world?: string;
foo: number;

View File

@@ -308,15 +308,16 @@ declare module "react/addons" {
interface WheelEventHandler extends EventHandler<WheelEvent> {}
//
// Attributes
// Props / DOM Attributes
// ----------------------------------------------------------------------
interface ReactAttributes {
interface Props {
children?: ReactNode;
key?: number | string;
ref?: string;
}
// Event Attributes
interface DOMAttributes extends Props {
onCopy?: ClipboardEventHandler;
onCut?: ClipboardEventHandler;
onPaste?: ClipboardEventHandler;
@@ -377,7 +378,7 @@ declare module "react/addons" {
strokeOpacity?: number;
}
interface HTMLAttributes extends ReactAttributes {
interface HTMLAttributes extends DOMAttributes {
accept?: string;
acceptCharset?: string;
accessKey?: string;
@@ -485,7 +486,7 @@ declare module "react/addons" {
itemType?: string;
}
interface SVGAttributes extends ReactAttributes {
interface SVGAttributes extends DOMAttributes {
cx?: SVGLength | SVGAnimatedLength;
cy?: any;
d?: string;