@types/react 17.0.32 → 17.0.36

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 +1 -1
  2. react/index.d.ts +5 -2
  3. react/next.d.ts +1 -18
  4. react/package.json +3 -3
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: Sun, 24 Oct 2021 10:01:20 GMT
11
+ * Last updated: Sun, 21 Nov 2021 17:01:07 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
13
13
  * Global values: `React`
14
14
 
react/index.d.ts CHANGED
@@ -395,9 +395,12 @@ declare namespace React {
395
395
  interface SuspenseProps {
396
396
  children?: ReactNode | undefined;
397
397
 
398
+ // TODO(react18): `fallback?: ReactNode;`
398
399
  /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
399
400
  fallback: NonNullable<ReactNode>|null;
400
401
  }
402
+
403
+ // TODO(react18): Updated JSDoc to reflect that Suspense works on the server.
401
404
  /**
402
405
  * This feature is not yet available for server-side rendering.
403
406
  * Suspense support will be added in a later release.
@@ -836,7 +839,7 @@ declare namespace React {
836
839
  ? JSX.IntrinsicElements[T]
837
840
  : {};
838
841
  type ComponentPropsWithRef<T extends ElementType> =
839
- T extends ComponentClass<infer P>
842
+ T extends (new (props: infer P) => Component<any, any>)
840
843
  ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
841
844
  : PropsWithRef<ComponentProps<T>>;
842
845
  type ComponentPropsWithoutRef<T extends ElementType> =
@@ -1212,7 +1215,7 @@ declare namespace React {
1212
1215
  target: EventTarget & T;
1213
1216
  }
1214
1217
 
1215
- interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> {
1218
+ interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
1216
1219
  altKey: boolean;
1217
1220
  /** @deprecated */
1218
1221
  charCode: number;
react/next.d.ts CHANGED
@@ -151,24 +151,7 @@ declare module '.' {
151
151
  */
152
152
  export function startTransition(scope: TransitionFunction): void;
153
153
 
154
- const opaqueIdentifierBranding: unique symbol;
155
- /**
156
- * WARNING: Don't use this as a `string`.
157
- *
158
- * This is an opaque type that is not supposed to type-check structurally.
159
- * It is only valid if returned from React methods and passed to React e.g. `<button aria-labelledby={opaqueIdentifier} />`
160
- */
161
- // We can't create a type that would be rejected for string concatenation or `.toString()` calls.
162
- // So in order to not have to add `string | OpaqueIdentifier` to every react-dom host prop we intersect it with `string`.
163
- type OpaqueIdentifier = string & {
164
- readonly [opaqueIdentifierBranding]: unknown;
165
- // While this would cause `const stringified: string = opaqueIdentifier.toString()` to not type-check it also adds completions while typing.
166
- // It would also still allow string concatenation.
167
- // Unsure which is better. Not type-checking or not suggesting.
168
- // toString(): void;
169
- };
170
-
171
- export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
154
+ export function useId(): string;
172
155
 
173
156
  /**
174
157
  * this should be an internal type
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "17.0.32",
3
+ "version": "17.0.36",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -146,6 +146,6 @@
146
146
  "@types/scheduler": "*",
147
147
  "csstype": "^3.0.2"
148
148
  },
149
- "typesPublisherContentHash": "22cae98756f52a46651a5fc9e3661958cc699f007bcade7f0cc976b9f32d2715",
150
- "typeScriptVersion": "3.7"
149
+ "typesPublisherContentHash": "ecb4da04a2bc805bdcfa83d8a2f7e56a558d3caaa63780a585284dce673e3285",
150
+ "typeScriptVersion": "3.8"
151
151
  }