@types/react 18.2.1 → 18.2.3

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 (https://react.dev/).
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, 03 May 2023 16:02:45 GMT
11
+ * Last updated: Thu, 04 May 2023 05:32:46 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
@@ -123,4 +123,9 @@ declare module '.' {
123
123
  */
124
124
  (callback: () => Promise<VoidOrUndefinedOnly>): void;
125
125
  }
126
+
127
+ function experimental_useOptimistic<State, Action>(
128
+ passthrough: State,
129
+ reducer?: (state: State, action: Action) => State,
130
+ ): [State, (action: Action) => void];
126
131
  }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.2.1",
3
+ "version": "18.2.3",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -158,7 +158,7 @@
158
158
  "@types/scheduler": "*",
159
159
  "csstype": "^3.0.2"
160
160
  },
161
- "typesPublisherContentHash": "5a527e26de4273111ffb28c278bd313f63019a022384c79df04607e8f0b6d1bd",
161
+ "typesPublisherContentHash": "87bcd903c06e06e52bd185ab43724a84c9384b7f29c2f1f1de3d6fcae9667f66",
162
162
  "typeScriptVersion": "4.3",
163
163
  "exports": {
164
164
  ".": {
@@ -38,6 +38,9 @@ import React = require('./next');
38
38
 
39
39
  export {};
40
40
 
41
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
42
+ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
43
+
41
44
  declare module '.' {
42
45
  export interface SuspenseProps {
43
46
  /**
@@ -105,4 +108,24 @@ declare module '.' {
105
108
 
106
109
  // tslint:disable-next-line ban-types
107
110
  export function experimental_useEffectEvent<T extends Function>(event: T): T;
111
+
112
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
113
+ functions: (formData: FormData) => void;
114
+ }
115
+
116
+ export interface TransitionStartFunction {
117
+ /**
118
+ * Marks all state updates inside the async function as transitions
119
+ *
120
+ * @see {https://react.dev/reference/react/ts5.0/useTransition#starttransition}
121
+ *
122
+ * @param callback
123
+ */
124
+ (callback: () => Promise<VoidOrUndefinedOnly>): void;
125
+ }
126
+
127
+ function experimental_useOptimistic<State, Action>(
128
+ passthrough: State,
129
+ reducer?: (state: State, action: Action) => State,
130
+ ): [State, (action: Action) => void];
108
131
  }
react/ts5.0/global.d.ts CHANGED
@@ -149,6 +149,7 @@ interface SVGTSpanElement extends SVGElement { }
149
149
  interface SVGUseElement extends SVGElement { }
150
150
  interface SVGViewElement extends SVGElement { }
151
151
 
152
+ interface FormData {}
152
153
  interface Text { }
153
154
  interface TouchList { }
154
155
  interface WebGLRenderingContext { }
react/ts5.0/index.d.ts CHANGED
@@ -1898,11 +1898,21 @@ declare namespace React {
1898
1898
  is?: string | undefined;
1899
1899
  }
1900
1900
 
1901
+ /**
1902
+ * For internal usage only.
1903
+ * Different release channels declare additional types of ReactNode this particular release channel accepts.
1904
+ * App or library types should never augment this interface.
1905
+ */
1906
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {}
1907
+
1901
1908
  interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1902
1909
  // Standard HTML Attributes
1903
1910
  accept?: string | undefined;
1904
1911
  acceptCharset?: string | undefined;
1905
- action?: string | undefined;
1912
+ action?:
1913
+ | string
1914
+ | undefined
1915
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS];
1906
1916
  allowFullScreen?: boolean | undefined;
1907
1917
  allowTransparency?: boolean | undefined;
1908
1918
  alt?: string | undefined;
@@ -1931,7 +1941,10 @@ declare namespace React {
1931
1941
  download?: any;
1932
1942
  encType?: string | undefined;
1933
1943
  form?: string | undefined;
1934
- formAction?: string | undefined;
1944
+ formAction?:
1945
+ | string
1946
+ | undefined
1947
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS];
1935
1948
  formEncType?: string | undefined;
1936
1949
  formMethod?: string | undefined;
1937
1950
  formNoValidate?: boolean | undefined;
@@ -2059,7 +2072,10 @@ declare namespace React {
2059
2072
  interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
2060
2073
  disabled?: boolean | undefined;
2061
2074
  form?: string | undefined;
2062
- formAction?: string | undefined;
2075
+ formAction?:
2076
+ | string
2077
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS]
2078
+ | undefined;
2063
2079
  formEncType?: string | undefined;
2064
2080
  formMethod?: string | undefined;
2065
2081
  formNoValidate?: boolean | undefined;
@@ -2118,7 +2134,10 @@ declare namespace React {
2118
2134
 
2119
2135
  interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
2120
2136
  acceptCharset?: string | undefined;
2121
- action?: string | undefined;
2137
+ action?:
2138
+ | string
2139
+ | undefined
2140
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS];
2122
2141
  autoComplete?: string | undefined;
2123
2142
  encType?: string | undefined;
2124
2143
  method?: string | undefined;
@@ -2208,7 +2227,10 @@ declare namespace React {
2208
2227
  disabled?: boolean | undefined;
2209
2228
  enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;
2210
2229
  form?: string | undefined;
2211
- formAction?: string | undefined;
2230
+ formAction?:
2231
+ | string
2232
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS]
2233
+ | undefined;
2212
2234
  formEncType?: string | undefined;
2213
2235
  formMethod?: string | undefined;
2214
2236
  formNoValidate?: boolean | undefined;