File tree Expand file tree Collapse file tree 2 files changed +50
-2
lines changed
Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -1926,7 +1926,31 @@ declare namespace React {
19261926 reducer : ( state : State , action : Action ) => State ,
19271927 ) : [ State , ( action : Action ) => void ] ;
19281928
1929- export type Usable < T > = PromiseLike < T > | Context < T > ;
1929+ interface UntrackedReactPromise < T > extends PromiseLike < T > {
1930+ status ?: void ;
1931+ }
1932+
1933+ export interface PendingReactPromise < T > extends PromiseLike < T > {
1934+ status : "pending" ;
1935+ }
1936+
1937+ export interface FulfilledReactPromise < T > extends PromiseLike < T > {
1938+ status : "fulfilled" ;
1939+ value : T ;
1940+ }
1941+
1942+ export interface RejectedReactPromise < T > extends PromiseLike < T > {
1943+ status : "rejected" ;
1944+ reason : unknown ;
1945+ }
1946+
1947+ export type ReactPromise < T > =
1948+ | UntrackedReactPromise < T >
1949+ | PendingReactPromise < T >
1950+ | FulfilledReactPromise < T >
1951+ | RejectedReactPromise < T > ;
1952+
1953+ export type Usable < T > = ReactPromise < T > | Context < T > ;
19301954
19311955 export function use < T > ( usable : Usable < T > ) : T ;
19321956
Original file line number Diff line number Diff line change @@ -1925,7 +1925,31 @@ declare namespace React {
19251925 reducer : ( state : State , action : Action ) => State ,
19261926 ) : [ State , ( action : Action ) => void ] ;
19271927
1928- export type Usable < T > = PromiseLike < T > | Context < T > ;
1928+ interface UntrackedReactPromise < T > extends PromiseLike < T > {
1929+ status ?: void ;
1930+ }
1931+
1932+ export interface PendingReactPromise < T > extends PromiseLike < T > {
1933+ status : "pending" ;
1934+ }
1935+
1936+ export interface FulfilledReactPromise < T > extends PromiseLike < T > {
1937+ status : "fulfilled" ;
1938+ value : T ;
1939+ }
1940+
1941+ export interface RejectedReactPromise < T > extends PromiseLike < T > {
1942+ status : "rejected" ;
1943+ reason : unknown ;
1944+ }
1945+
1946+ export type ReactPromise < T > =
1947+ | UntrackedReactPromise < T >
1948+ | PendingReactPromise < T >
1949+ | FulfilledReactPromise < T >
1950+ | RejectedReactPromise < T > ;
1951+
1952+ export type Usable < T > = ReactPromise < T > | Context < T > ;
19291953
19301954 export function use < T > ( usable : Usable < T > ) : T ;
19311955
You can’t perform that action at this time.
0 commit comments