@types/react 18.0.21 → 18.0.23

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: Thu, 22 Sep 2022 16:32:39 GMT
11
+ * Last updated: Tue, 25 Oct 2022 18:02:53 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/experimental.d.ts CHANGED
@@ -103,33 +103,6 @@ declare module '.' {
103
103
  */
104
104
  export const SuspenseList: ExoticComponent<SuspenseListProps>;
105
105
 
106
- interface ThenableImpl<T> {
107
- then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
108
- }
109
- interface UntrackedThenable<T> extends ThenableImpl<T> {
110
- status?: void;
111
- }
112
-
113
- export interface PendingThenable<T> extends ThenableImpl<T> {
114
- status: 'pending';
115
- }
116
-
117
- export interface FulfilledThenable<T> extends ThenableImpl<T> {
118
- status: 'fulfilled';
119
- value: T;
120
- }
121
-
122
- export interface RejectedThenable<T> extends ThenableImpl<T> {
123
- status: 'rejected';
124
- reason: unknown;
125
- }
126
-
127
- export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>;
128
-
129
- export type Usable<T> = Thenable<T> | Context<T>;
130
-
131
- export function experimental_use<T>(usable: Usable<T>): T;
132
-
133
106
  // tslint:disable-next-line ban-types
134
107
  export function experimental_useEvent<T extends Function>(event: T): T;
135
108
  }
react/index.d.ts CHANGED
@@ -1857,6 +1857,7 @@ declare namespace React {
1857
1857
  hidden?: boolean | undefined;
1858
1858
  id?: string | undefined;
1859
1859
  lang?: string | undefined;
1860
+ nonce?: string | undefined;
1860
1861
  placeholder?: string | undefined;
1861
1862
  slot?: string | undefined;
1862
1863
  spellCheck?: Booleanish | undefined;
@@ -1977,7 +1978,6 @@ declare namespace React {
1977
1978
  multiple?: boolean | undefined;
1978
1979
  muted?: boolean | undefined;
1979
1980
  name?: string | undefined;
1980
- nonce?: string | undefined;
1981
1981
  noValidate?: boolean | undefined;
1982
1982
  open?: boolean | undefined;
1983
1983
  optimum?: number | undefined;
@@ -2390,7 +2390,6 @@ declare namespace React {
2390
2390
  defer?: boolean | undefined;
2391
2391
  integrity?: string | undefined;
2392
2392
  noModule?: boolean | undefined;
2393
- nonce?: string | undefined;
2394
2393
  referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
2395
2394
  src?: string | undefined;
2396
2395
  type?: string | undefined;
@@ -2421,7 +2420,6 @@ declare namespace React {
2421
2420
 
2422
2421
  interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
2423
2422
  media?: string | undefined;
2424
- nonce?: string | undefined;
2425
2423
  scoped?: boolean | undefined;
2426
2424
  type?: string | undefined;
2427
2425
  }
react/next.d.ts CHANGED
@@ -27,4 +27,60 @@ import React = require('.');
27
27
 
28
28
  export {};
29
29
 
30
- declare module '.' {}
30
+ declare module '.' {
31
+ interface ThenableImpl<T> {
32
+ then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
33
+ }
34
+ interface UntrackedThenable<T> extends ThenableImpl<T> {
35
+ status?: void;
36
+ }
37
+
38
+ export interface PendingThenable<T> extends ThenableImpl<T> {
39
+ status: 'pending';
40
+ }
41
+
42
+ export interface FulfilledThenable<T> extends ThenableImpl<T> {
43
+ status: 'fulfilled';
44
+ value: T;
45
+ }
46
+
47
+ export interface RejectedThenable<T> extends ThenableImpl<T> {
48
+ status: 'rejected';
49
+ reason: unknown;
50
+ }
51
+
52
+ export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>;
53
+
54
+ export type Usable<T> = Thenable<T> | Context<T>;
55
+
56
+ export function use<T>(usable: Usable<T>): T;
57
+
58
+ interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONArray> {}
59
+ export type ServerContextJSONValue =
60
+ | string
61
+ | boolean
62
+ | number
63
+ | null
64
+ | ServerContextJSONArray
65
+ | { [key: string]: ServerContextJSONValue };
66
+ export interface ServerContext<T extends ServerContextJSONValue> {
67
+ Provider: Provider<T>;
68
+ }
69
+ /**
70
+ * Accepts a context object (the value returned from `React.createContext` or `React.createServerContext`) and returns the current
71
+ * context value, as given by the nearest context provider for the given context.
72
+ *
73
+ * @version 16.8.0
74
+ * @see https://reactjs.org/docs/hooks-reference.html#usecontext
75
+ */
76
+ function useContext<T extends ServerContextJSONValue>(context: ServerContext<T>): T;
77
+ export function createServerContext<T extends ServerContextJSONValue>(
78
+ globalName: string,
79
+ defaultValue: T,
80
+ ): ServerContext<T>;
81
+
82
+ // tslint:disable-next-line ban-types
83
+ export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
84
+
85
+ export function unstable_useCacheRefresh(): () => void;
86
+ }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.0.21",
3
+ "version": "18.0.23",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -146,7 +146,7 @@
146
146
  "@types/scheduler": "*",
147
147
  "csstype": "^3.0.2"
148
148
  },
149
- "typesPublisherContentHash": "69c972e7538ec55b48bc7e30e03de126298ffaf2e8ccd24e571b280106dab557",
149
+ "typesPublisherContentHash": "272caf71ab8eed2922edc3c9de8a9de9b68374e50195b20913f60d41bc4936c5",
150
150
  "typeScriptVersion": "4.1",
151
151
  "exports": {
152
152
  ".": {