@types/react: Mark booleanish HTML/SVG JSX attributes as such (#40658)

* Mark booleanish HTML/SVG JSX attributes as such

* Extend `contentEditable` and `focusable` types
This commit is contained in:
Federico Brigante
2019-12-02 10:46:10 -08:00
committed by Andrew Casey
parent eb93a1cad4
commit 8e7248d523
+8 -7
View File
@@ -45,6 +45,7 @@ type NativePointerEvent = PointerEvent;
type NativeTransitionEvent = TransitionEvent;
type NativeUIEvent = UIEvent;
type NativeWheelEvent = WheelEvent;
type Booleanish = boolean | 'true' | 'false';
/**
* defined in scheduler/tracing
@@ -1656,16 +1657,16 @@ declare namespace React {
// Standard HTML Attributes
accessKey?: string;
className?: string;
contentEditable?: boolean;
contentEditable?: Booleanish | "inherit";
contextMenu?: string;
dir?: string;
draggable?: boolean;
draggable?: Booleanish;
hidden?: boolean;
id?: string;
lang?: string;
placeholder?: string;
slot?: string;
spellCheck?: boolean;
spellCheck?: Booleanish;
style?: CSSProperties;
tabIndex?: number;
title?: string;
@@ -2272,7 +2273,7 @@ declare namespace React {
ascent?: number | string;
attributeName?: string;
attributeType?: string;
autoReverse?: number | string;
autoReverse?: Booleanish;
azimuth?: number | string;
baseFrequency?: number | string;
baselineShift?: number | string;
@@ -2312,7 +2313,7 @@ declare namespace React {
enableBackground?: number | string;
end?: number | string;
exponent?: number | string;
externalResourcesRequired?: number | string;
externalResourcesRequired?: Booleanish;
fill?: string;
fillOpacity?: number | string;
fillRule?: "nonzero" | "evenodd" | "inherit";
@@ -2321,7 +2322,7 @@ declare namespace React {
filterUnits?: number | string;
floodColor?: number | string;
floodOpacity?: number | string;
focusable?: number | string;
focusable?: Booleanish | "auto";
fontFamily?: string;
fontSize?: number | string;
fontSizeAdjust?: number | string;
@@ -2399,7 +2400,7 @@ declare namespace React {
pointsAtX?: number | string;
pointsAtY?: number | string;
pointsAtZ?: number | string;
preserveAlpha?: number | string;
preserveAlpha?: Booleanish;
preserveAspectRatio?: string;
primitiveUnits?: number | string;
r?: number | string;