@types/react 16.8.9 → 16.8.13

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 (4) hide show
  1. react/README.md +2 -2
  2. react/global.d.ts +1 -0
  3. react/index.d.ts +47 -9
  4. 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 13:37:34 GMT
11
+ * Last updated: Mon, 08 Apr 2019 04:24:39 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/global.d.ts CHANGED
@@ -97,6 +97,7 @@ interface SVGFEConvolveMatrixElement extends SVGElement { }
97
97
  interface SVGFEDiffuseLightingElement extends SVGElement { }
98
98
  interface SVGFEDisplacementMapElement extends SVGElement { }
99
99
  interface SVGFEDistantLightElement extends SVGElement { }
100
+ interface SVGFEDropShadowElement extends SVGElement { }
100
101
  interface SVGFEFloodElement extends SVGElement { }
101
102
  interface SVGFEFuncAElement extends SVGElement { }
102
103
  interface SVGFEFuncBElement extends SVGElement { }
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>;
@@ -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
@@ -2922,6 +2959,7 @@ declare global {
2922
2959
  feDiffuseLighting: React.SVGProps<SVGFEDiffuseLightingElement>;
2923
2960
  feDisplacementMap: React.SVGProps<SVGFEDisplacementMapElement>;
2924
2961
  feDistantLight: React.SVGProps<SVGFEDistantLightElement>;
2962
+ feDropShadow: React.SVGProps<SVGFEDropShadowElement>;
2925
2963
  feFlood: React.SVGProps<SVGFEFloodElement>;
2926
2964
  feFuncA: React.SVGProps<SVGFEFuncAElement>;
2927
2965
  feFuncB: React.SVGProps<SVGFEFuncBElement>;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.8.9",
3
+ "version": "16.8.13",
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": "25e96b596ff893e29e2a6d6efe0dca31e01d25c51b750049c17226ed58f4dee0",
132
+ "typesPublisherContentHash": "53d31798b997bfdad69e11ba927c3df23f4f9df1aa3888dfb9b4d665e7a2e946",
128
133
  "typeScriptVersion": "2.8"
129
134
  }