@types/react-dom
Advanced tools
Comparing version 18.2.4 to 18.2.14
@@ -7,3 +7,3 @@ /** | ||
import React = require('react'); | ||
import React = require("react"); | ||
export interface HydrationOptions { | ||
@@ -10,0 +10,0 @@ /** |
@@ -30,25 +30,8 @@ /** | ||
import React = require('react'); | ||
import ReactDOM = require('./next'); | ||
import React = require("react"); | ||
import ReactDOM = require("./canary"); | ||
export {}; | ||
declare module '.' { | ||
interface FormStatusNotPending { | ||
pending: false; | ||
data: null; | ||
method: null; | ||
action: null; | ||
} | ||
interface FormStatusPending { | ||
pending: true; | ||
data: FormData; | ||
method: string; | ||
action: string | ((formData: FormData) => void | Promise<void>); | ||
} | ||
type FormStatus = FormStatusPending | FormStatusNotPending; | ||
function experimental_useFormStatus(): FormStatus; | ||
declare module "." { | ||
} |
@@ -1,13 +0,1 @@ | ||
// Type definitions for React (react-dom) 18.2 | ||
// Project: https://reactjs.org | ||
// Definitions 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> | ||
// Sebastian Silbermann <https://github.com/eps1lon> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.8 | ||
// NOTE: Users of the `experimental` builds of React should add a reference | ||
@@ -20,6 +8,13 @@ // to 'react-dom/experimental' in their project. See experimental.d.ts's top comment | ||
import { | ||
ReactInstance, Component, ComponentState, | ||
ReactElement, FunctionComponentElement, CElement, | ||
DOMAttributes, DOMElement, ReactNode, ReactPortal | ||
} from 'react'; | ||
CElement, | ||
Component, | ||
ComponentState, | ||
DOMAttributes, | ||
DOMElement, | ||
FunctionComponentElement, | ||
ReactElement, | ||
ReactInstance, | ||
ReactNode, | ||
ReactPortal, | ||
} from "react"; | ||
@@ -29,3 +24,7 @@ export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text; | ||
export function createPortal(children: ReactNode, container: Element | DocumentFragment, key?: null | string): ReactPortal; | ||
export function createPortal( | ||
children: ReactNode, | ||
container: Element | DocumentFragment, | ||
key?: null | string, | ||
): ReactPortal; | ||
@@ -46,3 +45,4 @@ export const version: string; | ||
container: Element, | ||
callback?: (element: T) => any): T; | ||
callback?: (element: T) => any, | ||
): T; | ||
export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>( | ||
@@ -52,3 +52,4 @@ parentComponent: Component<any>, | ||
container: Element, | ||
callback?: (component: T) => any): T; | ||
callback?: (component: T) => any, | ||
): T; | ||
export function unstable_renderSubtreeIntoContainer<P>( | ||
@@ -58,3 +59,4 @@ parentComponent: Component<any>, | ||
container: Element, | ||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void; | ||
callback?: (component?: Component<P, ComponentState> | Element) => any, | ||
): Component<P, ComponentState> | Element | void; | ||
@@ -69,4 +71,4 @@ export type Container = Element | Document | DocumentFragment; | ||
element: DOMElement<DOMAttributes<T>, T>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): T; | ||
@@ -76,4 +78,4 @@ | ||
element: Array<DOMElement<DOMAttributes<any>, any>>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): Element; | ||
@@ -83,4 +85,4 @@ | ||
element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): void; | ||
@@ -90,4 +92,4 @@ | ||
element: CElement<P, T>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): T; | ||
@@ -97,4 +99,4 @@ | ||
element: Array<CElement<any, Component<any, ComponentState>>>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): Component<any, ComponentState>; | ||
@@ -104,4 +106,4 @@ | ||
element: ReactElement<P>, | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): Component<P, ComponentState> | Element | void; | ||
@@ -111,5 +113,5 @@ | ||
element: ReactElement[], | ||
container: Container| null, | ||
callback?: () => void | ||
container: Container | null, | ||
callback?: () => void, | ||
): Component<any, ComponentState> | Element | void; | ||
} |
{ | ||
"name": "@types/react-dom", | ||
"version": "18.2.4", | ||
"description": "TypeScript definitions for React (react-dom)", | ||
"version": "18.2.14", | ||
"description": "TypeScript definitions for react-dom", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom", | ||
@@ -22,19 +22,19 @@ "license": "MIT", | ||
"name": "MartynasZilinskas", | ||
"url": "https://github.com/MartynasZilinskas", | ||
"githubUsername": "MartynasZilinskas" | ||
"githubUsername": "MartynasZilinskas", | ||
"url": "https://github.com/MartynasZilinskas" | ||
}, | ||
{ | ||
"name": "Josh Rutherford", | ||
"url": "https://github.com/theruther4d", | ||
"githubUsername": "theruther4d" | ||
"githubUsername": "theruther4d", | ||
"url": "https://github.com/theruther4d" | ||
}, | ||
{ | ||
"name": "Jessica Franco", | ||
"url": "https://github.com/Jessidhia", | ||
"githubUsername": "Jessidhia" | ||
"githubUsername": "Jessidhia", | ||
"url": "https://github.com/Jessidhia" | ||
}, | ||
{ | ||
"name": "Sebastian Silbermann", | ||
"url": "https://github.com/eps1lon", | ||
"githubUsername": "eps1lon" | ||
"githubUsername": "eps1lon", | ||
"url": "https://github.com/eps1lon" | ||
} | ||
@@ -44,13 +44,2 @@ ], | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/react-dom" | ||
}, | ||
"scripts": {}, | ||
"dependencies": { | ||
"@types/react": "*" | ||
}, | ||
"typesPublisherContentHash": "44e1dd3be11d7f0b8d09549cf8a10814625331a7a73865215f38dcab5ee5b64b", | ||
"typeScriptVersion": "4.3", | ||
"exports": { | ||
@@ -67,5 +56,5 @@ ".": { | ||
}, | ||
"./next": { | ||
"./canary": { | ||
"types": { | ||
"default": "./next.d.ts" | ||
"default": "./canary.d.ts" | ||
} | ||
@@ -89,3 +78,14 @@ }, | ||
"./package.json": "./package.json" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/react-dom" | ||
}, | ||
"scripts": {}, | ||
"dependencies": { | ||
"@types/react": "*" | ||
}, | ||
"typesPublisherContentHash": "a91527c44aa825000d86a4ee5471f4cfc93028a45d97c624bca8ba664455d44e", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for React (react-dom) (https://reactjs.org). | ||
This package contains type definitions for react-dom (https://reactjs.org). | ||
@@ -12,7 +12,6 @@ # Details | ||
### Additional Details | ||
* Last updated: Fri, 05 May 2023 15:32:48 GMT | ||
* Last updated: Wed, 18 Oct 2023 18:04:04 GMT | ||
* Dependencies: [@types/react](https://npmjs.com/package/@types/react) | ||
* Global values: `ReactDOM`, `ReactDOMServer` | ||
# Credits | ||
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). |
@@ -24,4 +24,4 @@ // forward declarations | ||
import { ReactElement, ReactNode } from 'react'; | ||
import { ErrorInfo } from './client'; | ||
import { ReactElement, ReactNode } from "react"; | ||
import { ErrorInfo } from "./client"; | ||
@@ -43,6 +43,4 @@ export interface RenderToPipeableStreamOptions { | ||
export interface PipeableStream { | ||
// tslint:disable-next-line:void-return | ||
abort(this: void): void; | ||
// tslint:disable-next-line:void-return | ||
pipe<Writable extends NodeJS.WritableStream>(this: void, destination: Writable): Writable; | ||
abort: (reason?: unknown) => void; | ||
pipe: <Writable extends NodeJS.WritableStream>(destination: Writable) => Writable; | ||
} | ||
@@ -49,0 +47,0 @@ |
import { | ||
AbstractView, Component, ComponentClass, | ||
ReactElement, ReactInstance, ClassType, | ||
DOMElement, FunctionComponentElement, CElement, | ||
ReactHTMLElement, DOMAttributes, FC | ||
} from 'react'; | ||
AbstractView, | ||
CElement, | ||
ClassType, | ||
Component, | ||
ComponentClass, | ||
DOMAttributes, | ||
DOMElement, | ||
FC, | ||
FunctionComponentElement, | ||
ReactElement, | ||
ReactHTMLElement, | ||
ReactInstance, | ||
} from "react"; | ||
@@ -27,3 +35,17 @@ import * as ReactTestUtils from "."; | ||
export type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock"; | ||
export type ModifierKey = | ||
| "Alt" | ||
| "AltGraph" | ||
| "CapsLock" | ||
| "Control" | ||
| "Fn" | ||
| "FnLock" | ||
| "Hyper" | ||
| "Meta" | ||
| "NumLock" | ||
| "ScrollLock" | ||
| "Shift" | ||
| "Super" | ||
| "Symbol" | ||
| "SymbolLock"; | ||
@@ -67,3 +89,3 @@ export interface SyntheticEventData extends OptionalEventProperties { | ||
export interface MockedComponentClass { | ||
new (props: any): any; | ||
new(props: any): any; | ||
} | ||
@@ -87,3 +109,3 @@ | ||
*/ | ||
export namespace Simulate { | ||
export namespace Simulate { | ||
const abort: EventSimulator; | ||
@@ -180,5 +202,7 @@ const animationEnd: EventSimulator; | ||
export function renderIntoDocument<T extends Element>( | ||
element: DOMElement<any, T>): T; | ||
element: DOMElement<any, T>, | ||
): T; | ||
export function renderIntoDocument( | ||
element: FunctionComponentElement<any>): void; | ||
element: FunctionComponentElement<any>, | ||
): void; | ||
// If we replace `P` with `any` in this overload, then some tests fail because | ||
@@ -189,5 +213,7 @@ // calls to `renderIntoDocument` choose the last overload on the | ||
export function renderIntoDocument<P, T extends Component<P>>( | ||
element: CElement<P, T>): T; | ||
element: CElement<P, T>, | ||
): T; | ||
export function renderIntoDocument<P>( | ||
element: ReactElement<P>): Component<P> | Element | void; | ||
element: ReactElement<P>, | ||
): Component<P> | Element | void; | ||
@@ -200,3 +226,5 @@ /** | ||
export function mockComponent( | ||
mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; | ||
mocked: MockedComponentClass, | ||
mockTagName?: string, | ||
): typeof ReactTestUtils; | ||
@@ -212,3 +240,5 @@ /** | ||
export function isElementOfType<T extends HTMLElement>( | ||
element: ReactElement, type: string): element is ReactHTMLElement<T>; | ||
element: ReactElement, | ||
type: string, | ||
): element is ReactHTMLElement<T>; | ||
/** | ||
@@ -218,3 +248,5 @@ * Returns `true` if `element` is a React element whose type is of a React `componentClass`. | ||
export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>( | ||
element: ReactElement, type: string): element is DOMElement<P, T>; | ||
element: ReactElement, | ||
type: string, | ||
): element is DOMElement<P, T>; | ||
/** | ||
@@ -224,3 +256,5 @@ * Returns `true` if `element` is a React element whose type is of a React `componentClass`. | ||
export function isElementOfType<P>( | ||
element: ReactElement, type: FC<P>): element is FunctionComponentElement<P>; | ||
element: ReactElement, | ||
type: FC<P>, | ||
): element is FunctionComponentElement<P>; | ||
/** | ||
@@ -230,3 +264,5 @@ * Returns `true` if `element` is a React element whose type is of a React `componentClass`. | ||
export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>( | ||
element: ReactElement, type: ClassType<P, T, C>): element is CElement<P, T>; | ||
element: ReactElement, | ||
type: ClassType<P, T, C>, | ||
): element is CElement<P, T>; | ||
@@ -245,3 +281,5 @@ /** | ||
export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>( | ||
instance: ReactInstance, type: ClassType<any, T, C>): boolean; | ||
instance: ReactInstance, | ||
type: ClassType<any, T, C>, | ||
): boolean; | ||
@@ -255,3 +293,4 @@ /** | ||
root: Component<any>, | ||
fn: (i: ReactInstance) => boolean): ReactInstance[]; | ||
fn: (i: ReactInstance) => boolean, | ||
): ReactInstance[]; | ||
@@ -264,3 +303,4 @@ /** | ||
root: Component<any>, | ||
className: string): Element[]; | ||
className: string, | ||
): Element[]; | ||
/** | ||
@@ -273,3 +313,4 @@ * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result, | ||
root: Component<any>, | ||
className: string): Element; | ||
className: string, | ||
): Element; | ||
@@ -282,3 +323,4 @@ /** | ||
root: Component<any>, | ||
tagName: string): Element[]; | ||
tagName: string, | ||
): Element[]; | ||
/** | ||
@@ -291,3 +333,4 @@ * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result, | ||
root: Component<any>, | ||
tagName: string): Element; | ||
tagName: string, | ||
): Element; | ||
@@ -299,3 +342,4 @@ /** | ||
root: Component<any>, | ||
type: ClassType<any, T, C>): T[]; | ||
type: ClassType<any, T, C>, | ||
): T[]; | ||
@@ -309,3 +353,4 @@ /** | ||
root: Component<any>, | ||
type: ClassType<any, T, C>): T; | ||
type: ClassType<any, T, C>, | ||
): T; | ||
@@ -312,0 +357,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32703
758
16