From 92c95d8c40e176359fe6de41c5bea7749773a623 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Thu, 12 Feb 2015 16:19:03 -0800 Subject: [PATCH] Take shared Props (key, ref, children) out of ReactAttributes and rename to DOMAttribtues --- react/react-0.13.0-tests.ts | 2 +- react/react-0.13.0.d.ts | 11 ++++++----- react/react-addons-0.13.0-tests.ts | 2 +- react/react-addons-0.13.0.d.ts | 11 ++++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/react/react-0.13.0-tests.ts b/react/react-0.13.0-tests.ts index d85138857..dd0052ee3 100644 --- a/react/react-0.13.0-tests.ts +++ b/react/react-0.13.0-tests.ts @@ -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; diff --git a/react/react-0.13.0.d.ts b/react/react-0.13.0.d.ts index 780fcc2d0..b9382a8fa 100644 --- a/react/react-0.13.0.d.ts +++ b/react/react-0.13.0.d.ts @@ -308,15 +308,16 @@ declare module "react" { interface WheelEventHandler extends EventHandler {} // - // 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; diff --git a/react/react-addons-0.13.0-tests.ts b/react/react-addons-0.13.0-tests.ts index fe5b772a3..a1be24add 100644 --- a/react/react-addons-0.13.0-tests.ts +++ b/react/react-addons-0.13.0-tests.ts @@ -1,7 +1,7 @@ /// import React = require("react/addons"); -interface Props { +interface Props extends React.Props { hello: string; world?: string; foo: number; diff --git a/react/react-addons-0.13.0.d.ts b/react/react-addons-0.13.0.d.ts index 80afbb46d..8c4886c52 100644 --- a/react/react-addons-0.13.0.d.ts +++ b/react/react-addons-0.13.0.d.ts @@ -308,15 +308,16 @@ declare module "react/addons" { interface WheelEventHandler extends EventHandler {} // - // 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;