You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@types/react-dom

Package Overview
Dependencies
1
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 18.2.7 to 18.2.14

112

react-dom/canary.d.ts

@@ -29,20 +29,66 @@ /**

import React = require('react');
import ReactDOM = require('.');
import React = require("react");
import ReactDOM = require(".");
export {};
declare module '.' {
type PreloadAs = 'font' | 'script' | 'style';
declare const REACT_FORM_STATE_SIGIL: unique symbol;
declare module "." {
function prefetchDNS(href: string): void;
interface PreconnectOptions {
// Don't create a helper type.
// It would have to be in module scope to be inlined in TS tooltips.
// But then it becomes part of the public API.
// TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
// since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
}
function preconnect(href: string, options?: PreconnectOptions): void;
type PreloadAs =
| "audio"
| "document"
| "embed"
| "fetch"
| "font"
| "image"
| "object"
| "track"
| "script"
| "style"
| "video"
| "worker";
interface PreloadOptions {
as: PreloadAs;
crossOrigin?: string | undefined;
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
fetchPriority?: "high" | "low" | "auto" | undefined;
// TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
imageSizes?: string | undefined;
imageSrcSet?: string | undefined;
integrity?: string | undefined;
nonce?: string | undefined;
referrerPolicy?: ReferrerPolicy | undefined;
}
function preload(href: string, options?: PreloadOptions): void;
type PreinitAs = 'script' | 'style';
// https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
type PreloadModuleAs = RequestDestination;
interface PreloadModuleOptions {
/**
* @default "script"
*/
as: PreloadModuleAs;
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
integrity?: string | undefined;
nonce?: string | undefined;
}
function preloadModule(href: string, options?: PreloadModuleOptions): void;
type PreinitAs = "script" | "style";
interface PreinitOptions {
as: PreinitAs;
crossOrigin?: string | undefined;
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
fetchPriority?: "high" | "low" | "auto" | undefined;
precedence?: string | undefined;

@@ -53,2 +99,54 @@ integrity?: string | undefined;

function preinit(href: string, options?: PreinitOptions): void;
// Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
type PreinitModuleAs = "script";
interface PreinitModuleOptions {
/**
* @default "script"
*/
as?: PreinitModuleAs;
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
integrity?: string | undefined;
nonce?: string | undefined;
}
function preinitModule(href: string, options?: PreinitModuleOptions): void;
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 useFormStatus(): FormStatus;
function useFormState<State>(
action: (state: State) => Promise<State>,
initialState: State,
permalink?: string,
): [state: State, dispatch: () => void];
function useFormState<State, Payload>(
action: (state: State, payload: Payload) => Promise<State>,
initialState: State,
permalink?: string,
): [state: State, dispatch: (payload: Payload) => void];
}
declare module "./client" {
interface ReactFormState {
[REACT_FORM_STATE_SIGIL]: never;
}
interface HydrationOptions {
formState?: ReactFormState | null;
}
}

2

react-dom/client.d.ts

@@ -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('./canary');
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.7",
"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": "726a49383efba462b3ec2c83e7628b88070ea64986c3f1b2de67241452512b5a",
"typeScriptVersion": "4.3",
"exports": {

@@ -88,3 +77,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: Wed, 12 Jul 2023 19:02:46 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";

@@ -28,0 +28,0 @@ export interface RenderToPipeableStreamOptions {

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 @@ /**

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc