@types/react 17.0.42 → 17.0.45
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 → react v17.0}/LICENSE +0 -0
- react/README.md → react v17.0/README.md +2 -2
- react/global.d.ts → react v17.0/global.d.ts +4 -0
- react/index.d.ts → react v17.0/index.d.ts +14 -20
- {react → react v17.0}/jsx-dev-runtime.d.ts +0 -0
- {react → react v17.0}/jsx-runtime.d.ts +0 -0
- react/package.json → react v17.0/package.json +2 -2
- react/experimental.d.ts +0 -96
- react/next.d.ts +0 -148
{react → react v17.0}/LICENSE
RENAMED
File without changes
|
@@ -5,10 +5,10 @@
|
|
5
5
|
This package contains type definitions for React (http://facebook.github.io/react/).
|
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/v17.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Fri, 06 May 2022 20:01:40 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
|
|
@@ -40,6 +40,7 @@ interface HTMLButtonElement extends HTMLElement { }
|
|
40
40
|
interface HTMLCanvasElement extends HTMLElement { }
|
41
41
|
interface HTMLDataElement extends HTMLElement { }
|
42
42
|
interface HTMLDataListElement extends HTMLElement { }
|
43
|
+
interface HTMLDetailsElement extends HTMLElement { }
|
43
44
|
interface HTMLDialogElement extends HTMLElement { }
|
44
45
|
interface HTMLDivElement extends HTMLElement { }
|
45
46
|
interface HTMLDListElement extends HTMLElement { }
|
@@ -60,10 +61,12 @@ interface HTMLLIElement extends HTMLElement { }
|
|
60
61
|
interface HTMLLinkElement extends HTMLElement { }
|
61
62
|
interface HTMLMapElement extends HTMLElement { }
|
62
63
|
interface HTMLMetaElement extends HTMLElement { }
|
64
|
+
interface HTMLMeterElement extends HTMLElement { }
|
63
65
|
interface HTMLObjectElement extends HTMLElement { }
|
64
66
|
interface HTMLOListElement extends HTMLElement { }
|
65
67
|
interface HTMLOptGroupElement extends HTMLElement { }
|
66
68
|
interface HTMLOptionElement extends HTMLElement { }
|
69
|
+
interface HTMLOutputElement extends HTMLElement { }
|
67
70
|
interface HTMLParagraphElement extends HTMLElement { }
|
68
71
|
interface HTMLParamElement extends HTMLElement { }
|
69
72
|
interface HTMLPreElement extends HTMLElement { }
|
@@ -83,6 +86,7 @@ interface HTMLTableRowElement extends HTMLElement { }
|
|
83
86
|
interface HTMLTableSectionElement extends HTMLElement { }
|
84
87
|
interface HTMLTemplateElement extends HTMLElement { }
|
85
88
|
interface HTMLTextAreaElement extends HTMLElement { }
|
89
|
+
interface HTMLTimeElement extends HTMLElement { }
|
86
90
|
interface HTMLTitleElement extends HTMLElement { }
|
87
91
|
interface HTMLTrackElement extends HTMLElement { }
|
88
92
|
interface HTMLUListElement extends HTMLElement { }
|
@@ -29,14 +29,6 @@
|
|
29
29
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
30
30
|
// TypeScript Version: 2.8
|
31
31
|
|
32
|
-
// NOTE: Users of the upcoming React 18 release should add a reference
|
33
|
-
// to 'react/next' in their project. See next.d.ts's top comment
|
34
|
-
// for reference and documentation on how exactly to do it.
|
35
|
-
|
36
|
-
// NOTE: Users of the `experimental` builds of React should add a reference
|
37
|
-
// to 'react/experimental' in their project. See experimental.d.ts's top comment
|
38
|
-
// for reference and documentation on how exactly to do it.
|
39
|
-
|
40
32
|
/// <reference path="global.d.ts" />
|
41
33
|
|
42
34
|
import * as CSS from 'csstype';
|
@@ -2090,6 +2082,8 @@ declare namespace React {
|
|
2090
2082
|
}
|
2091
2083
|
|
2092
2084
|
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
2085
|
+
onCancel?: ReactEventHandler<T> | undefined;
|
2086
|
+
onClose?: ReactEventHandler<T> | undefined;
|
2093
2087
|
open?: boolean | undefined;
|
2094
2088
|
}
|
2095
2089
|
|
@@ -2780,7 +2774,7 @@ declare namespace React {
|
|
2780
2774
|
bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2781
2775
|
bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2782
2776
|
big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2783
|
-
blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<
|
2777
|
+
blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
|
2784
2778
|
body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
|
2785
2779
|
br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
2786
2780
|
button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
@@ -2793,8 +2787,8 @@ declare namespace React {
|
|
2793
2787
|
data: DetailedHTMLFactory<DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
|
2794
2788
|
datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
|
2795
2789
|
dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2796
|
-
del: DetailedHTMLFactory<DelHTMLAttributes<
|
2797
|
-
details: DetailedHTMLFactory<DetailsHTMLAttributes<
|
2790
|
+
del: DetailedHTMLFactory<DelHTMLAttributes<HTMLModElement>, HTMLModElement>;
|
2791
|
+
details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>;
|
2798
2792
|
dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2799
2793
|
dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
|
2800
2794
|
div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
@@ -2835,14 +2829,14 @@ declare namespace React {
|
|
2835
2829
|
menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
|
2836
2830
|
menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2837
2831
|
meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
|
2838
|
-
meter: DetailedHTMLFactory<MeterHTMLAttributes<
|
2832
|
+
meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>;
|
2839
2833
|
nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2840
2834
|
noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
2841
2835
|
object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
|
2842
2836
|
ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
|
2843
2837
|
optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
|
2844
2838
|
option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
|
2845
|
-
output: DetailedHTMLFactory<OutputHTMLAttributes<
|
2839
|
+
output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>;
|
2846
2840
|
p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
|
2847
2841
|
param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
|
2848
2842
|
picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
|
@@ -2874,7 +2868,7 @@ declare namespace React {
|
|
2874
2868
|
tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
|
2875
2869
|
th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
|
2876
2870
|
thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
|
2877
|
-
time: DetailedHTMLFactory<TimeHTMLAttributes<
|
2871
|
+
time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>;
|
2878
2872
|
title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
|
2879
2873
|
tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
|
2880
2874
|
track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
|
@@ -3111,7 +3105,7 @@ declare global {
|
|
3111
3105
|
bdi: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3112
3106
|
bdo: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3113
3107
|
big: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3114
|
-
blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<
|
3108
|
+
blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
|
3115
3109
|
body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
|
3116
3110
|
br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
3117
3111
|
button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
@@ -3124,8 +3118,8 @@ declare global {
|
|
3124
3118
|
data: React.DetailedHTMLProps<React.DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
|
3125
3119
|
datalist: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
|
3126
3120
|
dd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3127
|
-
del: React.DetailedHTMLProps<React.DelHTMLAttributes<
|
3128
|
-
details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<
|
3121
|
+
del: React.DetailedHTMLProps<React.DelHTMLAttributes<HTMLModElement>, HTMLModElement>;
|
3122
|
+
details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>;
|
3129
3123
|
dfn: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3130
3124
|
dialog: React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
|
3131
3125
|
div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
@@ -3166,7 +3160,7 @@ declare global {
|
|
3166
3160
|
menu: React.DetailedHTMLProps<React.MenuHTMLAttributes<HTMLElement>, HTMLElement>;
|
3167
3161
|
menuitem: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3168
3162
|
meta: React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
|
3169
|
-
meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<
|
3163
|
+
meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>;
|
3170
3164
|
nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3171
3165
|
noindex: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
3172
3166
|
noscript: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
@@ -3174,7 +3168,7 @@ declare global {
|
|
3174
3168
|
ol: React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
|
3175
3169
|
optgroup: React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
|
3176
3170
|
option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
|
3177
|
-
output: React.DetailedHTMLProps<React.OutputHTMLAttributes<
|
3171
|
+
output: React.DetailedHTMLProps<React.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>;
|
3178
3172
|
p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
|
3179
3173
|
param: React.DetailedHTMLProps<React.ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
|
3180
3174
|
picture: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
@@ -3206,7 +3200,7 @@ declare global {
|
|
3206
3200
|
tfoot: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
|
3207
3201
|
th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
|
3208
3202
|
thead: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
|
3209
|
-
time: React.DetailedHTMLProps<React.TimeHTMLAttributes<
|
3203
|
+
time: React.DetailedHTMLProps<React.TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>;
|
3210
3204
|
title: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
|
3211
3205
|
tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
|
3212
3206
|
track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.45",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,6 +146,6 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "145bbb964a75a52809261a29b2efa83ebe6a401e1e9b6250a4643d48a63fbfde",
|
150
150
|
"typeScriptVersion": "3.9"
|
151
151
|
}
|
react/experimental.d.ts
DELETED
@@ -1,96 +0,0 @@
|
|
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('./next');
|
38
|
-
|
39
|
-
export {};
|
40
|
-
|
41
|
-
declare module '.' {
|
42
|
-
export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
|
43
|
-
export type SuspenseListTailMode = 'collapsed' | 'hidden';
|
44
|
-
|
45
|
-
export interface SuspenseListCommonProps {
|
46
|
-
/**
|
47
|
-
* Note that SuspenseList require more than one child;
|
48
|
-
* it is a runtime warning to provide only a single child.
|
49
|
-
*
|
50
|
-
* It does, however, allow those children to be wrapped inside a single
|
51
|
-
* level of `<React.Fragment>`.
|
52
|
-
*/
|
53
|
-
children: ReactElement | Iterable<ReactElement>;
|
54
|
-
}
|
55
|
-
|
56
|
-
interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
|
57
|
-
/**
|
58
|
-
* Defines the order in which the `SuspenseList` children should be revealed.
|
59
|
-
*/
|
60
|
-
revealOrder: 'forwards' | 'backwards';
|
61
|
-
/**
|
62
|
-
* Dictates how unloaded items in a SuspenseList is shown.
|
63
|
-
*
|
64
|
-
* - By default, `SuspenseList` will show all fallbacks in the list.
|
65
|
-
* - `collapsed` shows only the next fallback in the list.
|
66
|
-
* - `hidden` doesn’t show any unloaded items.
|
67
|
-
*/
|
68
|
-
tail?: SuspenseListTailMode | undefined;
|
69
|
-
}
|
70
|
-
|
71
|
-
interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
|
72
|
-
/**
|
73
|
-
* Defines the order in which the `SuspenseList` children should be revealed.
|
74
|
-
*/
|
75
|
-
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']> | undefined;
|
76
|
-
/**
|
77
|
-
* The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
|
78
|
-
*/
|
79
|
-
tail?: never | undefined;
|
80
|
-
}
|
81
|
-
|
82
|
-
export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
|
83
|
-
|
84
|
-
/**
|
85
|
-
* `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
|
86
|
-
* in which these components are revealed to the user.
|
87
|
-
*
|
88
|
-
* When multiple components need to fetch data, this data may arrive in an unpredictable order.
|
89
|
-
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
|
90
|
-
* until previous items have been displayed (this behavior is adjustable).
|
91
|
-
*
|
92
|
-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
|
93
|
-
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
|
94
|
-
*/
|
95
|
-
export const SuspenseList: ExoticComponent<SuspenseListProps>;
|
96
|
-
}
|
react/next.d.ts
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* These are types for things that are present in the upcoming React 18 release.
|
3
|
-
*
|
4
|
-
* Once React 18 is released they can just be moved to the main index file.
|
5
|
-
*
|
6
|
-
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
7
|
-
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
8
|
-
* is to add `"react/next"` to the `"types"` array.
|
9
|
-
*
|
10
|
-
* Alternatively, a specific import syntax can to be used from a typescript file.
|
11
|
-
* This module does not exist in reality, which is why the {} is important:
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* import {} from 'react/next'
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* It is also possible to include it through a triple-slash reference:
|
18
|
-
*
|
19
|
-
* ```ts
|
20
|
-
* /// <reference types="react/next" />
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* Either the import or the reference only needs to appear once, anywhere in the project.
|
24
|
-
*/
|
25
|
-
|
26
|
-
// See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
|
27
|
-
|
28
|
-
import React = require('.');
|
29
|
-
|
30
|
-
export {};
|
31
|
-
|
32
|
-
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
33
|
-
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
34
|
-
|
35
|
-
declare module '.' {
|
36
|
-
export interface SuspenseProps {
|
37
|
-
/**
|
38
|
-
* The presence of this prop indicates that the content is computationally expensive to render.
|
39
|
-
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
|
40
|
-
* @see {@link https://github.com/facebook/react/pull/19936}
|
41
|
-
*/
|
42
|
-
unstable_expectedLoadTime?: number | undefined;
|
43
|
-
}
|
44
|
-
|
45
|
-
// must be synchronous
|
46
|
-
export type TransitionFunction = () => VoidOrUndefinedOnly;
|
47
|
-
// strange definition to allow vscode to show documentation on the invocation
|
48
|
-
export interface TransitionStartFunction {
|
49
|
-
/**
|
50
|
-
* State updates caused inside the callback are allowed to be deferred.
|
51
|
-
*
|
52
|
-
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
|
53
|
-
*
|
54
|
-
* @param callback A _synchronous_ function which causes state updates that can be deferred.
|
55
|
-
*/
|
56
|
-
(callback: TransitionFunction): void;
|
57
|
-
}
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Returns a deferred version of the value that may “lag behind” it for at most `timeoutMs`.
|
61
|
-
*
|
62
|
-
* This is commonly used to keep the interface responsive when you have something that renders immediately
|
63
|
-
* based on user input and something that needs to wait for a data fetch.
|
64
|
-
*
|
65
|
-
* A good example of this is a text input.
|
66
|
-
*
|
67
|
-
* @param value The value that is going to be deferred
|
68
|
-
*
|
69
|
-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#usedeferredvalue
|
70
|
-
*/
|
71
|
-
export function useDeferredValue<T>(value: T): T;
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Allows components to avoid undesirable loading states by waiting for content to load
|
75
|
-
* before transitioning to the next screen. It also allows components to defer slower,
|
76
|
-
* data fetching updates until subsequent renders so that more crucial updates can be
|
77
|
-
* rendered immediately.
|
78
|
-
*
|
79
|
-
* The `useTransition` hook returns two values in an array.
|
80
|
-
*
|
81
|
-
* The first is a boolean, React’s way of informing us whether we’re waiting for the transition to finish.
|
82
|
-
* The second is a function that takes a callback. We can use it to tell React which state we want to defer.
|
83
|
-
*
|
84
|
-
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
|
85
|
-
*
|
86
|
-
* @param config An optional object with `timeoutMs`
|
87
|
-
*
|
88
|
-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition
|
89
|
-
*/
|
90
|
-
export function useTransition(): [boolean, TransitionStartFunction];
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Similar to `useTransition` but allows uses where hooks are not available.
|
94
|
-
*
|
95
|
-
* @param callback A _synchronous_ function which causes state updates that can be deferred.
|
96
|
-
*/
|
97
|
-
export function startTransition(scope: TransitionFunction): void;
|
98
|
-
|
99
|
-
export function useId(): string;
|
100
|
-
|
101
|
-
/**
|
102
|
-
* this should be an internal type
|
103
|
-
*/
|
104
|
-
interface MutableSource<T> {
|
105
|
-
_source: T;
|
106
|
-
}
|
107
|
-
|
108
|
-
export type MutableSourceSubscribe<T> = (source: T, callback: () => void) => () => void;
|
109
|
-
|
110
|
-
/**
|
111
|
-
* @param source A source could be anything as long as they can be subscribed to and have a "version".
|
112
|
-
* @param getVersion A function returns a value which will change whenever part of the source changes.
|
113
|
-
*/
|
114
|
-
export function unstable_createMutableSource<T>(source: T, getVersion: () => any): MutableSource<T>;
|
115
|
-
|
116
|
-
/**
|
117
|
-
* useMutableSource() enables React components to safely and efficiently read from a mutable external source in Concurrent Mode.
|
118
|
-
* The API will detect mutations that occur during a render to avoid tearing
|
119
|
-
* and it will automatically schedule updates when the source is mutated.
|
120
|
-
* @param MutableSource
|
121
|
-
* @param getSnapshot
|
122
|
-
* @param subscribe
|
123
|
-
*
|
124
|
-
* @see https://github.com/reactjs/rfcs/blob/master/text/0147-use-mutable-source.md
|
125
|
-
*/
|
126
|
-
export function unstable_useMutableSource<T, TResult extends unknown>(MutableSource: MutableSource<T>, getSnapshot: (source: T) => TResult, subscribe: MutableSourceSubscribe<T>): TResult;
|
127
|
-
|
128
|
-
/**
|
129
|
-
* @param effect Imperative function that can return a cleanup function
|
130
|
-
* @param deps If present, effect will only activate if the values in the list change.
|
131
|
-
*
|
132
|
-
* @see https://github.com/facebook/react/pull/21913
|
133
|
-
*/
|
134
|
-
export function useInsertionEffect(effect: EffectCallback, deps?: DependencyList): void;
|
135
|
-
|
136
|
-
/**
|
137
|
-
* @param subscribe
|
138
|
-
* @param getSnapshot
|
139
|
-
*
|
140
|
-
* @see https://github.com/reactwg/react-18/discussions/86
|
141
|
-
*/
|
142
|
-
// keep in sync with `useSyncExternalStore` from `use-sync-external-store`
|
143
|
-
export function useSyncExternalStore<Snapshot>(
|
144
|
-
subscribe: (onStoreChange: () => void) => () => void,
|
145
|
-
getSnapshot: () => Snapshot,
|
146
|
-
getServerSnapshot?: () => Snapshot,
|
147
|
-
): Snapshot;
|
148
|
-
}
|