@types/react 16.8.10 → 16.8.14

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 +105 -68
  3. react/package.json +7 -2
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: Wed, 27 Mar 2019 16:10:17 GMT
11
+ * Last updated: Fri, 19 Apr 2019 16:47:25 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>.
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>.
react/index.d.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  // Paul Sherman <https://github.com/pshrmn>
23
23
  // Saransh Kataria <https://github.com/saranshkataria>
24
24
  // Kanitkorn Sujautra <https://github.com/lukyth>
25
+ // Sebastian Silbermann <https://github.com/eps1lon>
25
26
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
26
27
  // TypeScript Version: 2.8
27
28
 
@@ -43,6 +44,15 @@ type NativeTransitionEvent = TransitionEvent;
43
44
  type NativeUIEvent = UIEvent;
44
45
  type NativeWheelEvent = WheelEvent;
45
46
 
47
+ /**
48
+ * defined in scheduler/tracing
49
+ */
50
+ interface SchedulerInteraction {
51
+ id: number;
52
+ name: string;
53
+ timestamp: number;
54
+ }
55
+
46
56
  // tslint:disable-next-line:export-just-namespace
47
57
  export = React;
48
58
  export as namespace React;
@@ -356,6 +366,26 @@ declare namespace React {
356
366
  const Suspense: ExoticComponent<SuspenseProps>;
357
367
  const version: string;
358
368
 
369
+ /**
370
+ * {@link https://github.com/bvaughn/rfcs/blob/profiler/text/0000-profiler.md#detailed-design | API}
371
+ */
372
+ type ProfilerOnRenderCallback = (
373
+ id: string,
374
+ phase: "mount" | "update",
375
+ actualDuration: number,
376
+ baseDuration: number,
377
+ startTime: number,
378
+ commitTime: number,
379
+ interactions: Set<SchedulerInteraction>,
380
+ ) => void;
381
+ interface ProfilerProps {
382
+ children?: ReactNode;
383
+ id: string;
384
+ onRender: ProfilerOnRenderCallback;
385
+ }
386
+
387
+ const unstable_Profiler: ExoticComponent<ProfilerProps>;
388
+
359
389
  //
360
390
  // Component API
361
391
  // ----------------------------------------------------------------------
@@ -1312,6 +1342,8 @@ declare namespace React {
1312
1342
  onWaitingCapture?: ReactEventHandler<T>;
1313
1343
 
1314
1344
  // MouseEvents
1345
+ onAuxClick?: MouseEventHandler<T>;
1346
+ onAuxClickCapture?: MouseEventHandler<T>;
1315
1347
  onClick?: MouseEventHandler<T>;
1316
1348
  onClickCapture?: MouseEventHandler<T>;
1317
1349
  onContextMenu?: MouseEventHandler<T>;
@@ -1415,65 +1447,8 @@ declare namespace React {
1415
1447
  */
1416
1448
  }
1417
1449
 
1418
- interface HTMLAttributes<T> extends DOMAttributes<T> {
1419
- // React-specific Attributes
1420
- defaultChecked?: boolean;
1421
- defaultValue?: string | string[];
1422
- suppressContentEditableWarning?: boolean;
1423
- suppressHydrationWarning?: boolean;
1424
-
1425
- // Standard HTML Attributes
1426
- accessKey?: string;
1427
- className?: string;
1428
- contentEditable?: boolean;
1429
- contextMenu?: string;
1430
- dir?: string;
1431
- draggable?: boolean;
1432
- hidden?: boolean;
1433
- id?: string;
1434
- lang?: string;
1435
- placeholder?: string;
1436
- slot?: string;
1437
- spellCheck?: boolean;
1438
- style?: CSSProperties;
1439
- tabIndex?: number;
1440
- title?: string;
1441
-
1442
- // Unknown
1443
- inputMode?: string;
1444
- is?: string;
1445
- radioGroup?: string; // <command>, <menuitem>
1446
-
1447
- // WAI-ARIA
1448
- role?: string;
1449
-
1450
- // RDFa Attributes
1451
- about?: string;
1452
- datatype?: string;
1453
- inlist?: any;
1454
- prefix?: string;
1455
- property?: string;
1456
- resource?: string;
1457
- typeof?: string;
1458
- vocab?: string;
1459
-
1460
- // Non-standard Attributes
1461
- autoCapitalize?: string;
1462
- autoCorrect?: string;
1463
- autoSave?: string;
1464
- color?: string;
1465
- itemProp?: string;
1466
- itemScope?: boolean;
1467
- itemType?: string;
1468
- itemID?: string;
1469
- itemRef?: string;
1470
- results?: number;
1471
- security?: string;
1472
- unselectable?: 'on' | 'off';
1473
- }
1474
-
1475
1450
  // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
1476
- interface HTMLAttributes<T> extends DOMAttributes<T> {
1451
+ interface AriaAttributes {
1477
1452
  /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
1478
1453
  'aria-activedescendant'?: string;
1479
1454
  /** 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. */
@@ -1660,6 +1635,63 @@ declare namespace React {
1660
1635
  'aria-valuetext'?: string;
1661
1636
  }
1662
1637
 
1638
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
1639
+ // React-specific Attributes
1640
+ defaultChecked?: boolean;
1641
+ defaultValue?: string | string[];
1642
+ suppressContentEditableWarning?: boolean;
1643
+ suppressHydrationWarning?: boolean;
1644
+
1645
+ // Standard HTML Attributes
1646
+ accessKey?: string;
1647
+ className?: string;
1648
+ contentEditable?: boolean;
1649
+ contextMenu?: string;
1650
+ dir?: string;
1651
+ draggable?: boolean;
1652
+ hidden?: boolean;
1653
+ id?: string;
1654
+ lang?: string;
1655
+ placeholder?: string;
1656
+ slot?: string;
1657
+ spellCheck?: boolean;
1658
+ style?: CSSProperties;
1659
+ tabIndex?: number;
1660
+ title?: string;
1661
+
1662
+ // Unknown
1663
+ inputMode?: string;
1664
+ is?: string;
1665
+ radioGroup?: string; // <command>, <menuitem>
1666
+
1667
+ // WAI-ARIA
1668
+ role?: string;
1669
+
1670
+ // RDFa Attributes
1671
+ about?: string;
1672
+ datatype?: string;
1673
+ inlist?: any;
1674
+ prefix?: string;
1675
+ property?: string;
1676
+ resource?: string;
1677
+ typeof?: string;
1678
+ vocab?: string;
1679
+
1680
+ // Non-standard Attributes
1681
+ autoCapitalize?: string;
1682
+ autoCorrect?: string;
1683
+ autoSave?: string;
1684
+ color?: string;
1685
+ itemProp?: string;
1686
+ itemScope?: boolean;
1687
+ itemType?: string;
1688
+ itemID?: string;
1689
+ itemRef?: string;
1690
+ results?: number;
1691
+ security?: string;
1692
+ unselectable?: 'on' | 'off';
1693
+ }
1694
+
1663
1695
  interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1664
1696
  // Standard HTML Attributes
1665
1697
  accept?: string;
@@ -2173,7 +2205,7 @@ declare namespace React {
2173
2205
  // - "number | string"
2174
2206
  // - "string"
2175
2207
  // - union of string literals
2176
- interface SVGAttributes<T> extends DOMAttributes<T> {
2208
+ interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
2177
2209
  // Attributes which also defined in HTMLAttributes
2178
2210
  // See comment in SVGDOMPropertyConfig.js
2179
2211
  className?: string;
@@ -2732,16 +2764,21 @@ declare namespace React {
2732
2764
  // so boolean is only resolved for T = any
2733
2765
  type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
2734
2766
 
2767
+ type ExactlyAnyPropertyKeys<T> = { [K in keyof T]: IsExactlyAny<T[K]> extends true ? K : never }[keyof T];
2768
+ type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
2769
+
2735
2770
  // Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
2736
- // If props is type any, use propTypes definitions, otherwise for each `any` property of props, use the propTypes type
2737
- // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
2738
- type MergePropTypes<P, T> = IsExactlyAny<P> extends true ? T : ({
2739
- [K in keyof P]: IsExactlyAny<P[K]> extends true
2740
- ? K extends keyof T
2741
- ? T[K]
2742
- : P[K]
2743
- : P[K]
2744
- } & Pick<T, Exclude<keyof T, keyof P>>);
2771
+ 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>>;
2745
2782
 
2746
2783
  // Any prop that has a default prop becomes optional, but its type is unchanged
2747
2784
  // 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.10",
3
+ "version": "16.8.14",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -110,6 +110,11 @@
110
110
  "name": "Kanitkorn Sujautra",
111
111
  "url": "https://github.com/lukyth",
112
112
  "githubUsername": "lukyth"
113
+ },
114
+ {
115
+ "name": "Sebastian Silbermann",
116
+ "url": "https://github.com/eps1lon",
117
+ "githubUsername": "eps1lon"
113
118
  }
114
119
  ],
115
120
  "main": "",
@@ -124,6 +129,6 @@
124
129
  "@types/prop-types": "*",
125
130
  "csstype": "^2.2.0"
126
131
  },
127
- "typesPublisherContentHash": "f05e832edb055a82292d920f245db861b825499be02803b2c8663106c0cc9601",
132
+ "typesPublisherContentHash": "a4d2e1c6c7a4599311e780c6d66561a65f718b8fd2a7cd66313443a8bb3fef75",
128
133
  "typeScriptVersion": "2.8"
129
134
  }