@types/react 18.3.14 → 19.0.1
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 v18.3/README.md → react/README.md +3 -3
- react/canary.d.ts +35 -0
- react/compiler-runtime.d.ts +4 -0
- react/experimental.d.ts +125 -0
- react/index.d.ts +4207 -0
- react v18.3/package.json → react/package.json +23 -3
- react/ts5.0/canary.d.ts +35 -0
- react/ts5.0/experimental.d.ts +125 -0
- react/ts5.0/index.d.ts +4194 -0
- react/ts5.0/v18/global.d.ts +160 -0
- react/ts5.0/v18/jsx-dev-runtime.d.ts +45 -0
- react/ts5.0/v18/jsx-runtime.d.ts +36 -0
- react/ts5.0/v18/ts5.0/global.d.ts +160 -0
- react/ts5.0/v18/ts5.0/jsx-dev-runtime.d.ts +44 -0
- react/ts5.0/v18/ts5.0/jsx-runtime.d.ts +35 -0
- {react v18.3 → react}/LICENSE +0 -0
- {react v18.3 → react}/global.d.ts +0 -0
- {react v18.3 → react}/jsx-dev-runtime.d.ts +0 -0
- {react v18.3 → react}/jsx-runtime.d.ts +0 -0
- {react v18.3 → react}/ts5.0/global.d.ts +0 -0
- {react v18.3 → react}/ts5.0/jsx-dev-runtime.d.ts +0 -0
- {react v18.3 → react}/ts5.0/jsx-runtime.d.ts +0 -0
- {react v18.3 → react/ts5.0/v18}/index.d.ts +0 -0
- {react v18.3 → react/ts5.0/v18}/ts5.0/index.d.ts +0 -0
@@ -5,11 +5,11 @@
|
|
5
5
|
This package contains type definitions for react (https://react.dev/).
|
6
6
|
|
7
7
|
# Details
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
12
|
-
* Dependencies: [
|
11
|
+
* Last updated: Fri, 06 Dec 2024 15:35:00 GMT
|
12
|
+
* Dependencies: [csstype](https://npmjs.com/package/csstype)
|
13
13
|
|
14
14
|
# Credits
|
15
15
|
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [John Reilly](https://github.com/johnnyreilly), [Benoit Benezech](https://github.com/bbenezech), [Patricio Zavolinsky](https://github.com/pzavolinsky), [Eric Anderson](https://github.com/ericanderson), [Dovydas Navickas](https://github.com/DovydasNavickas), [Josh Rutherford](https://github.com/theruther4d), [Guilherme Hübner](https://github.com/guilhermehubner), [Ferdy Budhidharma](https://github.com/ferdaber), [Johann Rakotoharisoa](https://github.com/jrakotoharisoa), [Olivier Pascal](https://github.com/pascaloliv), [Martin Hochel](https://github.com/hotell), [Frank Li](https://github.com/franklixuefei), [Jessica Franco](https://github.com/Jessidhia), [Saransh Kataria](https://github.com/saranshkataria), [Kanitkorn Sujautra](https://github.com/lukyth), [Sebastian Silbermann](https://github.com/eps1lon), [Kyle Scully](https://github.com/zieka), [Cong Zhang](https://github.com/dancerphil), [Dimitri Mitropoulos](https://github.com/dimitropoulos), [JongChan Choi](https://github.com/disjukr), [Victor Magalhães](https://github.com/vhfmag), [Priyanshu Rav](https://github.com/priyanshurav), [Dmitry Semigradsky](https://github.com/Semigradsky), and [Matt Pocock](https://github.com/mattpocock).
|
react/canary.d.ts
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* These are types for things that are present in the React `canary` release channel.
|
3
|
+
*
|
4
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
5
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
6
|
+
* is to add `"react/canary"` to the `"types"` array.
|
7
|
+
*
|
8
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
9
|
+
* This module does not exist in reality, which is why the {} is important:
|
10
|
+
*
|
11
|
+
* ```ts
|
12
|
+
* import {} from 'react/canary'
|
13
|
+
* ```
|
14
|
+
*
|
15
|
+
* It is also possible to include it through a triple-slash reference:
|
16
|
+
*
|
17
|
+
* ```ts
|
18
|
+
* /// <reference types="react/canary" />
|
19
|
+
* ```
|
20
|
+
*
|
21
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
22
|
+
*/
|
23
|
+
|
24
|
+
// See https://github.com/facebook/react/blob/main/packages/react/src/React.js to see how the exports are declared,
|
25
|
+
|
26
|
+
import React = require(".");
|
27
|
+
|
28
|
+
export {};
|
29
|
+
|
30
|
+
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
31
|
+
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
32
|
+
|
33
|
+
declare module "." {
|
34
|
+
export function unstable_useCacheRefresh(): () => void;
|
35
|
+
}
|
react/experimental.d.ts
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
/**
|
2
|
+
* These are types for things that are present in the `experimental` builds of React but not yet
|
3
|
+
* on a stable build.
|
4
|
+
*
|
5
|
+
* Once they are promoted to stable they can just be moved to the main index file.
|
6
|
+
*
|
7
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
8
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
9
|
+
* is to add `"react/experimental"` to the `"types"` array.
|
10
|
+
*
|
11
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
12
|
+
* This module does not exist in reality, which is why the {} is important:
|
13
|
+
*
|
14
|
+
* ```ts
|
15
|
+
* import {} from 'react/experimental'
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* It is also possible to include it through a triple-slash reference:
|
19
|
+
*
|
20
|
+
* ```ts
|
21
|
+
* /// <reference types="react/experimental" />
|
22
|
+
* ```
|
23
|
+
*
|
24
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
25
|
+
*/
|
26
|
+
|
27
|
+
// See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
|
28
|
+
// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
|
29
|
+
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
|
30
|
+
//
|
31
|
+
// For the inputs of types exported as simply a fiber tag, the `beginWork` function of ReactFiberBeginWork.js
|
32
|
+
// is a good place to start looking for details; it generally calls prop validation functions or delegates
|
33
|
+
// all tasks done as part of the render phase (the concurrent part of the React update cycle).
|
34
|
+
//
|
35
|
+
// Suspense-related handling can be found in ReactFiberThrow.js.
|
36
|
+
|
37
|
+
import React = require("./canary");
|
38
|
+
|
39
|
+
export {};
|
40
|
+
|
41
|
+
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
42
|
+
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
43
|
+
|
44
|
+
declare module "." {
|
45
|
+
export interface SuspenseProps {
|
46
|
+
/**
|
47
|
+
* The presence of this prop indicates that the content is computationally expensive to render.
|
48
|
+
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
|
49
|
+
* @see {@link https://github.com/facebook/react/pull/19936}
|
50
|
+
*/
|
51
|
+
unstable_expectedLoadTime?: number | undefined;
|
52
|
+
}
|
53
|
+
|
54
|
+
export type SuspenseListRevealOrder = "forwards" | "backwards" | "together";
|
55
|
+
export type SuspenseListTailMode = "collapsed" | "hidden";
|
56
|
+
|
57
|
+
export interface SuspenseListCommonProps {
|
58
|
+
/**
|
59
|
+
* Note that SuspenseList require more than one child;
|
60
|
+
* it is a runtime warning to provide only a single child.
|
61
|
+
*
|
62
|
+
* It does, however, allow those children to be wrapped inside a single
|
63
|
+
* level of `<React.Fragment>`.
|
64
|
+
*/
|
65
|
+
children: ReactElement | Iterable<ReactElement>;
|
66
|
+
}
|
67
|
+
|
68
|
+
interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
|
69
|
+
/**
|
70
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
71
|
+
*/
|
72
|
+
revealOrder: "forwards" | "backwards";
|
73
|
+
/**
|
74
|
+
* Dictates how unloaded items in a SuspenseList is shown.
|
75
|
+
*
|
76
|
+
* - By default, `SuspenseList` will show all fallbacks in the list.
|
77
|
+
* - `collapsed` shows only the next fallback in the list.
|
78
|
+
* - `hidden` doesn’t show any unloaded items.
|
79
|
+
*/
|
80
|
+
tail?: SuspenseListTailMode | undefined;
|
81
|
+
}
|
82
|
+
|
83
|
+
interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
|
84
|
+
/**
|
85
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
86
|
+
*/
|
87
|
+
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]> | undefined;
|
88
|
+
/**
|
89
|
+
* The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
|
90
|
+
*/
|
91
|
+
tail?: never | undefined;
|
92
|
+
}
|
93
|
+
|
94
|
+
export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
|
95
|
+
|
96
|
+
/**
|
97
|
+
* `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
|
98
|
+
* in which these components are revealed to the user.
|
99
|
+
*
|
100
|
+
* When multiple components need to fetch data, this data may arrive in an unpredictable order.
|
101
|
+
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
|
102
|
+
* until previous items have been displayed (this behavior is adjustable).
|
103
|
+
*
|
104
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
|
105
|
+
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
|
106
|
+
*/
|
107
|
+
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
|
108
|
+
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
110
|
+
export function experimental_useEffectEvent<T extends Function>(event: T): T;
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Warning: Only available in development builds.
|
114
|
+
*/
|
115
|
+
function captureOwnerStack(): string | null;
|
116
|
+
|
117
|
+
type Reference = object;
|
118
|
+
type TaintableUniqueValue = string | bigint | ArrayBufferView;
|
119
|
+
function experimental_taintUniqueValue(
|
120
|
+
message: string | undefined,
|
121
|
+
lifetime: Reference,
|
122
|
+
value: TaintableUniqueValue,
|
123
|
+
): void;
|
124
|
+
function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
|
125
|
+
}
|