@types/react 18.2.26 → 18.2.27

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: Mon, 09 Oct 2023 15:07:04 GMT
11
+ * Last updated: Mon, 09 Oct 2023 17:06:13 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/canary.d.ts CHANGED
@@ -27,6 +27,9 @@ import React = require(".");
27
27
 
28
28
  export {};
29
29
 
30
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
31
+ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
32
+
30
33
  declare module "." {
31
34
  interface ThenableImpl<T> {
32
35
  then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
@@ -83,4 +86,27 @@ declare module "." {
83
86
  export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
84
87
 
85
88
  export function unstable_useCacheRefresh(): () => void;
89
+
90
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
91
+ functions: (formData: FormData) => void;
92
+ }
93
+
94
+ export interface TransitionStartFunction {
95
+ /**
96
+ * Marks all state updates inside the async function as transitions
97
+ *
98
+ * @see {https://react.dev/reference/react/useTransition#starttransition}
99
+ *
100
+ * @param callback
101
+ */
102
+ (callback: () => Promise<VoidOrUndefinedOnly>): void;
103
+ }
104
+
105
+ function useOptimistic<State>(
106
+ passthrough: State,
107
+ ): [State, (action: State | ((pendingState: State) => State)) => void];
108
+ function useOptimistic<State, Action>(
109
+ passthrough: State,
110
+ reducer: (state: State, action: Action) => State,
111
+ ): [State, (action: Action) => void];
86
112
  }
react/experimental.d.ts CHANGED
@@ -115,29 +115,6 @@ declare module "." {
115
115
  // tslint:disable-next-line ban-types
116
116
  export function experimental_useEffectEvent<T extends Function>(event: T): T;
117
117
 
118
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
119
- functions: (formData: FormData) => void;
120
- }
121
-
122
- export interface TransitionStartFunction {
123
- /**
124
- * Marks all state updates inside the async function as transitions
125
- *
126
- * @see {https://react.dev/reference/react/useTransition#starttransition}
127
- *
128
- * @param callback
129
- */
130
- (callback: () => Promise<VoidOrUndefinedOnly>): void;
131
- }
132
-
133
- function experimental_useOptimistic<State>(
134
- passthrough: State,
135
- ): [State, (action: State | ((pendingState: State) => State)) => void];
136
- function experimental_useOptimistic<State, Action>(
137
- passthrough: State,
138
- reducer: (state: State, action: Action) => State,
139
- ): [State, (action: Action) => void];
140
-
141
118
  type Reference = object;
142
119
  type TaintableUniqueValue = string | bigint | ArrayBufferView;
143
120
  function experimental_taintUniqueValue(
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.2.26",
3
+ "version": "18.2.27",
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": "154fa673d2cbfac97da523e5d750b9ddce7b706651ed3783376dea70da3596e4",
161
+ "typesPublisherContentHash": "c0abbd07dafe133c7d3c20e408980b0b917569610e3d8dd48b0f47fabcee2086",
162
162
  "typeScriptVersion": "4.5",
163
163
  "exports": {
164
164
  ".": {
react/ts5.0/canary.d.ts CHANGED
@@ -27,6 +27,9 @@ import React = require(".");
27
27
 
28
28
  export {};
29
29
 
30
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
31
+ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
32
+
30
33
  declare module "." {
31
34
  interface ThenableImpl<T> {
32
35
  then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
@@ -83,4 +86,27 @@ declare module "." {
83
86
  export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
84
87
 
85
88
  export function unstable_useCacheRefresh(): () => void;
89
+
90
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
91
+ functions: (formData: FormData) => void;
92
+ }
93
+
94
+ export interface TransitionStartFunction {
95
+ /**
96
+ * Marks all state updates inside the async function as transitions
97
+ *
98
+ * @see {https://react.dev/reference/react/ts5.0/useTransition#starttransition}
99
+ *
100
+ * @param callback
101
+ */
102
+ (callback: () => Promise<VoidOrUndefinedOnly>): void;
103
+ }
104
+
105
+ function useOptimistic<State>(
106
+ passthrough: State,
107
+ ): [State, (action: State | ((pendingState: State) => State)) => void];
108
+ function useOptimistic<State, Action>(
109
+ passthrough: State,
110
+ reducer: (state: State, action: Action) => State,
111
+ ): [State, (action: Action) => void];
86
112
  }
@@ -115,29 +115,6 @@ declare module "." {
115
115
  // tslint:disable-next-line ban-types
116
116
  export function experimental_useEffectEvent<T extends Function>(event: T): T;
117
117
 
118
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
119
- functions: (formData: FormData) => void;
120
- }
121
-
122
- export interface TransitionStartFunction {
123
- /**
124
- * Marks all state updates inside the async function as transitions
125
- *
126
- * @see {https://react.dev/reference/react/ts5.0/useTransition#starttransition}
127
- *
128
- * @param callback
129
- */
130
- (callback: () => Promise<VoidOrUndefinedOnly>): void;
131
- }
132
-
133
- function experimental_useOptimistic<State>(
134
- passthrough: State,
135
- ): [State, (action: State | ((pendingState: State) => State)) => void];
136
- function experimental_useOptimistic<State, Action>(
137
- passthrough: State,
138
- reducer: (state: State, action: Action) => State,
139
- ): [State, (action: Action) => void];
140
-
141
118
  type Reference = object;
142
119
  type TaintableUniqueValue = string | bigint | ArrayBufferView;
143
120
  function experimental_taintUniqueValue(