Socket
Socket
Sign inDemoInstall

@types/react-dom

Package Overview
Dependencies
4
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 17.0.20 to 17.0.21

58

react-dom v17.0/index.d.ts

@@ -16,6 +16,13 @@ // Type definitions for React (react-dom) 17.0

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";

@@ -25,3 +32,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;

@@ -42,3 +53,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>>(

@@ -48,3 +60,4 @@ parentComponent: Component<any>,

container: Element,
callback?: (component: T) => any): T;
callback?: (component: T) => any,
): T;
export function unstable_renderSubtreeIntoContainer<P>(

@@ -54,3 +67,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;

@@ -65,4 +79,4 @@ export type Container = Element | Document | DocumentFragment;

element: DOMElement<DOMAttributes<T>, T>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): T;

@@ -72,4 +86,4 @@

element: Array<DOMElement<DOMAttributes<any>, any>>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): Element;

@@ -79,4 +93,4 @@

element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): void;

@@ -86,4 +100,4 @@

element: CElement<P, T>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): T;

@@ -93,4 +107,4 @@

element: Array<CElement<any, Component<any, ComponentState>>>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): Component<any, ComponentState>;

@@ -100,4 +114,4 @@

element: ReactElement<P>,
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): Component<P, ComponentState> | Element | void;

@@ -107,5 +121,5 @@

element: ReactElement[],
container: Container| null,
callback?: () => void
container: Container | null,
callback?: () => void,
): Component<any, ComponentState> | Element | void;
}
{
"name": "@types/react-dom",
"version": "17.0.20",
"version": "17.0.21",
"description": "TypeScript definitions for React (react-dom)",

@@ -52,4 +52,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",

},
"typesPublisherContentHash": "d14d72da5d08288eb099b63f3f183efa8fd6a2c70689129663a02fac7a213c5e",
"typeScriptVersion": "4.3"
"typesPublisherContentHash": "6223b5cc7c7572f8b3bb9a53fe6b60be3f6841422188ef5df177220c213bb3a7",
"typeScriptVersion": "4.5"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Tue, 25 Apr 2023 20:32:50 GMT
* Last updated: Wed, 27 Sep 2023 07:12:04 GMT
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)

@@ -14,0 +14,0 @@ * Global values: `ReactDOM`, `ReactDOMServer`

@@ -9,3 +9,3 @@ // forward declarations

import { ReactElement } from 'react';
import { ReactElement } from "react";

@@ -12,0 +12,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;

@@ -179,5 +201,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

@@ -188,5 +212,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;

@@ -199,3 +225,5 @@ /**

export function mockComponent(
mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
mocked: MockedComponentClass,
mockTagName?: string,
): typeof ReactTestUtils;

@@ -211,3 +239,5 @@ /**

export function isElementOfType<T extends HTMLElement>(
element: ReactElement, type: string): element is ReactHTMLElement<T>;
element: ReactElement,
type: string,
): element is ReactHTMLElement<T>;
/**

@@ -217,3 +247,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>;
/**

@@ -223,3 +255,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>;
/**

@@ -229,3 +263,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>;

@@ -244,3 +280,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;

@@ -254,3 +292,4 @@ /**

root: Component<any>,
fn: (i: ReactInstance) => boolean): ReactInstance[];
fn: (i: ReactInstance) => boolean,
): ReactInstance[];

@@ -263,3 +302,4 @@ /**

root: Component<any>,
className: string): Element[];
className: string,
): Element[];
/**

@@ -272,3 +312,4 @@ * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,

root: Component<any>,
className: string): Element;
className: string,
): Element;

@@ -281,3 +322,4 @@ /**

root: Component<any>,
tagName: string): Element[];
tagName: string,
): Element[];
/**

@@ -290,3 +332,4 @@ * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,

root: Component<any>,
tagName: string): Element;
tagName: string,
): Element;

@@ -298,3 +341,4 @@ /**

root: Component<any>,
type: ClassType<any, T, C>): T[];
type: ClassType<any, T, C>,
): T[];

@@ -308,3 +352,4 @@ /**

root: Component<any>,
type: ClassType<any, T, C>): T;
type: ClassType<any, T, C>,
): T;

@@ -311,0 +356,0 @@ /**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc