@cfp-studio/plugin-react 17.1.0 → 17.2.0
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.
- package/README.md +42 -0
- package/dist/index.d.mts +5760 -4
- package/dist/index.mjs +1 -141
- package/package.json +41 -18
- package/preview/index.tsx +0 -1
- package/preview/root.ts +0 -1
- package/preview/tsconfig.json +9 -9
- package/types/csstype/LICENSE +19 -0
- package/types/csstype/README.md +277 -0
- package/types/csstype/index.d.ts +21297 -0
- package/types/csstype/index.js.flow +6612 -0
- package/types/csstype/package.json +66 -0
- package/types/prop-types/LICENSE +21 -0
- package/types/prop-types/README.md +15 -0
- package/types/prop-types/index.d.ts +131 -0
- package/types/prop-types/package.json +36 -0
- package/types/react/LICENSE +21 -0
- package/types/react/README.md +15 -0
- package/types/react/canary.d.ts +166 -0
- package/types/react/experimental.d.ts +132 -0
- package/types/react/global.d.ts +160 -0
- package/types/react/index.d.ts +4553 -0
- package/types/react/jsx-dev-runtime.d.ts +45 -0
- package/types/react/jsx-runtime.d.ts +36 -0
- package/types/react/package.json +206 -0
- package/types/react/ts5.0/canary.d.ts +166 -0
- package/types/react/ts5.0/experimental.d.ts +132 -0
- package/types/react/ts5.0/global.d.ts +160 -0
- package/types/react/ts5.0/index.d.ts +4540 -0
- package/types/react/ts5.0/jsx-dev-runtime.d.ts +44 -0
- package/types/react/ts5.0/jsx-runtime.d.ts +35 -0
- package/types/react-dom/LICENSE +21 -0
- package/types/react-dom/README.md +16 -0
- package/types/react-dom/canary.d.ts +184 -0
- package/types/react-dom/client.d.ts +72 -0
- package/types/react-dom/experimental.d.ts +36 -0
- package/types/react-dom/index.d.ts +150 -0
- package/types/react-dom/package.json +88 -0
- package/types/react-dom/server.d.ts +126 -0
- package/types/react-dom/test-utils/index.d.ts +402 -0
- package/dist/index.d.ts +0 -12
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "./";
|
|
2
|
+
export { Fragment } from "./";
|
|
3
|
+
|
|
4
|
+
export namespace JSX {
|
|
5
|
+
interface Element extends React.JSX.Element {}
|
|
6
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
|
7
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
|
8
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
|
9
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
|
10
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
|
11
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
|
12
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface JSXSource {
|
|
16
|
+
/**
|
|
17
|
+
* The source file where the element originates from.
|
|
18
|
+
*/
|
|
19
|
+
fileName?: string | undefined;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The line number where the element was created.
|
|
23
|
+
*/
|
|
24
|
+
lineNumber?: number | undefined;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The column number where the element was created.
|
|
28
|
+
*/
|
|
29
|
+
columnNumber?: number | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create a React element.
|
|
34
|
+
*
|
|
35
|
+
* You should not use this function directly. Use JSX and a transpiler instead.
|
|
36
|
+
*/
|
|
37
|
+
export function jsxDEV(
|
|
38
|
+
type: React.ElementType,
|
|
39
|
+
props: unknown,
|
|
40
|
+
key: React.Key | undefined,
|
|
41
|
+
isStatic: boolean,
|
|
42
|
+
source?: JSXSource,
|
|
43
|
+
self?: unknown,
|
|
44
|
+
): React.ReactElement;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "./";
|
|
2
|
+
export { Fragment } from "./";
|
|
3
|
+
|
|
4
|
+
export namespace JSX {
|
|
5
|
+
interface Element extends React.JSX.Element {}
|
|
6
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
|
7
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
|
8
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
|
9
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
|
10
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
|
11
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
|
12
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create a React element.
|
|
17
|
+
*
|
|
18
|
+
* You should not use this function directly. Use JSX and a transpiler instead.
|
|
19
|
+
*/
|
|
20
|
+
export function jsx(
|
|
21
|
+
type: React.ElementType,
|
|
22
|
+
props: unknown,
|
|
23
|
+
key?: React.Key,
|
|
24
|
+
): React.ReactElement;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Create a React element.
|
|
28
|
+
*
|
|
29
|
+
* You should not use this function directly. Use JSX and a transpiler instead.
|
|
30
|
+
*/
|
|
31
|
+
export function jsxs(
|
|
32
|
+
type: React.ElementType,
|
|
33
|
+
props: unknown,
|
|
34
|
+
key?: React.Key,
|
|
35
|
+
): React.ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/react-dom`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for react-dom (https://reactjs.org).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom/v18.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Wed, 11 Dec 2024 02:54:10 GMT
|
|
12
|
+
* Dependencies: none
|
|
13
|
+
* Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
|
14
|
+
|
|
15
|
+
# Credits
|
|
16
|
+
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon).
|
|
@@ -0,0 +1,184 @@
|
|
|
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-dom/canary"` 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-dom/canary'
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* It is also possible to include it through a triple-slash reference:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* /// <reference types="react-dom/canary" />
|
|
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/main/packages/react-dom/index.js to see how the exports are declared,
|
|
27
|
+
// but confirm with published source code (e.g. https://unpkg.com/react-dom@canary) that these exports end up in the published code
|
|
28
|
+
|
|
29
|
+
import React = require("react");
|
|
30
|
+
import ReactDOM = require(".");
|
|
31
|
+
|
|
32
|
+
export {};
|
|
33
|
+
|
|
34
|
+
declare const REACT_FORM_STATE_SIGIL: unique symbol;
|
|
35
|
+
|
|
36
|
+
declare module "." {
|
|
37
|
+
function prefetchDNS(href: string): void;
|
|
38
|
+
|
|
39
|
+
interface PreconnectOptions {
|
|
40
|
+
// Don't create a helper type.
|
|
41
|
+
// It would have to be in module scope to be inlined in TS tooltips.
|
|
42
|
+
// But then it becomes part of the public API.
|
|
43
|
+
// TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
|
|
44
|
+
// since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
|
|
45
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
46
|
+
}
|
|
47
|
+
function preconnect(href: string, options?: PreconnectOptions): void;
|
|
48
|
+
|
|
49
|
+
type PreloadAs =
|
|
50
|
+
| "audio"
|
|
51
|
+
| "document"
|
|
52
|
+
| "embed"
|
|
53
|
+
| "fetch"
|
|
54
|
+
| "font"
|
|
55
|
+
| "image"
|
|
56
|
+
| "object"
|
|
57
|
+
| "track"
|
|
58
|
+
| "script"
|
|
59
|
+
| "style"
|
|
60
|
+
| "video"
|
|
61
|
+
| "worker";
|
|
62
|
+
interface PreloadOptions {
|
|
63
|
+
as: PreloadAs;
|
|
64
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
65
|
+
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
66
|
+
// TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
|
|
67
|
+
imageSizes?: string | undefined;
|
|
68
|
+
imageSrcSet?: string | undefined;
|
|
69
|
+
integrity?: string | undefined;
|
|
70
|
+
type?: string | undefined;
|
|
71
|
+
nonce?: string | undefined;
|
|
72
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
73
|
+
}
|
|
74
|
+
function preload(href: string, options?: PreloadOptions): void;
|
|
75
|
+
|
|
76
|
+
// https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
|
|
77
|
+
type PreloadModuleAs = RequestDestination;
|
|
78
|
+
interface PreloadModuleOptions {
|
|
79
|
+
/**
|
|
80
|
+
* @default "script"
|
|
81
|
+
*/
|
|
82
|
+
as: PreloadModuleAs;
|
|
83
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
84
|
+
integrity?: string | undefined;
|
|
85
|
+
nonce?: string | undefined;
|
|
86
|
+
}
|
|
87
|
+
function preloadModule(href: string, options?: PreloadModuleOptions): void;
|
|
88
|
+
|
|
89
|
+
type PreinitAs = "script" | "style";
|
|
90
|
+
interface PreinitOptions {
|
|
91
|
+
as: PreinitAs;
|
|
92
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
93
|
+
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
94
|
+
precedence?: string | undefined;
|
|
95
|
+
integrity?: string | undefined;
|
|
96
|
+
nonce?: string | undefined;
|
|
97
|
+
}
|
|
98
|
+
function preinit(href: string, options?: PreinitOptions): void;
|
|
99
|
+
|
|
100
|
+
// Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
|
|
101
|
+
type PreinitModuleAs = "script";
|
|
102
|
+
interface PreinitModuleOptions {
|
|
103
|
+
/**
|
|
104
|
+
* @default "script"
|
|
105
|
+
*/
|
|
106
|
+
as?: PreinitModuleAs;
|
|
107
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
108
|
+
integrity?: string | undefined;
|
|
109
|
+
nonce?: string | undefined;
|
|
110
|
+
}
|
|
111
|
+
function preinitModule(href: string, options?: PreinitModuleOptions): void;
|
|
112
|
+
|
|
113
|
+
interface FormStatusNotPending {
|
|
114
|
+
pending: false;
|
|
115
|
+
data: null;
|
|
116
|
+
method: null;
|
|
117
|
+
action: null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface FormStatusPending {
|
|
121
|
+
pending: true;
|
|
122
|
+
data: FormData;
|
|
123
|
+
method: string;
|
|
124
|
+
action: string | ((formData: FormData) => void | Promise<void>);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type FormStatus = FormStatusPending | FormStatusNotPending;
|
|
128
|
+
|
|
129
|
+
function useFormStatus(): FormStatus;
|
|
130
|
+
|
|
131
|
+
function useFormState<State>(
|
|
132
|
+
action: (state: Awaited<State>) => State | Promise<State>,
|
|
133
|
+
initialState: Awaited<State>,
|
|
134
|
+
permalink?: string,
|
|
135
|
+
): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
|
136
|
+
function useFormState<State, Payload>(
|
|
137
|
+
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
|
138
|
+
initialState: Awaited<State>,
|
|
139
|
+
permalink?: string,
|
|
140
|
+
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
141
|
+
|
|
142
|
+
function requestFormReset(form: HTMLFormElement): void;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare module "./client" {
|
|
146
|
+
interface ReactFormState {
|
|
147
|
+
[REACT_FORM_STATE_SIGIL]: never;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
interface RootOptions {
|
|
151
|
+
onUncaughtError?:
|
|
152
|
+
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
153
|
+
| undefined;
|
|
154
|
+
onCaughtError?:
|
|
155
|
+
| ((
|
|
156
|
+
error: unknown,
|
|
157
|
+
errorInfo: {
|
|
158
|
+
componentStack?: string | undefined;
|
|
159
|
+
errorBoundary?: React.Component<unknown> | undefined;
|
|
160
|
+
},
|
|
161
|
+
) => void)
|
|
162
|
+
| undefined;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface HydrationOptions {
|
|
166
|
+
formState?: ReactFormState | null;
|
|
167
|
+
onUncaughtError?:
|
|
168
|
+
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
169
|
+
| undefined;
|
|
170
|
+
onCaughtError?:
|
|
171
|
+
| ((
|
|
172
|
+
error: unknown,
|
|
173
|
+
errorInfo: {
|
|
174
|
+
componentStack?: string | undefined;
|
|
175
|
+
errorBoundary?: React.Component<unknown> | undefined;
|
|
176
|
+
},
|
|
177
|
+
) => void)
|
|
178
|
+
| undefined;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS {
|
|
182
|
+
document: Document;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: This entrypoint is only available starting with `react-dom@18.0.0-rc.1`
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
|
|
6
|
+
|
|
7
|
+
import React = require("react");
|
|
8
|
+
export interface HydrationOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Prefix for `useId`.
|
|
11
|
+
*/
|
|
12
|
+
identifierPrefix?: string;
|
|
13
|
+
onRecoverableError?: (error: unknown, errorInfo: ErrorInfo) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface RootOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Prefix for `useId`.
|
|
19
|
+
*/
|
|
20
|
+
identifierPrefix?: string;
|
|
21
|
+
onRecoverableError?: (error: unknown, errorInfo: ErrorInfo) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ErrorInfo {
|
|
25
|
+
digest?: string;
|
|
26
|
+
componentStack?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Root {
|
|
30
|
+
render(children: React.ReactNode): void;
|
|
31
|
+
unmount(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Different release channels declare additional types of ReactNode this particular release channel accepts.
|
|
36
|
+
* App or library types should never augment this interface.
|
|
37
|
+
*/
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
39
|
+
export interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS {}
|
|
40
|
+
|
|
41
|
+
export type Container =
|
|
42
|
+
| Element
|
|
43
|
+
| DocumentFragment
|
|
44
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS[
|
|
45
|
+
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* createRoot lets you create a root to display React components inside a browser DOM node.
|
|
50
|
+
*
|
|
51
|
+
* @see {@link https://react.dev/reference/react-dom/client/createRoot API Reference for `createRoot`}
|
|
52
|
+
*/
|
|
53
|
+
export function createRoot(container: Container, options?: RootOptions): Root;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Same as `createRoot()`, but is used to hydrate a container whose HTML contents were rendered by ReactDOMServer.
|
|
57
|
+
*
|
|
58
|
+
* React will attempt to attach event listeners to the existing markup.
|
|
59
|
+
*
|
|
60
|
+
* **Example Usage**
|
|
61
|
+
*
|
|
62
|
+
* ```jsx
|
|
63
|
+
* hydrateRoot(document.querySelector('#root'), <App />)
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @see https://reactjs.org/docs/react-dom-client.html#hydrateroot
|
|
67
|
+
*/
|
|
68
|
+
export function hydrateRoot(
|
|
69
|
+
container: Element | Document,
|
|
70
|
+
initialChildren: React.ReactNode,
|
|
71
|
+
options?: HydrationOptions,
|
|
72
|
+
): Root;
|
|
@@ -0,0 +1,36 @@
|
|
|
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-dom/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-dom/experimental'
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* It is also possible to include it through a triple-slash reference:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* /// <reference types="react-dom/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/main/packages/react-dom/index.experimental.js to see how the exports are declared,
|
|
28
|
+
// but confirm with published source code (e.g. https://unpkg.com/react-dom@experimental) that these exports end up in the published code
|
|
29
|
+
|
|
30
|
+
import React = require("react");
|
|
31
|
+
import ReactDOM = require("./canary");
|
|
32
|
+
|
|
33
|
+
export {};
|
|
34
|
+
|
|
35
|
+
declare module "." {
|
|
36
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// NOTE: Users of the `experimental` builds of React should add a reference
|
|
2
|
+
// to 'react-dom/experimental' in their project. See experimental.d.ts's top comment
|
|
3
|
+
// for reference and documentation on how exactly to do it.
|
|
4
|
+
|
|
5
|
+
export as namespace ReactDOM;
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
CElement,
|
|
9
|
+
Component,
|
|
10
|
+
ComponentState,
|
|
11
|
+
DOMAttributes,
|
|
12
|
+
DOMElement,
|
|
13
|
+
FunctionComponentElement,
|
|
14
|
+
Key,
|
|
15
|
+
ReactElement,
|
|
16
|
+
ReactInstance,
|
|
17
|
+
ReactNode,
|
|
18
|
+
ReactPortal,
|
|
19
|
+
} from "react";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated See https://react.dev/reference/react-dom/findDOMNode#alternatives
|
|
23
|
+
*/
|
|
24
|
+
export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
27
|
+
*/
|
|
28
|
+
export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
|
|
29
|
+
|
|
30
|
+
export function createPortal(
|
|
31
|
+
children: ReactNode,
|
|
32
|
+
container: Element | DocumentFragment,
|
|
33
|
+
key?: Key | null,
|
|
34
|
+
): ReactPortal;
|
|
35
|
+
|
|
36
|
+
export const version: string;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
39
|
+
*/
|
|
40
|
+
export const render: Renderer;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
43
|
+
*/
|
|
44
|
+
export const hydrate: Renderer;
|
|
45
|
+
|
|
46
|
+
export function flushSync<R>(fn: () => R): R;
|
|
47
|
+
|
|
48
|
+
export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
|
|
49
|
+
export function unstable_batchedUpdates<R>(callback: () => R): R;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated
|
|
53
|
+
*/
|
|
54
|
+
export function unstable_renderSubtreeIntoContainer<T extends Element>(
|
|
55
|
+
parentComponent: Component<any>,
|
|
56
|
+
element: DOMElement<DOMAttributes<T>, T>,
|
|
57
|
+
container: Element,
|
|
58
|
+
callback?: (element: T) => any,
|
|
59
|
+
): T;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
*/
|
|
63
|
+
export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
|
64
|
+
parentComponent: Component<any>,
|
|
65
|
+
element: CElement<P, T>,
|
|
66
|
+
container: Element,
|
|
67
|
+
callback?: (component: T) => any,
|
|
68
|
+
): T;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated
|
|
71
|
+
*/
|
|
72
|
+
export function unstable_renderSubtreeIntoContainer<P>(
|
|
73
|
+
parentComponent: Component<any>,
|
|
74
|
+
element: ReactElement<P>,
|
|
75
|
+
container: Element,
|
|
76
|
+
callback?: (component?: Component<P, ComponentState> | Element) => any,
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
78
|
+
): Component<P, ComponentState> | Element | void;
|
|
79
|
+
|
|
80
|
+
export type Container = Element | Document | DocumentFragment;
|
|
81
|
+
|
|
82
|
+
export interface Renderer {
|
|
83
|
+
// Deprecated(render): The return value is deprecated.
|
|
84
|
+
// In future releases the render function's return type will be void.
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
88
|
+
*/
|
|
89
|
+
<T extends Element>(
|
|
90
|
+
element: DOMElement<DOMAttributes<T>, T>,
|
|
91
|
+
container: Container | null,
|
|
92
|
+
callback?: () => void,
|
|
93
|
+
): T;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
97
|
+
*/
|
|
98
|
+
(
|
|
99
|
+
element: Array<DOMElement<DOMAttributes<any>, any>>,
|
|
100
|
+
container: Container | null,
|
|
101
|
+
callback?: () => void,
|
|
102
|
+
): Element;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
106
|
+
*/
|
|
107
|
+
(
|
|
108
|
+
element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
|
109
|
+
container: Container | null,
|
|
110
|
+
callback?: () => void,
|
|
111
|
+
): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
115
|
+
*/
|
|
116
|
+
<P, T extends Component<P, ComponentState>>(
|
|
117
|
+
element: CElement<P, T>,
|
|
118
|
+
container: Container | null,
|
|
119
|
+
callback?: () => void,
|
|
120
|
+
): T;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
124
|
+
*/
|
|
125
|
+
(
|
|
126
|
+
element: Array<CElement<any, Component<any, ComponentState>>>,
|
|
127
|
+
container: Container | null,
|
|
128
|
+
callback?: () => void,
|
|
129
|
+
): Component<any, ComponentState>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
133
|
+
*/
|
|
134
|
+
<P>(
|
|
135
|
+
element: ReactElement<P>,
|
|
136
|
+
container: Container | null,
|
|
137
|
+
callback?: () => void,
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
139
|
+
): Component<P, ComponentState> | Element | void;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
143
|
+
*/
|
|
144
|
+
(
|
|
145
|
+
element: ReactElement[],
|
|
146
|
+
container: Container | null,
|
|
147
|
+
callback?: () => void,
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
149
|
+
): Component<any, ComponentState> | Element | void;
|
|
150
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@types/react-dom",
|
|
3
|
+
"version": "18.3.5",
|
|
4
|
+
"description": "TypeScript definitions for react-dom",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Asana",
|
|
10
|
+
"url": "https://asana.com"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "AssureSign",
|
|
14
|
+
"url": "http://www.assuresign.com"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Microsoft",
|
|
18
|
+
"url": "https://microsoft.com"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "MartynasZilinskas",
|
|
22
|
+
"githubUsername": "MartynasZilinskas",
|
|
23
|
+
"url": "https://github.com/MartynasZilinskas"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Josh Rutherford",
|
|
27
|
+
"githubUsername": "theruther4d",
|
|
28
|
+
"url": "https://github.com/theruther4d"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Jessica Franco",
|
|
32
|
+
"githubUsername": "Jessidhia",
|
|
33
|
+
"url": "https://github.com/Jessidhia"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Sebastian Silbermann",
|
|
37
|
+
"githubUsername": "eps1lon",
|
|
38
|
+
"url": "https://github.com/eps1lon"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"main": "",
|
|
42
|
+
"types": "index.d.ts",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": {
|
|
46
|
+
"default": "./index.d.ts"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./canary": {
|
|
50
|
+
"types": {
|
|
51
|
+
"default": "./canary.d.ts"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./client": {
|
|
55
|
+
"types": {
|
|
56
|
+
"default": "./client.d.ts"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./server": {
|
|
60
|
+
"types": {
|
|
61
|
+
"default": "./server.d.ts"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"./experimental": {
|
|
65
|
+
"types": {
|
|
66
|
+
"default": "./experimental.d.ts"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"./test-utils": {
|
|
70
|
+
"types": {
|
|
71
|
+
"default": "./test-utils/index.d.ts"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./package.json": "./package.json"
|
|
75
|
+
},
|
|
76
|
+
"repository": {
|
|
77
|
+
"type": "git",
|
|
78
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
79
|
+
"directory": "types/react-dom"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {},
|
|
82
|
+
"dependencies": {},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"@types/react": "^18.0.0"
|
|
85
|
+
},
|
|
86
|
+
"typesPublisherContentHash": "15456a5462ef352f9e36979359f3f69058800e6b78eb73df502bca624fc31eb5",
|
|
87
|
+
"typeScriptVersion": "5.0"
|
|
88
|
+
}
|