@types/react 16.9.6 → 16.9.10

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 +3 -0
  3. react/index.d.ts +19 -6
  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/reac
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, 14 Oct 2019 21:08:21 GMT
11
+ * Last updated: Thu, 24 Oct 2019 17:38:22 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>, Dovydas Navickas <https://github.com/DovydasNavickas>, 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>, and 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>, Dovydas Navickas <https://github.com/DovydasNavickas>, 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>, and Kyle Scully <https://github.com/zieka>.
react/global.d.ts CHANGED
@@ -2,6 +2,9 @@
2
2
  React projects that don't include the DOM library need these interfaces to compile.
3
3
  React Native applications use React, but there is no DOM available. The JavaScript runtime
4
4
  is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`.
5
+
6
+ Warning: all of these interfaces are empty. If you want type definitions for various properties
7
+ (such as HTMLInputElement.prototype.value), you need to add `--lib DOM` (via command line or tsconfig.json).
5
8
  */
6
9
 
7
10
  interface Event { }
react/index.d.ts CHANGED
@@ -20,6 +20,7 @@
20
20
  // Saransh Kataria <https://github.com/saranshkataria>
21
21
  // Kanitkorn Sujautra <https://github.com/lukyth>
22
22
  // Sebastian Silbermann <https://github.com/eps1lon>
23
+ // Kyle Scully <https://github.com/zieka>
23
24
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
24
25
  // TypeScript Version: 2.8
25
26
 
@@ -337,6 +338,8 @@ declare namespace React {
337
338
  displayName?: string;
338
339
  }
339
340
  function createContext<T>(
341
+ // If you thought this should be optional, see
342
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
340
343
  defaultValue: T,
341
344
  calculateChangedBits?: (prev: T, next: T) => number
342
345
  ): Context<T>;
@@ -416,6 +419,7 @@ declare namespace React {
416
419
  /**
417
420
  * If using the new style context, re-declare this in your class to be the
418
421
  * `React.ContextType` of your `static contextType`.
422
+ * Should be used with type annotation or static contextType.
419
423
  *
420
424
  * ```ts
421
425
  * static contextType = MyContext
@@ -425,8 +429,7 @@ declare namespace React {
425
429
  * declare context: React.ContextType<typeof MyContext>
426
430
  * ```
427
431
  *
428
- * @deprecated if used without a type annotation, or without static contextType
429
- * @see https://reactjs.org/docs/legacy-context.html
432
+ * @see https://reactjs.org/docs/context.html
430
433
  */
431
434
  // TODO (TypeScript 3.0): unknown
432
435
  context: any;
@@ -1085,7 +1088,7 @@ declare namespace React {
1085
1088
  }
1086
1089
 
1087
1090
  interface FocusEvent<T = Element> extends SyntheticEvent<T, NativeFocusEvent> {
1088
- relatedTarget: EventTarget;
1091
+ relatedTarget: EventTarget | null;
1089
1092
  target: EventTarget & T;
1090
1093
  }
1091
1094
 
@@ -1138,7 +1141,7 @@ declare namespace React {
1138
1141
  movementY: number;
1139
1142
  pageX: number;
1140
1143
  pageY: number;
1141
- relatedTarget: EventTarget;
1144
+ relatedTarget: EventTarget | null;
1142
1145
  screenX: number;
1143
1146
  screenY: number;
1144
1147
  shiftKey: boolean;
@@ -1658,8 +1661,6 @@ declare namespace React {
1658
1661
  title?: string;
1659
1662
 
1660
1663
  // Unknown
1661
- inputMode?: string;
1662
- is?: string;
1663
1664
  radioGroup?: string; // <command>, <menuitem>
1664
1665
 
1665
1666
  // WAI-ARIA
@@ -1688,6 +1689,18 @@ declare namespace React {
1688
1689
  results?: number;
1689
1690
  security?: string;
1690
1691
  unselectable?: 'on' | 'off';
1692
+
1693
+ // Living Standard
1694
+ /**
1695
+ * Hints at the type of data that might be entered by the user while editing the element or its contents
1696
+ * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
1697
+ */
1698
+ inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
1699
+ /**
1700
+ * Specify that a standard HTML element should behave like a defined custom built-in element
1701
+ * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
1702
+ */
1703
+ is?: string;
1691
1704
  }
1692
1705
 
1693
1706
  interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.6",
3
+ "version": "16.9.10",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -100,6 +100,11 @@
100
100
  "name": "Sebastian Silbermann",
101
101
  "url": "https://github.com/eps1lon",
102
102
  "githubUsername": "eps1lon"
103
+ },
104
+ {
105
+ "name": "Kyle Scully",
106
+ "url": "https://github.com/zieka",
107
+ "githubUsername": "zieka"
103
108
  }
104
109
  ],
105
110
  "main": "",
@@ -114,6 +119,6 @@
114
119
  "@types/prop-types": "*",
115
120
  "csstype": "^2.2.0"
116
121
  },
117
- "typesPublisherContentHash": "136048ee08f939e620cd1f168220d12c7ae5302858a5625ae5b76e3c2fd3af64",
122
+ "typesPublisherContentHash": "53e1815d9afcbb47175d31334d9375f2cb9a331043d21f4f9b7939b21b187be0",
118
123
  "typeScriptVersion": "2.8"
119
124
  }