@types/react 16.9.45 → 16.9.49

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.
react/README.md CHANGED
@@ -8,7 +8,7 @@ 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: Sat, 08 Aug 2020 10:35:40 GMT
11
+ * Last updated: Mon, 31 Aug 2020 16:41:48 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types)
13
13
  * Global values: `React`
14
14
 
react/experimental.d.ts CHANGED
@@ -163,4 +163,26 @@ declare module '.' {
163
163
  * @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition
164
164
  */
165
165
  export function unstable_useTransition(config?: SuspenseConfig | null): [TransitionStartFunction, boolean];
166
+
167
+ /**
168
+ * @private
169
+ */
170
+ const opaqueIdentifierBranding: unique symbol;
171
+ /**
172
+ * WARNING: Don't use this as a `string`.
173
+ *
174
+ * This is an opaque type that is not supposed to type-check structurally.
175
+ * It is only valid if returned from React methods and passed to React e.g. `<button aria-labelledby={opaqueIdentifier} />`
176
+ */
177
+ // We can't create a type that would be rejected for string concatenation or `.toString()` calls.
178
+ // So in order to not have to add `string | OpaqueIdentifier` to every react-dom host prop we intersect it with `string`.
179
+ type OpaqueIdentifier = string & {
180
+ readonly [opaqueIdentifierBranding]: unknown;
181
+ // While this would cause `const stringified: string = opaqueIdentifier.toString()` to not type-check it also adds completions while typing.
182
+ // It would also still allow string concatenation.
183
+ // Unsure which is better. Not type-checking or not suggesting.
184
+ // toString(): void;
185
+ };
186
+
187
+ export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
166
188
  }
react/index.d.ts CHANGED
@@ -551,6 +551,16 @@ declare namespace React {
551
551
  displayName?: string;
552
552
  }
553
553
 
554
+ type VFC<P = {}> = VoidFunctionComponent<P>;
555
+
556
+ interface VoidFunctionComponent<P = {}> {
557
+ (props: P, context?: any): ReactElement<any, any> | null;
558
+ propTypes?: WeakValidationMap<P>;
559
+ contextTypes?: ValidationMap<any>;
560
+ defaultProps?: Partial<P>;
561
+ displayName?: string;
562
+ }
563
+
554
564
  interface ForwardRefRenderFunction<T, P = {}> {
555
565
  (props: PropsWithChildren<P>, ref: ((instance: T | null) => void) | MutableRefObject<T | null> | null): ReactElement | null;
556
566
  displayName?: string;
@@ -1200,6 +1210,7 @@ declare namespace React {
1200
1210
 
1201
1211
  interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> {
1202
1212
  altKey: boolean;
1213
+ /** @deprecated */
1203
1214
  charCode: number;
1204
1215
  ctrlKey: boolean;
1205
1216
  /**
@@ -1210,6 +1221,7 @@ declare namespace React {
1210
1221
  * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
1211
1222
  */
1212
1223
  key: string;
1224
+ /** @deprecated */
1213
1225
  keyCode: number;
1214
1226
  locale: string;
1215
1227
  location: number;
@@ -1686,7 +1698,7 @@ declare namespace React {
1686
1698
  * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
1687
1699
  * @see aria-atomic.
1688
1700
  */
1689
- 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
1701
+ 'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
1690
1702
  /** Indicates that user input is required on the element before a form may be submitted. */
1691
1703
  'aria-required'?: boolean | 'false' | 'true';
1692
1704
  /** Defines a human-readable, author-localized description for the role of an element. */
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.45",
3
+ "version": "16.9.49",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -144,6 +144,6 @@
144
144
  "@types/prop-types": "*",
145
145
  "csstype": "^3.0.2"
146
146
  },
147
- "typesPublisherContentHash": "e7fbd5f037ebbb51c6d93ed7b051e32baa5ae9c0e3d8a7fcd462d7c70a776466",
148
- "typeScriptVersion": "3.0"
147
+ "typesPublisherContentHash": "b034149a5cda0dd4cd3ee0abc4fec00bfcaf5a2d7d57ac0b8097f45735912dd3",
148
+ "typeScriptVersion": "3.1"
149
149
  }