Merge pull request #5915 from ngbrown/patch-7

react.d.ts: Make a generic base version of HTMLAttributes and DOMAttributes
This commit is contained in:
Masahiro Wakame
2015-09-23 07:07:20 +09:00

24
react/react.d.ts vendored
View File

@@ -336,7 +336,7 @@ declare namespace __React {
ref?: string | ((component: T) => any);
}
interface DOMAttributes extends Props<DOMComponent<any>> {
interface DOMAttributesBase<T> extends Props<T> {
onCopy?: ClipboardEventHandler;
onCut?: ClipboardEventHandler;
onPaste?: ClipboardEventHandler;
@@ -377,6 +377,9 @@ declare namespace __React {
};
}
interface DOMAttributes extends DOMAttributesBase<DOMComponent<any>> {
}
// This interface is not complete. Only properties accepting
// unitless numbers are listed here (see CSSProperty.js in React)
interface CSSProperties {
@@ -406,9 +409,7 @@ declare namespace __React {
[propertyName: string]: any;
}
interface HTMLAttributes extends DOMAttributes {
ref?: string | ((component: HTMLComponent) => void);
interface HTMLAttributesBase<T> extends DOMAttributesBase<T> {
accept?: string;
acceptCharset?: string;
accessKey?: string;
@@ -528,6 +529,9 @@ declare namespace __React {
unselectable?: boolean;
}
interface HTMLAttributes extends HTMLAttributesBase<HTMLComponent> {
}
interface SVGElementAttributes extends HTMLAttributes {
viewBox?: string;
preserveAspectRatio?: string;
@@ -1133,7 +1137,7 @@ declare module "react/addons" {
ref?: string | ((component: T) => any);
}
interface DOMAttributes extends Props<DOMComponent<any>> {
interface DOMAttributesBase<T> extends Props<T> {
onCopy?: ClipboardEventHandler;
onCut?: ClipboardEventHandler;
onPaste?: ClipboardEventHandler;
@@ -1174,6 +1178,9 @@ declare module "react/addons" {
};
}
interface DOMAttributes extends DOMAttributesBase<DOMComponent<any>> {
}
// This interface is not complete. Only properties accepting
// unitless numbers are listed here (see CSSProperty.js in React)
interface CSSProperties {
@@ -1203,9 +1210,7 @@ declare module "react/addons" {
[propertyName: string]: any;
}
interface HTMLAttributes extends DOMAttributes {
ref?: string | ((component: HTMLComponent) => void);
interface HTMLAttributesBase<T> extends DOMAttributesBase<T> {
accept?: string;
acceptCharset?: string;
accessKey?: string;
@@ -1325,6 +1330,9 @@ declare module "react/addons" {
unselectable?: boolean;
}
interface HTMLAttributes extends HTMLAttributesBase<HTMLComponent> {
}
interface SVGElementAttributes extends HTMLAttributes {
viewBox?: string;
preserveAspectRatio?: string;