@types/react 16.8.13 → 16.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. react/README.md +2 -2
  2. react/index.d.ts +76 -74
  3. react/package.json +2 -7
react/README.md CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for React ( http://facebook.github.io/rea
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react
9
9
 
10
10
  Additional Details
11
- * Last updated: Mon, 08 Apr 2019 04:24:39 GMT
11
+ * Last updated: Wed, 08 May 2019 03:15:30 GMT
12
12
  * Dependencies: @types/csstype, @types/prop-types
13
13
  * Global values: React
14
14
 
15
15
  # Credits
16
- These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, John Reilly <https://github.com/johnnyreilly>, Benoit Benezech <https://github.com/bbenezech>, Patricio Zavolinsky <https://github.com/pzavolinsky>, Digiguru <https://github.com/digiguru>, Eric Anderson <https://github.com/ericanderson>, Tanguy Krotoff <https://github.com/tkrotoff>, Dovydas Navickas <https://github.com/DovydasNavickas>, Stéphane Goetz <https://github.com/onigoetz>, Josh Rutherford <https://github.com/theruther4d>, Guilherme Hübner <https://github.com/guilhermehubner>, Ferdy Budhidharma <https://github.com/ferdaber>, Johann Rakotoharisoa <https://github.com/jrakotoharisoa>, Olivier Pascal <https://github.com/pascaloliv>, Martin Hochel <https://github.com/hotell>, Frank Li <https://github.com/franklixuefei>, Jessica Franco <https://github.com/Jessidhia>, Paul Sherman <https://github.com/pshrmn>, Saransh Kataria <https://github.com/saranshkataria>, Kanitkorn Sujautra <https://github.com/lukyth>, Sebastian Silbermann <https://github.com/eps1lon>.
16
+ These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, John Reilly <https://github.com/johnnyreilly>, Benoit Benezech <https://github.com/bbenezech>, Patricio Zavolinsky <https://github.com/pzavolinsky>, Digiguru <https://github.com/digiguru>, Eric Anderson <https://github.com/ericanderson>, Tanguy Krotoff <https://github.com/tkrotoff>, Dovydas Navickas <https://github.com/DovydasNavickas>, Stéphane Goetz <https://github.com/onigoetz>, Josh Rutherford <https://github.com/theruther4d>, Guilherme Hübner <https://github.com/guilhermehubner>, Ferdy Budhidharma <https://github.com/ferdaber>, Johann Rakotoharisoa <https://github.com/jrakotoharisoa>, Olivier Pascal <https://github.com/pascaloliv>, Martin Hochel <https://github.com/hotell>, Frank Li <https://github.com/franklixuefei>, Jessica Franco <https://github.com/Jessidhia>, Saransh Kataria <https://github.com/saranshkataria>, Kanitkorn Sujautra <https://github.com/lukyth>, Sebastian Silbermann <https://github.com/eps1lon>.
react/index.d.ts CHANGED
@@ -19,7 +19,6 @@
19
19
  // Martin Hochel <https://github.com/hotell>
20
20
  // Frank Li <https://github.com/franklixuefei>
21
21
  // Jessica Franco <https://github.com/Jessidhia>
22
- // Paul Sherman <https://github.com/pshrmn>
23
22
  // Saransh Kataria <https://github.com/saranshkataria>
24
23
  // Kanitkorn Sujautra <https://github.com/lukyth>
25
24
  // Sebastian Silbermann <https://github.com/eps1lon>
@@ -778,9 +777,9 @@ declare namespace React {
778
777
 
779
778
  // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
780
779
  // but can be given its own specific name
781
- interface MemoExoticComponent<T extends ComponentType<any>> extends NamedExoticComponent<ComponentPropsWithRef<T>> {
780
+ type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<ComponentPropsWithRef<T>> & {
782
781
  readonly type: T;
783
- }
782
+ };
784
783
 
785
784
  function memo<P extends object>(
786
785
  Component: SFC<P>,
@@ -791,9 +790,9 @@ declare namespace React {
791
790
  propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean
792
791
  ): MemoExoticComponent<T>;
793
792
 
794
- interface LazyExoticComponent<T extends ComponentType<any>> extends ExoticComponent<ComponentPropsWithRef<T>> {
793
+ type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
795
794
  readonly _result: T;
796
- }
795
+ };
797
796
 
798
797
  function lazy<T extends ComponentType<any>>(
799
798
  factory: () => Promise<{ default: T }>
@@ -1447,65 +1446,8 @@ declare namespace React {
1447
1446
  */
1448
1447
  }
1449
1448
 
1450
- interface HTMLAttributes<T> extends DOMAttributes<T> {
1451
- // React-specific Attributes
1452
- defaultChecked?: boolean;
1453
- defaultValue?: string | string[];
1454
- suppressContentEditableWarning?: boolean;
1455
- suppressHydrationWarning?: boolean;
1456
-
1457
- // Standard HTML Attributes
1458
- accessKey?: string;
1459
- className?: string;
1460
- contentEditable?: boolean;
1461
- contextMenu?: string;
1462
- dir?: string;
1463
- draggable?: boolean;
1464
- hidden?: boolean;
1465
- id?: string;
1466
- lang?: string;
1467
- placeholder?: string;
1468
- slot?: string;
1469
- spellCheck?: boolean;
1470
- style?: CSSProperties;
1471
- tabIndex?: number;
1472
- title?: string;
1473
-
1474
- // Unknown
1475
- inputMode?: string;
1476
- is?: string;
1477
- radioGroup?: string; // <command>, <menuitem>
1478
-
1479
- // WAI-ARIA
1480
- role?: string;
1481
-
1482
- // RDFa Attributes
1483
- about?: string;
1484
- datatype?: string;
1485
- inlist?: any;
1486
- prefix?: string;
1487
- property?: string;
1488
- resource?: string;
1489
- typeof?: string;
1490
- vocab?: string;
1491
-
1492
- // Non-standard Attributes
1493
- autoCapitalize?: string;
1494
- autoCorrect?: string;
1495
- autoSave?: string;
1496
- color?: string;
1497
- itemProp?: string;
1498
- itemScope?: boolean;
1499
- itemType?: string;
1500
- itemID?: string;
1501
- itemRef?: string;
1502
- results?: number;
1503
- security?: string;
1504
- unselectable?: 'on' | 'off';
1505
- }
1506
-
1507
1449
  // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
1508
- interface HTMLAttributes<T> extends DOMAttributes<T> {
1450
+ interface AriaAttributes {
1509
1451
  /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
1510
1452
  'aria-activedescendant'?: string;
1511
1453
  /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
@@ -1692,6 +1634,63 @@ declare namespace React {
1692
1634
  'aria-valuetext'?: string;
1693
1635
  }
1694
1636
 
1637
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
1638
+ // React-specific Attributes
1639
+ defaultChecked?: boolean;
1640
+ defaultValue?: string | string[];
1641
+ suppressContentEditableWarning?: boolean;
1642
+ suppressHydrationWarning?: boolean;
1643
+
1644
+ // Standard HTML Attributes
1645
+ accessKey?: string;
1646
+ className?: string;
1647
+ contentEditable?: boolean;
1648
+ contextMenu?: string;
1649
+ dir?: string;
1650
+ draggable?: boolean;
1651
+ hidden?: boolean;
1652
+ id?: string;
1653
+ lang?: string;
1654
+ placeholder?: string;
1655
+ slot?: string;
1656
+ spellCheck?: boolean;
1657
+ style?: CSSProperties;
1658
+ tabIndex?: number;
1659
+ title?: string;
1660
+
1661
+ // Unknown
1662
+ inputMode?: string;
1663
+ is?: string;
1664
+ radioGroup?: string; // <command>, <menuitem>
1665
+
1666
+ // WAI-ARIA
1667
+ role?: string;
1668
+
1669
+ // RDFa Attributes
1670
+ about?: string;
1671
+ datatype?: string;
1672
+ inlist?: any;
1673
+ prefix?: string;
1674
+ property?: string;
1675
+ resource?: string;
1676
+ typeof?: string;
1677
+ vocab?: string;
1678
+
1679
+ // Non-standard Attributes
1680
+ autoCapitalize?: string;
1681
+ autoCorrect?: string;
1682
+ autoSave?: string;
1683
+ color?: string;
1684
+ itemProp?: string;
1685
+ itemScope?: boolean;
1686
+ itemType?: string;
1687
+ itemID?: string;
1688
+ itemRef?: string;
1689
+ results?: number;
1690
+ security?: string;
1691
+ unselectable?: 'on' | 'off';
1692
+ }
1693
+
1695
1694
  interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1696
1695
  // Standard HTML Attributes
1697
1696
  accept?: string;
@@ -2205,7 +2204,7 @@ declare namespace React {
2205
2204
  // - "number | string"
2206
2205
  // - "string"
2207
2206
  // - union of string literals
2208
- interface SVGAttributes<T> extends DOMAttributes<T> {
2207
+ interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
2209
2208
  // Attributes which also defined in HTMLAttributes
2210
2209
  // See comment in SVGDOMPropertyConfig.js
2211
2210
  className?: string;
@@ -2769,16 +2768,19 @@ type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
2769
2768
 
2770
2769
  // Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
2771
2770
  type MergePropTypes<P, T> =
2772
- // If props is type any, use propTypes definitions
2773
- IsExactlyAny<P> extends true ? T :
2774
- // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
2775
- string extends keyof P ? P :
2776
- // Prefer declared types which are not exactly any
2777
- & Pick<P, NotExactlyAnyPropertyKeys<P>>
2778
- // For props which are exactly any, use the type inferred from propTypes if present
2779
- & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
2780
- // Keep leftover props not specified in propTypes
2781
- & Pick<P, Exclude<keyof P, keyof T>>;
2771
+ // Distribute over P in case it is a union type
2772
+ P extends any
2773
+ // If props is type any, use propTypes definitions
2774
+ ? IsExactlyAny<P> extends true ? T :
2775
+ // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
2776
+ string extends keyof P ? P :
2777
+ // Prefer declared types which are not exactly any
2778
+ & Pick<P, NotExactlyAnyPropertyKeys<P>>
2779
+ // For props which are exactly any, use the type inferred from propTypes if present
2780
+ & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
2781
+ // Keep leftover props not specified in propTypes
2782
+ & Pick<P, Exclude<keyof P, keyof T>>
2783
+ : never;
2782
2784
 
2783
2785
  // Any prop that has a default prop becomes optional, but its type is unchanged
2784
2786
  // Undeclared default props are augmented into the resulting allowable attributes
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.8.13",
3
+ "version": "16.8.17",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -96,11 +96,6 @@
96
96
  "url": "https://github.com/Jessidhia",
97
97
  "githubUsername": "Jessidhia"
98
98
  },
99
- {
100
- "name": "Paul Sherman",
101
- "url": "https://github.com/pshrmn",
102
- "githubUsername": "pshrmn"
103
- },
104
99
  {
105
100
  "name": "Saransh Kataria",
106
101
  "url": "https://github.com/saranshkataria",
@@ -129,6 +124,6 @@
129
124
  "@types/prop-types": "*",
130
125
  "csstype": "^2.2.0"
131
126
  },
132
- "typesPublisherContentHash": "53d31798b997bfdad69e11ba927c3df23f4f9df1aa3888dfb9b4d665e7a2e946",
127
+ "typesPublisherContentHash": "66cd5c35fa8046ca1a9a132c5892894805ec3ee57c62737d94259aee4270bc57",
133
128
  "typeScriptVersion": "2.8"
134
129
  }