,
- element: CElement,
- container: Element,
- callback?: (component: T) => any,
-): T;
-/**
- * @deprecated
- */
-export function unstable_renderSubtreeIntoContainer
(
- parentComponent: Component,
- element: ReactElement,
- container: Element,
- callback?: (component?: Component
| Element) => any,
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
-): Component
| Element | void;
-
-export type Container = Element | Document | DocumentFragment;
-
-export interface Renderer {
- // Deprecated(render): The return value is deprecated.
- // In future releases the render function's return type will be void.
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: DOMElement, T>,
- container: Container | null,
- callback?: () => void,
- ): T;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: Array, any>>,
- container: Container | null,
- callback?: () => void,
- ): Element;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: FunctionComponentElement | Array>,
- container: Container | null,
- callback?: () => void,
- ): void;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- >(
- element: CElement
,
- container: Container | null,
- callback?: () => void,
- ): T;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: Array>>,
- container: Container | null,
- callback?: () => void,
- ): Component;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: ReactElement
,
- container: Container | null,
- callback?: () => void,
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
- ): Component
| Element | void;
-
- /**
- * @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
- */
- (
- element: ReactElement[],
- container: Container | null,
- callback?: () => void,
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
- ): Component | Element | void;
-}
diff --git a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/package.json b/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/package.json
deleted file mode 100644
index 3ffec696..00000000
--- a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/package.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "name": "@types/react-dom",
- "version": "18.3.5",
- "description": "TypeScript definitions for react-dom",
- "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
- "license": "MIT",
- "contributors": [
- {
- "name": "Asana",
- "url": "https://asana.com"
- },
- {
- "name": "AssureSign",
- "url": "http://www.assuresign.com"
- },
- {
- "name": "Microsoft",
- "url": "https://microsoft.com"
- },
- {
- "name": "MartynasZilinskas",
- "githubUsername": "MartynasZilinskas",
- "url": "https://github.com/MartynasZilinskas"
- },
- {
- "name": "Josh Rutherford",
- "githubUsername": "theruther4d",
- "url": "https://github.com/theruther4d"
- },
- {
- "name": "Jessica Franco",
- "githubUsername": "Jessidhia",
- "url": "https://github.com/Jessidhia"
- },
- {
- "name": "Sebastian Silbermann",
- "githubUsername": "eps1lon",
- "url": "https://github.com/eps1lon"
- }
- ],
- "main": "",
- "types": "index.d.ts",
- "exports": {
- ".": {
- "types": {
- "default": "./index.d.ts"
- }
- },
- "./canary": {
- "types": {
- "default": "./canary.d.ts"
- }
- },
- "./client": {
- "types": {
- "default": "./client.d.ts"
- }
- },
- "./server": {
- "types": {
- "default": "./server.d.ts"
- }
- },
- "./experimental": {
- "types": {
- "default": "./experimental.d.ts"
- }
- },
- "./test-utils": {
- "types": {
- "default": "./test-utils/index.d.ts"
- }
- },
- "./package.json": "./package.json"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
- "directory": "types/react-dom"
- },
- "scripts": {},
- "dependencies": {},
- "peerDependencies": {
- "@types/react": "^18.0.0"
- },
- "typesPublisherContentHash": "15456a5462ef352f9e36979359f3f69058800e6b78eb73df502bca624fc31eb5",
- "typeScriptVersion": "5.0"
-}
\ No newline at end of file
diff --git a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/server.d.ts b/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/server.d.ts
deleted file mode 100644
index 236bc58f..00000000
--- a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/server.d.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-// forward declarations
-declare global {
- namespace NodeJS {
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- interface ReadableStream {}
-
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- interface WritableStream {}
- }
-
- /**
- * Stub for https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
- */
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- interface AbortSignal {}
-
- /**
- * Stub for https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
- */
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- interface ReadableStream {}
-}
-
-import { ReactNode } from "react";
-import { ErrorInfo } from "./client";
-
-export interface RenderToPipeableStreamOptions {
- identifierPrefix?: string;
- namespaceURI?: string;
- nonce?: string;
- bootstrapScriptContent?: string;
- bootstrapScripts?: string[];
- bootstrapModules?: string[];
- progressiveChunkSize?: number;
- onShellReady?: () => void;
- onShellError?: (error: unknown) => void;
- onAllReady?: () => void;
- onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
-}
-
-export interface PipeableStream {
- abort: (reason?: unknown) => void;
- pipe: (destination: Writable) => Writable;
-}
-
-export interface ServerOptions {
- identifierPrefix?: string;
-}
-
-/**
- * Only available in the environments with [Node.js Streams](https://nodejs.dev/learn/nodejs-streams).
- *
- * @see [API](https://reactjs.org/docs/react-dom-server.html#rendertopipeablestream)
- *
- * @param children
- * @param options
- */
-export function renderToPipeableStream(children: ReactNode, options?: RenderToPipeableStreamOptions): PipeableStream;
-
-/**
- * Render a React element to its initial HTML. This should only be used on the server.
- * React will return an HTML string. You can use this method to generate HTML on the server
- * and send the markup down on the initial request for faster page loads and to allow search
- * engines to crawl your pages for SEO purposes.
- *
- * If you call `ReactDOMClient.hydrateRoot()` on a node that already has this server-rendered markup,
- * React will preserve it and only attach event handlers, allowing you
- * to have a very performant first-load experience.
- */
-export function renderToString(element: ReactNode, options?: ServerOptions): string;
-
-/**
- * Render a React element to its initial HTML. Returns a Readable stream that outputs
- * an HTML string. The HTML output by this stream is exactly equal to what
- * `ReactDOMServer.renderToString()` would return.
- *
- * @deprecated
- */
-export function renderToNodeStream(element: ReactNode, options?: ServerOptions): NodeJS.ReadableStream;
-
-/**
- * Similar to `renderToString`, except this doesn't create extra DOM attributes
- * such as `data-reactid`, that React uses internally. This is useful if you want
- * to use React as a simple static page generator, as stripping away the extra
- * attributes can save lots of bytes.
- */
-export function renderToStaticMarkup(element: ReactNode, options?: ServerOptions): string;
-
-/**
- * Similar to `renderToNodeStream`, except this doesn't create extra DOM attributes
- * such as `data-reactid`, that React uses internally. The HTML output by this stream
- * is exactly equal to what `ReactDOMServer.renderToStaticMarkup()` would return.
- *
- * @deprecated
- */
-export function renderToStaticNodeStream(element: ReactNode, options?: ServerOptions): NodeJS.ReadableStream;
-
-export interface RenderToReadableStreamOptions {
- identifierPrefix?: string;
- namespaceURI?: string;
- nonce?: string;
- bootstrapScriptContent?: string;
- bootstrapScripts?: string[];
- bootstrapModules?: string[];
- progressiveChunkSize?: number;
- signal?: AbortSignal;
- onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
-}
-
-export interface ReactDOMServerReadableStream extends ReadableStream {
- allReady: Promise;
-}
-
-/**
- * Only available in the environments with [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) (this includes browsers, Deno, and some modern edge runtimes).
- *
- * @see [API](https://reactjs.org/docs/react-dom-server.html#rendertoreadablestream)
- */
-export function renderToReadableStream(
- children: ReactNode,
- options?: RenderToReadableStreamOptions,
-): Promise;
-
-export const version: string;
-
-export as namespace ReactDOMServer;
diff --git a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/test-utils/index.d.ts b/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/test-utils/index.d.ts
deleted file mode 100644
index c6dc1245..00000000
--- a/node_modules/.pnpm/@types+react-dom@18.3.5_@types+react@18.3.17/node_modules/@types/react-dom/test-utils/index.d.ts
+++ /dev/null
@@ -1,402 +0,0 @@
-import {
- AbstractView,
- CElement,
- ClassType,
- Component,
- ComponentClass,
- DOMAttributes,
- DOMElement,
- FC,
- FunctionComponentElement,
- ReactElement,
- ReactHTMLElement,
- ReactInstance,
-} from "react";
-
-import * as ReactTestUtils from ".";
-
-export {};
-
-export interface OptionalEventProperties {
- bubbles?: boolean | undefined;
- cancelable?: boolean | undefined;
- currentTarget?: EventTarget | undefined;
- defaultPrevented?: boolean | undefined;
- eventPhase?: number | undefined;
- isTrusted?: boolean | undefined;
- nativeEvent?: Event | undefined;
- preventDefault?(): void;
- stopPropagation?(): void;
- target?: EventTarget | undefined;
- timeStamp?: Date | undefined;
- type?: string | undefined;
-}
-
-export type ModifierKey =
- | "Alt"
- | "AltGraph"
- | "CapsLock"
- | "Control"
- | "Fn"
- | "FnLock"
- | "Hyper"
- | "Meta"
- | "NumLock"
- | "ScrollLock"
- | "Shift"
- | "Super"
- | "Symbol"
- | "SymbolLock";
-
-export interface SyntheticEventData extends OptionalEventProperties {
- altKey?: boolean | undefined;
- button?: number | undefined;
- buttons?: number | undefined;
- clientX?: number | undefined;
- clientY?: number | undefined;
- changedTouches?: TouchList | undefined;
- charCode?: number | undefined;
- clipboardData?: DataTransfer | undefined;
- ctrlKey?: boolean | undefined;
- deltaMode?: number | undefined;
- deltaX?: number | undefined;
- deltaY?: number | undefined;
- deltaZ?: number | undefined;
- detail?: number | undefined;
- getModifierState?(key: ModifierKey): boolean;
- key?: string | undefined;
- keyCode?: number | undefined;
- locale?: string | undefined;
- location?: number | undefined;
- metaKey?: boolean | undefined;
- pageX?: number | undefined;
- pageY?: number | undefined;
- relatedTarget?: EventTarget | undefined;
- repeat?: boolean | undefined;
- screenX?: number | undefined;
- screenY?: number | undefined;
- shiftKey?: boolean | undefined;
- targetTouches?: TouchList | undefined;
- touches?: TouchList | undefined;
- view?: AbstractView | undefined;
- which?: number | undefined;
-}
-
-export type EventSimulator = (element: Element | Component, eventData?: SyntheticEventData) => void;
-
-export interface MockedComponentClass {
- new(props: any): any;
-}
-
-export interface ShallowRenderer {
- /**
- * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
- */
- getRenderOutput(): E;
- /**
- * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep.
- */
- render(element: ReactElement, context?: any): void;
- unmount(): void;
-}
-
-/**
- * Simulate an event dispatch on a DOM node with optional `eventData` event data.
- * `Simulate` has a method for every event that React understands.
- */
-export namespace Simulate {
- const abort: EventSimulator;
- const animationEnd: EventSimulator;
- const animationIteration: EventSimulator;
- const animationStart: EventSimulator;
- const blur: EventSimulator;
- const cancel: EventSimulator;
- const canPlay: EventSimulator;
- const canPlayThrough: EventSimulator;
- const change: EventSimulator;
- const click: EventSimulator;
- const close: EventSimulator;
- const compositionEnd: EventSimulator;
- const compositionStart: EventSimulator;
- const compositionUpdate: EventSimulator;
- const contextMenu: EventSimulator;
- const copy: EventSimulator;
- const cut: EventSimulator;
- const auxClick: EventSimulator;
- const doubleClick: EventSimulator;
- const drag: EventSimulator;
- const dragEnd: EventSimulator;
- const dragEnter: EventSimulator;
- const dragExit: EventSimulator;
- const dragLeave: EventSimulator;
- const dragOver: EventSimulator;
- const dragStart: EventSimulator;
- const drop: EventSimulator;
- const durationChange: EventSimulator;
- const emptied: EventSimulator;
- const encrypted: EventSimulator;
- const ended: EventSimulator;
- const error: EventSimulator;
- const focus: EventSimulator;
- const input: EventSimulator;
- const invalid: EventSimulator;
- const keyDown: EventSimulator;
- const keyPress: EventSimulator;
- const keyUp: EventSimulator;
- const load: EventSimulator;
- const loadStart: EventSimulator;
- const loadedData: EventSimulator;
- const loadedMetadata: EventSimulator;
- const mouseDown: EventSimulator;
- const mouseEnter: EventSimulator;
- const mouseLeave: EventSimulator;
- const mouseMove: EventSimulator;
- const mouseOut: EventSimulator;
- const mouseOver: EventSimulator;
- const mouseUp: EventSimulator;
- const paste: EventSimulator;
- const pause: EventSimulator;
- const play: EventSimulator;
- const playing: EventSimulator;
- const progress: EventSimulator;
- const pointerCancel: EventSimulator;
- const pointerDown: EventSimulator;
- const pointerUp: EventSimulator;
- const pointerMove: EventSimulator;
- const pointerOut: EventSimulator;
- const pointerOver: EventSimulator;
- const pointerEnter: EventSimulator;
- const pointerLeave: EventSimulator;
- const gotPointerCapture: EventSimulator;
- const lostPointerCapture: EventSimulator;
- const rateChange: EventSimulator;
- const reset: EventSimulator;
- const resize: EventSimulator;
- const scroll: EventSimulator;
- const toggle: EventSimulator;
- const seeked: EventSimulator;
- const seeking: EventSimulator;
- const select: EventSimulator;
- const beforeInput: EventSimulator;
- const stalled: EventSimulator;
- const submit: EventSimulator;
- const suspend: EventSimulator;
- const timeUpdate: EventSimulator;
- const touchCancel: EventSimulator;
- const touchEnd: EventSimulator;
- const touchMove: EventSimulator;
- const touchStart: EventSimulator;
- const transitionEnd: EventSimulator;
- const volumeChange: EventSimulator;
- const waiting: EventSimulator;
- const wheel: EventSimulator;
-}
-
-/**
- * Render a React element into a detached DOM node in the document. __This function requires a DOM__.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function renderIntoDocument(
- element: DOMElement,
-): T;
-/** @deprecated https://react.dev/warnings/react-dom-test-utils */
-export function renderIntoDocument(
- element: FunctionComponentElement,
-): void;
-// If we replace `P` with `any` in this overload, then some tests fail because
-// calls to `renderIntoDocument` choose the last overload on the
-// subtype-relation pass and get an undesirably broad return type. Using `P`
-// allows this overload to match on the subtype-relation pass.
-/**
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function renderIntoDocument>(
- element: CElement
,
-): T;
-/**
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function renderIntoDocument
(
- element: ReactElement
,
-): Component
| Element | void;
-
-/**
- * Pass a mocked component module to this method to augment it with useful methods that allow it to
- * be used as a dummy React component. Instead of rendering as usual, the component will become
- * a simple `
` (or other tag if `mockTagName` is provided) containing any provided children.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function mockComponent(
- mocked: MockedComponentClass,
- mockTagName?: string,
-): typeof ReactTestUtils;
-
-/**
- * Returns `true` if `element` is any React element.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isElement(element: any): boolean;
-
-/**
- * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isElementOfType
(
- element: ReactElement,
- type: string,
-): element is ReactHTMLElement;
-/**
- * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isElementOfType, T extends Element>(
- element: ReactElement,
- type: string,
-): element is DOMElement
;
-/**
- * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isElementOfType
(
- element: ReactElement,
- type: FC
,
-): element is FunctionComponentElement
;
-/**
- * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isElementOfType
, C extends ComponentClass
>(
- element: ReactElement,
- type: ClassType
,
-): element is CElement
;
-
-/**
- * Returns `true` if `instance` is a DOM component (such as a `
` or `
`).
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isDOMComponent(instance: ReactInstance): instance is Element;
-/**
- * Returns `true` if `instance` is a user-defined component, such as a class or a function.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isCompositeComponent(instance: ReactInstance): instance is Component;
-/**
- * Returns `true` if `instance` is a component whose type is of a React `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function isCompositeComponentWithType, C extends ComponentClass>(
- instance: ReactInstance,
- type: ClassType,
-): boolean;
-
-/**
- * Traverse all components in `tree` and accumulate all components where
- * `test(component)` is `true`. This is not that useful on its own, but it's used
- * as a primitive for other test utils.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function findAllInRenderedTree(
- root: Component,
- fn: (i: ReactInstance) => boolean,
-): ReactInstance[];
-
-/**
- * Finds all DOM elements of components in the rendered tree that are
- * DOM components with the class name matching `className`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function scryRenderedDOMComponentsWithClass(
- root: Component,
- className: string,
-): Element[];
-/**
- * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
- * and returns that one result, or throws exception if there is any other
- * number of matches besides one.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function findRenderedDOMComponentWithClass(
- root: Component,
- className: string,
-): Element;
-
-/**
- * Finds all DOM elements of components in the rendered tree that are
- * DOM components with the tag name matching `tagName`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function scryRenderedDOMComponentsWithTag(
- root: Component,
- tagName: string,
-): Element[];
-/**
- * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
- * and returns that one result, or throws exception if there is any other
- * number of matches besides one.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function findRenderedDOMComponentWithTag(
- root: Component,
- tagName: string,
-): Element;
-
-/**
- * Finds all instances of components with type equal to `componentClass`.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function scryRenderedComponentsWithType, C extends ComponentClass>(
- root: Component,
- type: ClassType,
-): T[];
-
-/**
- * Same as `scryRenderedComponentsWithType()` but expects there to be one result
- * and returns that one result, or throws exception if there is any other
- * number of matches besides one.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function findRenderedComponentWithType, C extends ComponentClass>(
- root: Component,
- type: ClassType,
-): T;
-
-/**
- * Call this in your tests to create a shallow renderer.
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function createRenderer(): ShallowRenderer;
-
-// NOTES
-// - the order of these signatures matters - typescript will check the signatures in source order.
-// If the `() => VoidOrUndefinedOnly` signature is first, it'll erroneously match a Promise returning function for users with
-// `strictNullChecks: false`.
-// - VoidOrUndefinedOnly is there to forbid any non-void return values for users with `strictNullChecks: true`
-declare const UNDEFINED_VOID_ONLY: unique symbol;
-// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
-type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
-/**
- * Wrap any code rendering and triggering updates to your components into `act()` calls.
- *
- * Ensures that the behavior in your tests matches what happens in the browser
- * more closely by executing pending `useEffect`s before returning. This also
- * reduces the amount of re-renders done.
- *
- * @param callback A synchronous, void callback that will execute as a single, complete React commit.
- *
- * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
- *
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-// While act does always return Thenable, if a void function is passed, we pretend the return value is also void to not trigger dangling Promise lint rules.
-export function act(callback: () => VoidOrUndefinedOnly): void;
-/**
- * @deprecated https://react.dev/warnings/react-dom-test-utils
- */
-export function act(callback: () => T | Promise): Promise;
-
-// Intentionally doesn't extend PromiseLike.
-// Ideally this should be as hard to accidentally use as possible.
-export interface DebugPromiseLike {
- // the actual then() in here is 0-ary, but that doesn't count as a PromiseLike.
- then(onfulfilled: (value: never) => never, onrejected: (reason: never) => never): never;
-}
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/prop-types b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/prop-types
deleted file mode 120000
index a7f2a135..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/prop-types
+++ /dev/null
@@ -1 +0,0 @@
-../../../@types+prop-types@15.7.14/node_modules/@types/prop-types
\ No newline at end of file
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/LICENSE b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/LICENSE
deleted file mode 100644
index 9e841e7a..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
- MIT License
-
- Copyright (c) Microsoft Corporation.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/README.md b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/README.md
deleted file mode 100644
index 0b84cd1e..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Installation
-> `npm install --save @types/react`
-
-# Summary
-This package contains type definitions for react (https://react.dev/).
-
-# Details
-Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react/v18.
-
-### Additional Details
- * Last updated: Mon, 16 Dec 2024 12:44:17 GMT
- * Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [csstype](https://npmjs.com/package/csstype)
-
-# Credits
-These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [John Reilly](https://github.com/johnnyreilly), [Benoit Benezech](https://github.com/bbenezech), [Patricio Zavolinsky](https://github.com/pzavolinsky), [Eric Anderson](https://github.com/ericanderson), [Dovydas Navickas](https://github.com/DovydasNavickas), [Josh Rutherford](https://github.com/theruther4d), [Guilherme Hübner](https://github.com/guilhermehubner), [Ferdy Budhidharma](https://github.com/ferdaber), [Johann Rakotoharisoa](https://github.com/jrakotoharisoa), [Olivier Pascal](https://github.com/pascaloliv), [Martin Hochel](https://github.com/hotell), [Frank Li](https://github.com/franklixuefei), [Jessica Franco](https://github.com/Jessidhia), [Saransh Kataria](https://github.com/saranshkataria), [Kanitkorn Sujautra](https://github.com/lukyth), [Sebastian Silbermann](https://github.com/eps1lon), [Kyle Scully](https://github.com/zieka), [Cong Zhang](https://github.com/dancerphil), [Dimitri Mitropoulos](https://github.com/dimitropoulos), [JongChan Choi](https://github.com/disjukr), [Victor Magalhães](https://github.com/vhfmag), [Priyanshu Rav](https://github.com/priyanshurav), [Dmitry Semigradsky](https://github.com/Semigradsky), and [Matt Pocock](https://github.com/mattpocock).
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/canary.d.ts b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/canary.d.ts
deleted file mode 100644
index 74795b53..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/canary.d.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * These are types for things that are present in the React `canary` release channel.
- *
- * To load the types declared here in an actual project, there are three ways. The easiest one,
- * if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
- * is to add `"react/canary"` to the `"types"` array.
- *
- * Alternatively, a specific import syntax can to be used from a typescript file.
- * This module does not exist in reality, which is why the {} is important:
- *
- * ```ts
- * import {} from 'react/canary'
- * ```
- *
- * It is also possible to include it through a triple-slash reference:
- *
- * ```ts
- * ///
- * ```
- *
- * Either the import or the reference only needs to appear once, anywhere in the project.
- */
-
-// See https://github.com/facebook/react/blob/main/packages/react/src/React.js to see how the exports are declared,
-
-import React = require(".");
-
-export {};
-
-declare const UNDEFINED_VOID_ONLY: unique symbol;
-type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
-
-type NativeToggleEvent = ToggleEvent;
-
-declare module "." {
- export type Usable = PromiseLike | Context;
-
- export function use(usable: Usable): T;
-
- interface ServerContextJSONArray extends ReadonlyArray {}
- export type ServerContextJSONValue =
- | string
- | boolean
- | number
- | null
- | ServerContextJSONArray
- | { [key: string]: ServerContextJSONValue };
- export interface ServerContext {
- Provider: Provider;
- }
- /**
- * Accepts a context object (the value returned from `React.createContext` or `React.createServerContext`) and returns the current
- * context value, as given by the nearest context provider for the given context.
- *
- * @version 16.8.0
- * @see https://react.dev/reference/react/useContext
- */
- function useContext(context: ServerContext): T;
- export function createServerContext(
- globalName: string,
- defaultValue: T,
- ): ServerContext;
-
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
- export function cache(fn: CachedFunction): CachedFunction;
-
- export function unstable_useCacheRefresh(): () => void;
-
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
- functions: (formData: FormData) => void | Promise;
- }
-
- export interface TransitionStartFunction {
- /**
- * Marks all state updates inside the async function as transitions
- *
- * @see {https://react.dev/reference/react/useTransition#starttransition}
- *
- * @param callback
- */
- (callback: () => Promise): void;
- }
-
- /**
- * Similar to `useTransition` but allows uses where hooks are not available.
- *
- * @param callback An _asynchronous_ function which causes state updates that can be deferred.
- */
- export function startTransition(scope: () => Promise): void;
-
- export function useOptimistic(
- passthrough: State,
- ): [State, (action: State | ((pendingState: State) => State)) => void];
- export function useOptimistic(
- passthrough: State,
- reducer: (state: State, action: Action) => State,
- ): [State, (action: Action) => void];
-
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
- cleanup: () => VoidOrUndefinedOnly;
- }
-
- export function useActionState(
- action: (state: Awaited) => State | Promise,
- initialState: Awaited,
- permalink?: string,
- ): [state: Awaited, dispatch: () => void, isPending: boolean];
- export function useActionState(
- action: (state: Awaited, payload: Payload) => State | Promise,
- initialState: Awaited,
- permalink?: string,
- ): [state: Awaited, dispatch: (payload: Payload) => void, isPending: boolean];
-
- interface DOMAttributes {
- // Transition Events
- onTransitionCancel?: TransitionEventHandler | undefined;
- onTransitionCancelCapture?: TransitionEventHandler | undefined;
- onTransitionRun?: TransitionEventHandler | undefined;
- onTransitionRunCapture?: TransitionEventHandler | undefined;
- onTransitionStart?: TransitionEventHandler | undefined;
- onTransitionStartCapture?: TransitionEventHandler | undefined;
- }
-
- type ToggleEventHandler = EventHandler>;
-
- interface HTMLAttributes {
- popover?: "" | "auto" | "manual" | undefined;
- popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
- popoverTarget?: string | undefined;
- onToggle?: ToggleEventHandler | undefined;
- onBeforeToggle?: ToggleEventHandler | undefined;
- }
-
- interface ToggleEvent extends SyntheticEvent {
- oldState: "closed" | "open";
- newState: "closed" | "open";
- }
-
- interface LinkHTMLAttributes {
- precedence?: string | undefined;
- }
-
- interface StyleHTMLAttributes {
- href?: string | undefined;
- precedence?: string | undefined;
- }
-
- /**
- * @internal Use `Awaited` instead
- */
- // Helper type to enable `Awaited`.
- // Must be a copy of the non-thenables of `ReactNode`.
- type AwaitedReactNode =
- | ReactElement
- | string
- | number
- | Iterable
- | ReactPortal
- | boolean
- | null
- | undefined;
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {
- promises: Promise;
- bigints: bigint;
- }
-}
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/experimental.d.ts b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/experimental.d.ts
deleted file mode 100644
index 3b71d145..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/experimental.d.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * These are types for things that are present in the `experimental` builds of React but not yet
- * on a stable build.
- *
- * Once they are promoted to stable they can just be moved to the main index file.
- *
- * To load the types declared here in an actual project, there are three ways. The easiest one,
- * if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
- * is to add `"react/experimental"` to the `"types"` array.
- *
- * Alternatively, a specific import syntax can to be used from a typescript file.
- * This module does not exist in reality, which is why the {} is important:
- *
- * ```ts
- * import {} from 'react/experimental'
- * ```
- *
- * It is also possible to include it through a triple-slash reference:
- *
- * ```ts
- * ///
- * ```
- *
- * Either the import or the reference only needs to appear once, anywhere in the project.
- */
-
-// See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
-// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
-// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
-//
-// For the inputs of types exported as simply a fiber tag, the `beginWork` function of ReactFiberBeginWork.js
-// is a good place to start looking for details; it generally calls prop validation functions or delegates
-// all tasks done as part of the render phase (the concurrent part of the React update cycle).
-//
-// Suspense-related handling can be found in ReactFiberThrow.js.
-
-import React = require("./canary");
-
-export {};
-
-declare const UNDEFINED_VOID_ONLY: unique symbol;
-type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
-
-declare module "." {
- export interface SuspenseProps {
- /**
- * The presence of this prop indicates that the content is computationally expensive to render.
- * In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
- * @see {@link https://github.com/facebook/react/pull/19936}
- */
- unstable_expectedLoadTime?: number | undefined;
- }
-
- export type SuspenseListRevealOrder = "forwards" | "backwards" | "together";
- export type SuspenseListTailMode = "collapsed" | "hidden";
-
- export interface SuspenseListCommonProps {
- /**
- * Note that SuspenseList require more than one child;
- * it is a runtime warning to provide only a single child.
- *
- * It does, however, allow those children to be wrapped inside a single
- * level of ``.
- */
- children: ReactElement | Iterable;
- }
-
- interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
- /**
- * Defines the order in which the `SuspenseList` children should be revealed.
- */
- revealOrder: "forwards" | "backwards";
- /**
- * Dictates how unloaded items in a SuspenseList is shown.
- *
- * - By default, `SuspenseList` will show all fallbacks in the list.
- * - `collapsed` shows only the next fallback in the list.
- * - `hidden` doesn’t show any unloaded items.
- */
- tail?: SuspenseListTailMode | undefined;
- }
-
- interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
- /**
- * Defines the order in which the `SuspenseList` children should be revealed.
- */
- revealOrder?: Exclude | undefined;
- /**
- * The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
- */
- tail?: never | undefined;
- }
-
- export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
-
- /**
- * `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
- * in which these components are revealed to the user.
- *
- * When multiple components need to fetch data, this data may arrive in an unpredictable order.
- * However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
- * until previous items have been displayed (this behavior is adjustable).
- *
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
- * @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
- */
- export const unstable_SuspenseList: ExoticComponent;
-
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
- export function experimental_useEffectEvent(event: T): T;
-
- /**
- * Warning: Only available in development builds.
- */
- function captureOwnerStack(): string | null;
-
- type Reference = object;
- type TaintableUniqueValue = string | bigint | ArrayBufferView;
- function experimental_taintUniqueValue(
- message: string | undefined,
- lifetime: Reference,
- value: TaintableUniqueValue,
- ): void;
- function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
-
- export interface HTMLAttributes {
- /**
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
- */
- inert?: boolean | undefined;
- }
-}
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/global.d.ts b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/global.d.ts
deleted file mode 100644
index 8ae2ddd8..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/global.d.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-React projects that don't include the DOM library need these interfaces to compile.
-React Native applications use React, but there is no DOM available. The JavaScript runtime
-is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`.
-
-Warning: all of these interfaces are empty. If you want type definitions for various properties
-(such as HTMLInputElement.prototype.value), you need to add `--lib DOM` (via command line or tsconfig.json).
-*/
-
-interface Event {}
-interface AnimationEvent extends Event {}
-interface ClipboardEvent extends Event {}
-interface CompositionEvent extends Event {}
-interface DragEvent extends Event {}
-interface FocusEvent extends Event {}
-interface KeyboardEvent extends Event {}
-interface MouseEvent extends Event {}
-interface TouchEvent extends Event {}
-interface PointerEvent extends Event {}
-interface ToggleEvent extends Event {}
-interface TransitionEvent extends Event {}
-interface UIEvent extends Event {}
-interface WheelEvent extends Event {}
-
-interface EventTarget {}
-interface Document {}
-interface DataTransfer {}
-interface StyleMedia {}
-
-interface Element {}
-interface DocumentFragment {}
-
-interface HTMLElement extends Element {}
-interface HTMLAnchorElement extends HTMLElement {}
-interface HTMLAreaElement extends HTMLElement {}
-interface HTMLAudioElement extends HTMLElement {}
-interface HTMLBaseElement extends HTMLElement {}
-interface HTMLBodyElement extends HTMLElement {}
-interface HTMLBRElement extends HTMLElement {}
-interface HTMLButtonElement extends HTMLElement {}
-interface HTMLCanvasElement extends HTMLElement {}
-interface HTMLDataElement extends HTMLElement {}
-interface HTMLDataListElement extends HTMLElement {}
-interface HTMLDetailsElement extends HTMLElement {}
-interface HTMLDialogElement extends HTMLElement {}
-interface HTMLDivElement extends HTMLElement {}
-interface HTMLDListElement extends HTMLElement {}
-interface HTMLEmbedElement extends HTMLElement {}
-interface HTMLFieldSetElement extends HTMLElement {}
-interface HTMLFormElement extends HTMLElement {}
-interface HTMLHeadingElement extends HTMLElement {}
-interface HTMLHeadElement extends HTMLElement {}
-interface HTMLHRElement extends HTMLElement {}
-interface HTMLHtmlElement extends HTMLElement {}
-interface HTMLIFrameElement extends HTMLElement {}
-interface HTMLImageElement extends HTMLElement {}
-interface HTMLInputElement extends HTMLElement {}
-interface HTMLModElement extends HTMLElement {}
-interface HTMLLabelElement extends HTMLElement {}
-interface HTMLLegendElement extends HTMLElement {}
-interface HTMLLIElement extends HTMLElement {}
-interface HTMLLinkElement extends HTMLElement {}
-interface HTMLMapElement extends HTMLElement {}
-interface HTMLMetaElement extends HTMLElement {}
-interface HTMLMeterElement extends HTMLElement {}
-interface HTMLObjectElement extends HTMLElement {}
-interface HTMLOListElement extends HTMLElement {}
-interface HTMLOptGroupElement extends HTMLElement {}
-interface HTMLOptionElement extends HTMLElement {}
-interface HTMLOutputElement extends HTMLElement {}
-interface HTMLParagraphElement extends HTMLElement {}
-interface HTMLParamElement extends HTMLElement {}
-interface HTMLPreElement extends HTMLElement {}
-interface HTMLProgressElement extends HTMLElement {}
-interface HTMLQuoteElement extends HTMLElement {}
-interface HTMLSlotElement extends HTMLElement {}
-interface HTMLScriptElement extends HTMLElement {}
-interface HTMLSelectElement extends HTMLElement {}
-interface HTMLSourceElement extends HTMLElement {}
-interface HTMLSpanElement extends HTMLElement {}
-interface HTMLStyleElement extends HTMLElement {}
-interface HTMLTableElement extends HTMLElement {}
-interface HTMLTableColElement extends HTMLElement {}
-interface HTMLTableDataCellElement extends HTMLElement {}
-interface HTMLTableHeaderCellElement extends HTMLElement {}
-interface HTMLTableRowElement extends HTMLElement {}
-interface HTMLTableSectionElement extends HTMLElement {}
-interface HTMLTemplateElement extends HTMLElement {}
-interface HTMLTextAreaElement extends HTMLElement {}
-interface HTMLTimeElement extends HTMLElement {}
-interface HTMLTitleElement extends HTMLElement {}
-interface HTMLTrackElement extends HTMLElement {}
-interface HTMLUListElement extends HTMLElement {}
-interface HTMLVideoElement extends HTMLElement {}
-interface HTMLWebViewElement extends HTMLElement {}
-
-interface SVGElement extends Element {}
-interface SVGSVGElement extends SVGElement {}
-interface SVGCircleElement extends SVGElement {}
-interface SVGClipPathElement extends SVGElement {}
-interface SVGDefsElement extends SVGElement {}
-interface SVGDescElement extends SVGElement {}
-interface SVGEllipseElement extends SVGElement {}
-interface SVGFEBlendElement extends SVGElement {}
-interface SVGFEColorMatrixElement extends SVGElement {}
-interface SVGFEComponentTransferElement extends SVGElement {}
-interface SVGFECompositeElement extends SVGElement {}
-interface SVGFEConvolveMatrixElement extends SVGElement {}
-interface SVGFEDiffuseLightingElement extends SVGElement {}
-interface SVGFEDisplacementMapElement extends SVGElement {}
-interface SVGFEDistantLightElement extends SVGElement {}
-interface SVGFEDropShadowElement extends SVGElement {}
-interface SVGFEFloodElement extends SVGElement {}
-interface SVGFEFuncAElement extends SVGElement {}
-interface SVGFEFuncBElement extends SVGElement {}
-interface SVGFEFuncGElement extends SVGElement {}
-interface SVGFEFuncRElement extends SVGElement {}
-interface SVGFEGaussianBlurElement extends SVGElement {}
-interface SVGFEImageElement extends SVGElement {}
-interface SVGFEMergeElement extends SVGElement {}
-interface SVGFEMergeNodeElement extends SVGElement {}
-interface SVGFEMorphologyElement extends SVGElement {}
-interface SVGFEOffsetElement extends SVGElement {}
-interface SVGFEPointLightElement extends SVGElement {}
-interface SVGFESpecularLightingElement extends SVGElement {}
-interface SVGFESpotLightElement extends SVGElement {}
-interface SVGFETileElement extends SVGElement {}
-interface SVGFETurbulenceElement extends SVGElement {}
-interface SVGFilterElement extends SVGElement {}
-interface SVGForeignObjectElement extends SVGElement {}
-interface SVGGElement extends SVGElement {}
-interface SVGImageElement extends SVGElement {}
-interface SVGLineElement extends SVGElement {}
-interface SVGLinearGradientElement extends SVGElement {}
-interface SVGMarkerElement extends SVGElement {}
-interface SVGMaskElement extends SVGElement {}
-interface SVGMetadataElement extends SVGElement {}
-interface SVGPathElement extends SVGElement {}
-interface SVGPatternElement extends SVGElement {}
-interface SVGPolygonElement extends SVGElement {}
-interface SVGPolylineElement extends SVGElement {}
-interface SVGRadialGradientElement extends SVGElement {}
-interface SVGRectElement extends SVGElement {}
-interface SVGSetElement extends SVGElement {}
-interface SVGStopElement extends SVGElement {}
-interface SVGSwitchElement extends SVGElement {}
-interface SVGSymbolElement extends SVGElement {}
-interface SVGTextElement extends SVGElement {}
-interface SVGTextPathElement extends SVGElement {}
-interface SVGTSpanElement extends SVGElement {}
-interface SVGUseElement extends SVGElement {}
-interface SVGViewElement extends SVGElement {}
-
-interface FormData {}
-interface Text {}
-interface TouchList {}
-interface WebGLRenderingContext {}
-interface WebGL2RenderingContext {}
-
-interface TrustedHTML {}
diff --git a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/index.d.ts b/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/index.d.ts
deleted file mode 100644
index 22634a0b..00000000
--- a/node_modules/.pnpm/@types+react@18.3.17/node_modules/@types/react/index.d.ts
+++ /dev/null
@@ -1,4543 +0,0 @@
-// NOTE: Users of the `experimental` builds of React should add a reference
-// to 'react/experimental' in their project. See experimental.d.ts's top comment
-// for reference and documentation on how exactly to do it.
-
-///
-
-import * as CSS from "csstype";
-import * as PropTypes from "prop-types";
-
-type NativeAnimationEvent = AnimationEvent;
-type NativeClipboardEvent = ClipboardEvent;
-type NativeCompositionEvent = CompositionEvent;
-type NativeDragEvent = DragEvent;
-type NativeFocusEvent = FocusEvent;
-type NativeKeyboardEvent = KeyboardEvent;
-type NativeMouseEvent = MouseEvent;
-type NativeTouchEvent = TouchEvent;
-type NativePointerEvent = PointerEvent;
-type NativeTransitionEvent = TransitionEvent;
-type NativeUIEvent = UIEvent;
-type NativeWheelEvent = WheelEvent;
-
-/**
- * Used to represent DOM API's where users can either pass
- * true or false as a boolean or as its equivalent strings.
- */
-type Booleanish = boolean | "true" | "false";
-
-/**
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin MDN}
- */
-type CrossOrigin = "anonymous" | "use-credentials" | "" | undefined;
-
-declare const UNDEFINED_VOID_ONLY: unique symbol;
-
-/**
- * The function returned from an effect passed to {@link React.useEffect useEffect},
- * which can be used to clean up the effect when the component unmounts.
- *
- * @see {@link https://react.dev/reference/react/useEffect React Docs}
- */
-type Destructor = () => void | { [UNDEFINED_VOID_ONLY]: never };
-type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
-
-// eslint-disable-next-line @definitelytyped/export-just-namespace
-export = React;
-export as namespace React;
-
-declare namespace React {
- //
- // React Elements
- // ----------------------------------------------------------------------
-
- /**
- * Used to retrieve the possible components which accept a given set of props.
- *
- * Can be passed no type parameters to get a union of all possible components
- * and tags.
- *
- * Is a superset of {@link ComponentType}.
- *
- * @template P The props to match against. If not passed, defaults to any.
- * @template Tag An optional tag to match against. If not passed, attempts to match against all possible tags.
- *
- * @example
- *
- * ```tsx
- * // All components and tags (img, embed etc.)
- * // which accept `src`
- * type SrcComponents = ElementType<{ src: any }>;
- * ```
- *
- * @example
- *
- * ```tsx
- * // All components
- * type AllComponents = ElementType;
- * ```
- *
- * @example
- *
- * ```tsx
- * // All custom components which match `src`, and tags which
- * // match `src`, narrowed down to just `audio` and `embed`
- * type SrcComponents = ElementType<{ src: any }, 'audio' | 'embed'>;
- * ```
- */
- type ElementType =
- | { [K in Tag]: P extends JSX.IntrinsicElements[K] ? K : never }[Tag]
- | ComponentType
;
-
- /**
- * Represents any user-defined component, either as a function or a class.
- *
- * Similar to {@link JSXElementConstructor}, but with extra properties like
- * {@link FunctionComponent.defaultProps defaultProps } and
- * {@link ComponentClass.contextTypes contextTypes}.
- *
- * @template P The props the component accepts.
- *
- * @see {@link ComponentClass}
- * @see {@link FunctionComponent}
- */
- type ComponentType
= ComponentClass
| FunctionComponent
;
-
- /**
- * Represents any user-defined component, either as a function or a class.
- *
- * Similar to {@link ComponentType}, but without extra properties like
- * {@link FunctionComponent.defaultProps defaultProps } and
- * {@link ComponentClass.contextTypes contextTypes}.
- *
- * @template P The props the component accepts.
- */
- type JSXElementConstructor
=
- | ((
- props: P,
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-stateless-function-components React Docs}
- */
- deprecatedLegacyContext?: any,
- ) => ReactNode)
- | (new(
- props: P,
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
- */
- deprecatedLegacyContext?: any,
- ) => Component);
-
- /**
- * A readonly ref container where {@link current} cannot be mutated.
- *
- * Created by {@link createRef}, or {@link useRef} when passed `null`.
- *
- * @template T The type of the ref's value.
- *
- * @example
- *
- * ```tsx
- * const ref = createRef();
- *
- * ref.current = document.createElement('div'); // Error
- * ```
- */
- interface RefObject {
- /**
- * The current value of the ref.
- */
- readonly current: T | null;
- }
-
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
- }
- /**
- * A callback fired whenever the ref's value changes.
- *
- * @template T The type of the ref's value.
- *
- * @see {@link https://react.dev/reference/react-dom/components/common#ref-callback React Docs}
- *
- * @example
- *
- * ```tsx
- * console.log(node)} />
- * ```
- */
- type RefCallback
= {
- bivarianceHack(
- instance: T | null,
- ):
- | void
- | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
- keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
- ];
- }["bivarianceHack"];
-
- /**
- * A union type of all possible shapes for React refs.
- *
- * @see {@link RefCallback}
- * @see {@link RefObject}
- */
-
- type Ref = RefCallback | RefObject | null;
- /**
- * A legacy implementation of refs where you can pass a string to a ref prop.
- *
- * @see {@link https://react.dev/reference/react/Component#refs React Docs}
- *
- * @example
- *
- * ```tsx
- *
- * ```
- */
- // TODO: Remove the string ref special case from `PropsWithRef` once we remove LegacyRef
- type LegacyRef = string | Ref;
-
- /**
- * Retrieves the type of the 'ref' prop for a given component type or tag name.
- *
- * @template C The component type.
- *
- * @example
- *
- * ```tsx
- * type MyComponentRef = React.ElementRef;
- * ```
- *
- * @example
- *
- * ```tsx
- * type DivRef = React.ElementRef<'div'>;
- * ```
- */
- type ElementRef<
- C extends
- | ForwardRefExoticComponent
- | { new(props: any): Component }
- | ((props: any, deprecatedLegacyContext?: any) => ReactNode)
- | keyof JSX.IntrinsicElements,
- > =
- // need to check first if `ref` is a valid prop for ts@3.0
- // otherwise it will infer `{}` instead of `never`
- "ref" extends keyof ComponentPropsWithRef
- ? NonNullable["ref"]> extends RefAttributes<
- infer Instance
- >["ref"] ? Instance
- : never
- : never;
-
- type ComponentState = any;
-
- /**
- * A value which uniquely identifies a node among items in an array.
- *
- * @see {@link https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key React Docs}
- */
- type Key = string | number | bigint;
-
- /**
- * @internal The props any component can receive.
- * You don't have to add this type. All components automatically accept these props.
- * ```tsx
- * const Component = () => ;
- *
- * ```
- *
- * WARNING: The implementation of a component will never have access to these attributes.
- * The following example would be incorrect usage because {@link Component} would never have access to `key`:
- * ```tsx
- * const Component = (props: React.Attributes) => props.key;
- * ```
- */
- interface Attributes {
- key?: Key | null | undefined;
- }
- /**
- * The props any component accepting refs can receive.
- * Class components, built-in browser components (e.g. `div`) and forwardRef components can receive refs and automatically accept these props.
- * ```tsx
- * const Component = forwardRef(() => );
- * console.log(current)} />
- * ```
- *
- * You only need this type if you manually author the types of props that need to be compatible with legacy refs.
- * ```tsx
- * interface Props extends React.RefAttributes {}
- * declare const Component: React.FunctionComponent;
- * ```
- *
- * Otherwise it's simpler to directly use {@link Ref} since you can safely use the
- * props type to describe to props that a consumer can pass to the component
- * as well as describing the props the implementation of a component "sees".
- * {@link RefAttributes} is generally not safe to describe both consumer and seen props.
- *
- * ```tsx
- * interface Props extends {
- * ref?: React.Ref | undefined;
- * }
- * declare const Component: React.FunctionComponent;
- * ```
- *
- * WARNING: The implementation of a component will not have access to the same type in versions of React supporting string refs.
- * The following example would be incorrect usage because {@link Component} would never have access to a `ref` with type `string`
- * ```tsx
- * const Component = (props: React.RefAttributes) => props.ref;
- * ```
- */
- interface RefAttributes extends Attributes {
- /**
- * Allows getting a ref to the component instance.
- * Once the component unmounts, React will set `ref.current` to `null`
- * (or call the ref with `null` if you passed a callback ref).
- *
- * @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
- */
- ref?: LegacyRef | undefined;
- }
-
- /**
- * Represents the built-in attributes available to class components.
- */
- interface ClassAttributes extends RefAttributes {
- }
-
- /**
- * Represents a JSX element.
- *
- * Where {@link ReactNode} represents everything that can be rendered, `ReactElement`
- * only represents JSX.
- *
- * @template P The type of the props object
- * @template T The type of the component or tag
- *
- * @example
- *
- * ```tsx
- * const element: ReactElement = ;
- * ```
- */
- interface ReactElement<
- P = any,
- T extends string | JSXElementConstructor = string | JSXElementConstructor,
- > {
- type: T;
- props: P;
- key: string | null;
- }
-
- /**
- * @deprecated
- */
- interface ReactComponentElement<
- T extends keyof JSX.IntrinsicElements | JSXElementConstructor,
- P = Pick, Exclude, "key" | "ref">>,
- > extends ReactElement> {}
-
- interface FunctionComponentElement
extends ReactElement
> {
- ref?: ("ref" extends keyof P ? P extends { ref?: infer R | undefined } ? R : never : never) | undefined;
- }
-
- type CElement
> = ComponentElement
;
- interface ComponentElement
> extends ReactElement
> {
- ref?: LegacyRef | undefined;
- }
-
- /**
- * @deprecated Use {@link ComponentElement} instead.
- */
- type ClassicElement = CElement
>;
-
- // string fallback for custom web-components
- interface DOMElement
| SVGAttributes, T extends Element>
- extends ReactElement
- {
- ref: LegacyRef;
- }
-
- // ReactHTML for ReactHTMLElement
- interface ReactHTMLElement extends DetailedReactHTMLElement, T> {}
-
- interface DetailedReactHTMLElement, T extends HTMLElement> extends DOMElement
{
- type: keyof ReactHTML;
- }
-
- // ReactSVG for ReactSVGElement
- interface ReactSVGElement extends DOMElement, SVGElement> {
- type: keyof ReactSVG;
- }
-
- interface ReactPortal extends ReactElement {
- children: ReactNode;
- }
-
- //
- // Factories
- // ----------------------------------------------------------------------
-
- type Factory = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement
;
-
- /**
- * @deprecated Please use `FunctionComponentFactory`
- */
- type SFCFactory
= FunctionComponentFactory
;
-
- type FunctionComponentFactory
= (
- props?: Attributes & P,
- ...children: ReactNode[]
- ) => FunctionComponentElement
;
-
- type ComponentFactory
> = (
- props?: ClassAttributes & P,
- ...children: ReactNode[]
- ) => CElement;
-
- type CFactory
> = ComponentFactory
;
- type ClassicFactory
= CFactory
>;
-
- type DOMFactory
, T extends Element> = (
- props?: ClassAttributes & P | null,
- ...children: ReactNode[]
- ) => DOMElement;
-
- interface HTMLFactory extends DetailedHTMLFactory, T> {}
-
- interface DetailedHTMLFactory, T extends HTMLElement> extends DOMFactory
{
- (props?: ClassAttributes & P | null, ...children: ReactNode[]): DetailedReactHTMLElement;
- }
-
- interface SVGFactory extends DOMFactory, SVGElement> {
- (
- props?: ClassAttributes & SVGAttributes | null,
- ...children: ReactNode[]
- ): ReactSVGElement;
- }
-
- /**
- * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
- */
- type ReactText = string | number;
- /**
- * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
- */
- type ReactChild = ReactElement | string | number;
-
- /**
- * @deprecated Use either `ReactNode[]` if you need an array or `Iterable` if its passed to a host component.
- */
- interface ReactNodeArray extends ReadonlyArray {}
- /**
- * WARNING: Not related to `React.Fragment`.
- * @deprecated This type is not relevant when using React. Inline the type instead to make the intent clear.
- */
- type ReactFragment = Iterable;
-
- /**
- * Different release channels declare additional types of ReactNode this particular release channel accepts.
- * App or library types should never augment this interface.
- */
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {}
-
- /**
- * Represents all of the things React can render.
- *
- * Where {@link ReactElement} only represents JSX, `ReactNode` represents everything that can be rendered.
- *
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/reactnode/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * // Typing children
- * type Props = { children: ReactNode }
- *
- * const Component = ({ children }: Props) => {children}
- *
- * hello
- * ```
- *
- * @example
- *
- * ```tsx
- * // Typing a custom element
- * type Props = { customElement: ReactNode }
- *
- * const Component = ({ customElement }: Props) => {customElement}
- *
- * hello
} />
- * ```
- */
- // non-thenables need to be kept in sync with AwaitedReactNode
- type ReactNode =
- | ReactElement
- | string
- | number
- | Iterable
- | ReactPortal
- | boolean
- | null
- | undefined
- | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
- keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
- ];
-
- //
- // Top Level API
- // ----------------------------------------------------------------------
-
- // DOM Elements
- /** @deprecated */
- function createFactory(
- type: keyof ReactHTML,
- ): HTMLFactory;
- /** @deprecated */
- function createFactory(
- type: keyof ReactSVG,
- ): SVGFactory;
- /** @deprecated */
- function createFactory, T extends Element>(
- type: string,
- ): DOMFactory
;
-
- // Custom components
- /** @deprecated */
- function createFactory
(type: FunctionComponent
): FunctionComponentFactory
;
- /** @deprecated */
- function createFactory
, C extends ComponentClass
>(
- type: ClassType
,
- ): CFactory
;
- /** @deprecated */
- function createFactory
(type: ComponentClass
): Factory
;
-
- // DOM Elements
- // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
- function createElement(
- type: "input",
- props?: InputHTMLAttributes & ClassAttributes | null,
- ...children: ReactNode[]
- ): DetailedReactHTMLElement, HTMLInputElement>;
- function createElement, T extends HTMLElement>(
- type: keyof ReactHTML,
- props?: ClassAttributes & P | null,
- ...children: ReactNode[]
- ): DetailedReactHTMLElement;
- function createElement
, T extends SVGElement>(
- type: keyof ReactSVG,
- props?: ClassAttributes & P | null,
- ...children: ReactNode[]
- ): ReactSVGElement;
- function createElement, T extends Element>(
- type: string,
- props?: ClassAttributes & P | null,
- ...children: ReactNode[]
- ): DOMElement;
-
- // Custom components
-
- function createElement
(
- type: FunctionComponent
,
- props?: Attributes & P | null,
- ...children: ReactNode[]
- ): FunctionComponentElement
;
- function createElement
, C extends ComponentClass
>(
- type: ClassType
,
- props?: ClassAttributes & P | null,
- ...children: ReactNode[]
- ): CElement;
- function createElement
(
- type: FunctionComponent
| ComponentClass
| string,
- props?: Attributes & P | null,
- ...children: ReactNode[]
- ): ReactElement
;
-
- // DOM Elements
- // ReactHTMLElement
- function cloneElement
, T extends HTMLElement>(
- element: DetailedReactHTMLElement
,
- props?: P,
- ...children: ReactNode[]
- ): DetailedReactHTMLElement
;
- // ReactHTMLElement, less specific
- function cloneElement
, T extends HTMLElement>(
- element: ReactHTMLElement,
- props?: P,
- ...children: ReactNode[]
- ): ReactHTMLElement;
- // SVGElement
- function cloneElement, T extends SVGElement>(
- element: ReactSVGElement,
- props?: P,
- ...children: ReactNode[]
- ): ReactSVGElement;
- // DOM Element (has to be the last, because type checking stops at first overload that fits)
- function cloneElement
, T extends Element>(
- element: DOMElement
,
- props?: DOMAttributes & P,
- ...children: ReactNode[]
- ): DOMElement;
-
- // Custom components
- function cloneElement
(
- element: FunctionComponentElement
,
- props?: Partial
& Attributes,
- ...children: ReactNode[]
- ): FunctionComponentElement
;
- function cloneElement
>(
- element: CElement
,
- props?: Partial
& ClassAttributes,
- ...children: ReactNode[]
- ): CElement;
- function cloneElement
(
- element: ReactElement
,
- props?: Partial
& Attributes,
- ...children: ReactNode[]
- ): ReactElement
;
-
- /**
- * Describes the props accepted by a Context {@link Provider}.
- *
- * @template T The type of the value the context provides.
- */
- interface ProviderProps {
- value: T;
- children?: ReactNode | undefined;
- }
-
- /**
- * Describes the props accepted by a Context {@link Consumer}.
- *
- * @template T The type of the value the context provides.
- */
- interface ConsumerProps {
- children: (value: T) => ReactNode;
- }
-
- /**
- * An object masquerading as a component. These are created by functions
- * like {@link forwardRef}, {@link memo}, and {@link createContext}.
- *
- * In order to make TypeScript work, we pretend that they are normal
- * components.
- *
- * But they are, in fact, not callable - instead, they are objects which
- * are treated specially by the renderer.
- *
- * @template P The props the component accepts.
- */
- interface ExoticComponent {
- (props: P): ReactNode;
- readonly $$typeof: symbol;
- }
-
- /**
- * An {@link ExoticComponent} with a `displayName` property applied to it.
- *
- * @template P The props the component accepts.
- */
- interface NamedExoticComponent
extends ExoticComponent
{
- /**
- * Used in debugging messages. You might want to set it
- * explicitly if you want to display a different name for
- * debugging purposes.
- *
- * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
- */
- displayName?: string | undefined;
- }
-
- /**
- * An {@link ExoticComponent} with a `propTypes` property applied to it.
- *
- * @template P The props the component accepts.
- */
- interface ProviderExoticComponent
extends ExoticComponent
{
- propTypes?: WeakValidationMap
| undefined;
- }
-
- /**
- * Used to retrieve the type of a context object from a {@link Context}.
- *
- * @template C The context object.
- *
- * @example
- *
- * ```tsx
- * import { createContext } from 'react';
- *
- * const MyContext = createContext({ foo: 'bar' });
- *
- * type ContextType = ContextType;
- * // ContextType = { foo: string }
- * ```
- */
- type ContextType> = C extends Context ? T : never;
-
- /**
- * Wraps your components to specify the value of this context for all components inside.
- *
- * @see {@link https://react.dev/reference/react/createContext#provider React Docs}
- *
- * @example
- *
- * ```tsx
- * import { createContext } from 'react';
- *
- * const ThemeContext = createContext('light');
- *
- * function App() {
- * return (
- *
- *
- *
- * );
- * }
- * ```
- */
- type Provider = ProviderExoticComponent>;
-
- /**
- * The old way to read context, before {@link useContext} existed.
- *
- * @see {@link https://react.dev/reference/react/createContext#consumer React Docs}
- *
- * @example
- *
- * ```tsx
- * import { UserContext } from './user-context';
- *
- * function Avatar() {
- * return (
- *
- * {user =>
}
- *
- * );
- * }
- * ```
- */
- type Consumer = ExoticComponent>;
-
- /**
- * Context lets components pass information deep down without explicitly
- * passing props.
- *
- * Created from {@link createContext}
- *
- * @see {@link https://react.dev/learn/passing-data-deeply-with-context React Docs}
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * import { createContext } from 'react';
- *
- * const ThemeContext = createContext('light');
- * ```
- */
- interface Context {
- Provider: Provider;
- Consumer: Consumer;
- /**
- * Used in debugging messages. You might want to set it
- * explicitly if you want to display a different name for
- * debugging purposes.
- *
- * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
- */
- displayName?: string | undefined;
- }
-
- /**
- * Lets you create a {@link Context} that components can provide or read.
- *
- * @param defaultValue The value you want the context to have when there is no matching
- * {@link Provider} in the tree above the component reading the context. This is meant
- * as a "last resort" fallback.
- *
- * @see {@link https://react.dev/reference/react/createContext#reference React Docs}
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * import { createContext } from 'react';
- *
- * const ThemeContext = createContext('light');
- * ```
- */
- function createContext(
- // If you thought this should be optional, see
- // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
- defaultValue: T,
- ): Context;
-
- function isValidElement(object: {} | null | undefined): object is ReactElement
;
-
- /**
- * Maintainer's note: Sync with {@link ReactChildren} until {@link ReactChildren} is removed.
- */
- const Children: {
- map(
- children: C | readonly C[],
- fn: (child: C, index: number) => T,
- ): C extends null | undefined ? C : Array>;
- forEach(children: C | readonly C[], fn: (child: C, index: number) => void): void;
- count(children: any): number;
- only(children: C): C extends any[] ? never : C;
- toArray(children: ReactNode | ReactNode[]): Array>;
- };
- /**
- * Lets you group elements without a wrapper node.
- *
- * @see {@link https://react.dev/reference/react/Fragment React Docs}
- *
- * @example
- *
- * ```tsx
- * import { Fragment } from 'react';
- *
- *
- * | Hello |
- * World |
- *
- * ```
- *
- * @example
- *
- * ```tsx
- * // Using the <>> shorthand syntax:
- *
- * <>
- * Hello |
- * World |
- * >
- * ```
- */
- const Fragment: ExoticComponent<{ children?: ReactNode | undefined }>;
-
- /**
- * Lets you find common bugs in your components early during development.
- *
- * @see {@link https://react.dev/reference/react/StrictMode React Docs}
- *
- * @example
- *
- * ```tsx
- * import { StrictMode } from 'react';
- *
- *
- *
- *
- * ```
- */
- const StrictMode: ExoticComponent<{ children?: ReactNode | undefined }>;
-
- /**
- * The props accepted by {@link Suspense}.
- *
- * @see {@link https://react.dev/reference/react/Suspense React Docs}
- */
- interface SuspenseProps {
- children?: ReactNode | undefined;
-
- /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
- fallback?: ReactNode;
-
- /**
- * A name for this Suspense boundary for instrumentation purposes.
- * The name will help identify this boundary in React DevTools.
- */
- name?: string | undefined;
- }
-
- /**
- * Lets you display a fallback until its children have finished loading.
- *
- * @see {@link https://react.dev/reference/react/Suspense React Docs}
- *
- * @example
- *
- * ```tsx
- * import { Suspense } from 'react';
- *
- * }>
- *
- *
- * ```
- */
- const Suspense: ExoticComponent;
- const version: string;
-
- /**
- * The callback passed to {@link ProfilerProps.onRender}.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- type ProfilerOnRenderCallback = (
- /**
- * The string id prop of the {@link Profiler} tree that has just committed. This lets
- * you identify which part of the tree was committed if you are using multiple
- * profilers.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- id: string,
- /**
- * This lets you know whether the tree has just been mounted for the first time
- * or re-rendered due to a change in props, state, or hooks.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- phase: "mount" | "update" | "nested-update",
- /**
- * The number of milliseconds spent rendering the {@link Profiler} and its descendants
- * for the current update. This indicates how well the subtree makes use of
- * memoization (e.g. {@link memo} and {@link useMemo}). Ideally this value should decrease
- * significantly after the initial mount as many of the descendants will only need to
- * re-render if their specific props change.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- actualDuration: number,
- /**
- * The number of milliseconds estimating how much time it would take to re-render the entire
- * {@link Profiler} subtree without any optimizations. It is calculated by summing up the most
- * recent render durations of each component in the tree. This value estimates a worst-case
- * cost of rendering (e.g. the initial mount or a tree with no memoization). Compare
- * {@link actualDuration} against it to see if memoization is working.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- baseDuration: number,
- /**
- * A numeric timestamp for when React began rendering the current update.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- startTime: number,
- /**
- * A numeric timestamp for when React committed the current update. This value is shared
- * between all profilers in a commit, enabling them to be grouped if desirable.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- */
- commitTime: number,
- ) => void;
-
- /**
- * The props accepted by {@link Profiler}.
- *
- * @see {@link https://react.dev/reference/react/Profiler React Docs}
- */
- interface ProfilerProps {
- children?: ReactNode | undefined;
- id: string;
- onRender: ProfilerOnRenderCallback;
- }
-
- /**
- * Lets you measure rendering performance of a React tree programmatically.
- *
- * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
- *
- * @example
- *
- * ```tsx
- *
- *
- *
- * ```
- */
- const Profiler: ExoticComponent;
-
- //
- // Component API
- // ----------------------------------------------------------------------
-
- type ReactInstance = Component | Element;
-
- // Base component for plain JS classes
- interface Component extends ComponentLifecycle
{}
- class Component
{
- /**
- * If set, `this.context` will be set at runtime to the current value of the given Context.
- *
- * @example
- *
- * ```ts
- * type MyContext = number
- * const Ctx = React.createContext(0)
- *
- * class Foo extends React.Component {
- * static contextType = Ctx
- * context!: React.ContextType
- * render () {
- * return <>My context's value: {this.context}>;
- * }
- * }
- * ```
- *
- * @see {@link https://react.dev/reference/react/Component#static-contexttype}
- */
- static contextType?: Context | undefined;
-
- /**
- * If using the new style context, re-declare this in your class to be the
- * `React.ContextType` of your `static contextType`.
- * Should be used with type annotation or static contextType.
- *
- * @example
- * ```ts
- * static contextType = MyContext
- * // For TS pre-3.7:
- * context!: React.ContextType
- * // For TS 3.7 and above:
- * declare context: React.ContextType
- * ```
- *
- * @see {@link https://react.dev/reference/react/Component#context React Docs}
- */
- context: unknown;
-
- constructor(props: P);
- /**
- * @deprecated
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html React Docs}
- */
- constructor(props: P, context: any);
-
- // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
- // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
- // Also, the ` | S` allows intellisense to not be dumbisense
- setState(
- state: ((prevState: Readonly, props: Readonly) => Pick | S | null) | (Pick | S | null),
- callback?: () => void,
- ): void;
-
- forceUpdate(callback?: () => void): void;
- render(): ReactNode;
-
- readonly props: Readonly
;
- state: Readonly;
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs Legacy React Docs}
- */
- refs: {
- [key: string]: ReactInstance;
- };
- }
-
- class PureComponent
extends Component
{}
-
- /**
- * @deprecated Use `ClassicComponent` from `create-react-class`
- *
- * @see {@link https://legacy.reactjs.org/docs/react-without-es6.html Legacy React Docs}
- * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
- */
- interface ClassicComponent
extends Component
{
- replaceState(nextState: S, callback?: () => void): void;
- isMounted(): boolean;
- getInitialState?(): S;
- }
-
- interface ChildContextProvider {
- getChildContext(): CC;
- }
-
- //
- // Class Interfaces
- // ----------------------------------------------------------------------
-
- /**
- * Represents the type of a function component. Can optionally
- * receive a type argument that represents the props the component
- * receives.
- *
- * @template P The props the component accepts.
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}
- * @alias for {@link FunctionComponent}
- *
- * @example
- *
- * ```tsx
- * // With props:
- * type Props = { name: string }
- *
- * const MyComponent: FC = (props) => {
- * return {props.name}
- * }
- * ```
- *
- * @example
- *
- * ```tsx
- * // Without props:
- * const MyComponentWithoutProps: FC = () => {
- * return MyComponentWithoutProps
- * }
- * ```
- */
- type FC = FunctionComponent
;
-
- /**
- * Represents the type of a function component. Can optionally
- * receive a type argument that represents the props the component
- * accepts.
- *
- * @template P The props the component accepts.
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * // With props:
- * type Props = { name: string }
- *
- * const MyComponent: FunctionComponent = (props) => {
- * return {props.name}
- * }
- * ```
- *
- * @example
- *
- * ```tsx
- * // Without props:
- * const MyComponentWithoutProps: FunctionComponent = () => {
- * return MyComponentWithoutProps
- * }
- * ```
- */
- interface FunctionComponent {
- (
- props: P,
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
- */
- deprecatedLegacyContext?: any,
- ): ReactNode;
- /**
- * Used to declare the types of the props accepted by the
- * component. These types will be checked during rendering
- * and in development only.
- *
- * We recommend using TypeScript instead of checking prop
- * types at runtime.
- *
- * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
- */
- propTypes?: WeakValidationMap
| undefined;
- /**
- * @deprecated
- *
- * Lets you specify which legacy context is consumed by
- * this component.
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html Legacy React Docs}
- */
- contextTypes?: ValidationMap | undefined;
- /**
- * Used to define default values for the props accepted by
- * the component.
- *
- * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
- *
- * @example
- *
- * ```tsx
- * type Props = { name?: string }
- *
- * const MyComponent: FC = (props) => {
- * return {props.name}
- * }
- *
- * MyComponent.defaultProps = {
- * name: 'John Doe'
- * }
- * ```
- *
- * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
- */
- defaultProps?: Partial | undefined;
- /**
- * Used in debugging messages. You might want to set it
- * explicitly if you want to display a different name for
- * debugging purposes.
- *
- * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
- *
- * @example
- *
- * ```tsx
- *
- * const MyComponent: FC = () => {
- * return
Hello!
- * }
- *
- * MyComponent.displayName = 'MyAwesomeComponent'
- * ```
- */
- displayName?: string | undefined;
- }
-
- /**
- * @deprecated - Equivalent to {@link React.FunctionComponent}.
- *
- * @see {@link React.FunctionComponent}
- * @alias {@link VoidFunctionComponent}
- */
- type VFC = VoidFunctionComponent
;
-
- /**
- * @deprecated - Equivalent to {@link React.FunctionComponent}.
- *
- * @see {@link React.FunctionComponent}
- */
- interface VoidFunctionComponent
{
- (
- props: P,
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
- */
- deprecatedLegacyContext?: any,
- ): ReactNode;
- propTypes?: WeakValidationMap
| undefined;
- contextTypes?: ValidationMap | undefined;
- /**
- * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
- */
- defaultProps?: Partial | undefined;
- displayName?: string | undefined;
- }
-
- /**
- * The type of the ref received by a {@link ForwardRefRenderFunction}.
- *
- * @see {@link ForwardRefRenderFunction}
- */
- type ForwardedRef = ((instance: T | null) => void) | MutableRefObject | null;
-
- /**
- * The type of the function passed to {@link forwardRef}. This is considered different
- * to a normal {@link FunctionComponent} because it receives an additional argument,
- *
- * @param props Props passed to the component, if any.
- * @param ref A ref forwarded to the component of type {@link ForwardedRef}.
- *
- * @template T The type of the forwarded ref.
- * @template P The type of the props the component accepts.
- *
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/ React TypeScript Cheatsheet}
- * @see {@link forwardRef}
- */
- interface ForwardRefRenderFunction {
- (props: P, ref: ForwardedRef): ReactNode;
- /**
- * Used in debugging messages. You might want to set it
- * explicitly if you want to display a different name for
- * debugging purposes.
- *
- * Will show `ForwardRef(${Component.displayName || Component.name})`
- * in devtools by default, but can be given its own specific name.
- *
- * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
- */
- displayName?: string | undefined;
- /**
- * defaultProps are not supported on render functions passed to forwardRef.
- *
- * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
- * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
- */
- defaultProps?: never | undefined;
- /**
- * propTypes are not supported on render functions passed to forwardRef.
- *
- * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
- * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
- */
- propTypes?: never | undefined;
- }
-
- /**
- * Represents a component class in React.
- *
- * @template P The props the component accepts.
- * @template S The internal state of the component.
- */
- interface ComponentClass extends StaticLifecycle
{
- new(
- props: P,
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
- */
- deprecatedLegacyContext?: any,
- ): Component
;
- /**
- * Used to declare the types of the props accepted by the
- * component. These types will be checked during rendering
- * and in development only.
- *
- * We recommend using TypeScript instead of checking prop
- * types at runtime.
- *
- * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
- */
- propTypes?: WeakValidationMap
| undefined;
- contextType?: Context | undefined;
- /**
- * @deprecated use {@link ComponentClass.contextType} instead
- *
- * Lets you specify which legacy context is consumed by
- * this component.
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html Legacy React Docs}
- */
- contextTypes?: ValidationMap | undefined;
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#how-to-use-context Legacy React Docs}
- */
- childContextTypes?: ValidationMap | undefined;
- /**
- * Used to define default values for the props accepted by
- * the component.
- *
- * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
- */
- defaultProps?: Partial | undefined;
- /**
- * Used in debugging messages. You might want to set it
- * explicitly if you want to display a different name for
- * debugging purposes.
- *
- * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
- */
- displayName?: string | undefined;
- }
-
- /**
- * @deprecated Use `ClassicComponentClass` from `create-react-class`
- *
- * @see {@link https://legacy.reactjs.org/docs/react-without-es6.html Legacy React Docs}
- * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
- */
- interface ClassicComponentClass
extends ComponentClass
{
- new(props: P, deprecatedLegacyContext?: any): ClassicComponent
;
- getDefaultProps?(): P;
- }
-
- /**
- * Used in {@link createElement} and {@link createFactory} to represent
- * a class.
- *
- * An intersection type is used to infer multiple type parameters from
- * a single argument, which is useful for many top-level API defs.
- * See {@link https://github.com/Microsoft/TypeScript/issues/7234 this GitHub issue}
- * for more info.
- */
- type ClassType
, C extends ComponentClass
> =
- & C
- & (new(props: P, deprecatedLegacyContext?: any) => T);
-
- //
- // Component Specs and Lifecycle
- // ----------------------------------------------------------------------
-
- // This should actually be something like `Lifecycle
| DeprecatedLifecycle
`,
- // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle
- // methods are present.
- interface ComponentLifecycle
extends NewLifecycle
, DeprecatedLifecycle
{
- /**
- * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
- */
- componentDidMount?(): void;
- /**
- * Called to determine whether the change in props and state should trigger a re-render.
- *
- * `Component` always returns true.
- * `PureComponent` implements a shallow comparison on props and state and returns true if any
- * props or states have changed.
- *
- * If false is returned, {@link Component.render}, `componentWillUpdate`
- * and `componentDidUpdate` will not be called.
- */
- shouldComponentUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): boolean;
- /**
- * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
- * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
- */
- componentWillUnmount?(): void;
- /**
- * Catches exceptions generated in descendant components. Unhandled exceptions will cause
- * the entire component tree to unmount.
- */
- componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
- }
-
- // Unfortunately, we have no way of declaring that the component constructor must implement this
- interface StaticLifecycle
{
- getDerivedStateFromProps?: GetDerivedStateFromProps
| undefined;
- getDerivedStateFromError?: GetDerivedStateFromError
| undefined;
- }
-
- type GetDerivedStateFromProps
=
- /**
- * Returns an update to a component's state based on its new props and old state.
- *
- * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
- */
- (nextProps: Readonly
, prevState: S) => Partial | null;
-
- type GetDerivedStateFromError
=
- /**
- * This lifecycle is invoked after an error has been thrown by a descendant component.
- * It receives the error that was thrown as a parameter and should return a value to update state.
- *
- * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
- */
- (error: any) => Partial | null;
-
- // This should be "infer SS" but can't use it yet
- interface NewLifecycle
{
- /**
- * Runs before React applies the result of {@link Component.render render} to the document, and
- * returns an object to be given to {@link componentDidUpdate}. Useful for saving
- * things such as scroll position before {@link Component.render render} causes changes to it.
- *
- * Note: the presence of this method prevents any of the deprecated
- * lifecycle events from running.
- */
- getSnapshotBeforeUpdate?(prevProps: Readonly
, prevState: Readonly): SS | null;
- /**
- * Called immediately after updating occurs. Not called for the initial render.
- *
- * The snapshot is only present if {@link getSnapshotBeforeUpdate} is present and returns non-null.
- */
- componentDidUpdate?(prevProps: Readonly
, prevState: Readonly, snapshot?: SS): void;
- }
-
- interface DeprecatedLifecycle
{
- /**
- * Called immediately before mounting occurs, and before {@link Component.render}.
- * Avoid introducing any side-effects or subscriptions in this method.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use {@link ComponentLifecycle.componentDidMount componentDidMount} or the constructor instead; will stop working in React 17
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- componentWillMount?(): void;
- /**
- * Called immediately before mounting occurs, and before {@link Component.render}.
- * Avoid introducing any side-effects or subscriptions in this method.
- *
- * This method will not stop working in React 17.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use {@link ComponentLifecycle.componentDidMount componentDidMount} or the constructor instead
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- UNSAFE_componentWillMount?(): void;
- /**
- * Called when the component may be receiving new props.
- * React may call this even if props have not changed, so be sure to compare new and existing
- * props if you only want to handle changes.
- *
- * Calling {@link Component.setState} generally does not trigger this method.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use static {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} instead; will stop working in React 17
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
- /**
- * Called when the component may be receiving new props.
- * React may call this even if props have not changed, so be sure to compare new and existing
- * props if you only want to handle changes.
- *
- * Calling {@link Component.setState} generally does not trigger this method.
- *
- * This method will not stop working in React 17.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use static {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} instead
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
- /**
- * Called immediately before rendering when new props or state is received. Not called for the initial render.
- *
- * Note: You cannot call {@link Component.setState} here.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
- /**
- * Called immediately before rendering when new props or state is received. Not called for the initial render.
- *
- * Note: You cannot call {@link Component.setState} here.
- *
- * This method will not stop working in React 17.
- *
- * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
- * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
- * this from being invoked.
- *
- * @deprecated 16.3, use getSnapshotBeforeUpdate instead
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
- * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
- */
- UNSAFE_componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
- }
-
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html Mixins Considered Harmful}
- */
- interface Mixin
extends ComponentLifecycle
{
- mixins?: Array> | undefined;
- statics?: {
- [key: string]: any;
- } | undefined;
-
- displayName?: string | undefined;
- propTypes?: ValidationMap | undefined;
- contextTypes?: ValidationMap | undefined;
- childContextTypes?: ValidationMap | undefined;
-
- getDefaultProps?(): P;
- getInitialState?(): S;
- }
-
- /**
- * @deprecated
- *
- * @see {@link https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html Mixins Considered Harmful}
- */
- interface ComponentSpec extends Mixin
{
- render(): ReactNode;
-
- [propertyName: string]: any;
- }
-
- function createRef(): RefObject;
-
- /**
- * The type of the component returned from {@link forwardRef}.
- *
- * @template P The props the component accepts, if any.
- *
- * @see {@link ExoticComponent}
- */
- interface ForwardRefExoticComponent extends NamedExoticComponent
{
- /**
- * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
- */
- defaultProps?: Partial
| undefined;
- propTypes?: WeakValidationMap
| undefined;
- }
-
- /**
- * Lets your component expose a DOM node to a parent component
- * using a ref.
- *
- * @see {@link https://react.dev/reference/react/forwardRef React Docs}
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/ React TypeScript Cheatsheet}
- *
- * @param render See the {@link ForwardRefRenderFunction}.
- *
- * @template T The type of the DOM node.
- * @template P The props the component accepts, if any.
- *
- * @example
- *
- * ```tsx
- * interface Props {
- * children?: ReactNode;
- * type: "submit" | "button";
- * }
- *
- * export const FancyButton = forwardRef((props, ref) => (
- *
- * ));
- * ```
- */
- function forwardRef(
- render: ForwardRefRenderFunction>,
- ): ForwardRefExoticComponent & RefAttributes>;
-
- /**
- * Omits the 'ref' attribute from the given props object.
- *
- * @template P The props object type.
- */
- type PropsWithoutRef =
- // Omit would not be sufficient for this. We'd like to avoid unnecessary mapping and need a distributive conditional to support unions.
- // see: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
- // https://github.com/Microsoft/TypeScript/issues/28339
- P extends any ? ("ref" extends keyof P ? Omit
: P) : P;
- /** Ensures that the props do not include string ref, which cannot be forwarded */
- type PropsWithRef
=
- // Note: String refs can be forwarded. We can't fix this bug without breaking a bunch of libraries now though.
- // Just "P extends { ref?: infer R }" looks sufficient, but R will infer as {} if P is {}.
- "ref" extends keyof P
- ? P extends { ref?: infer R | undefined }
- ? string extends R ? PropsWithoutRef
& { ref?: Exclude | undefined }
- : P
- : P
- : P;
-
- type PropsWithChildren = P & { children?: ReactNode | undefined };
-
- /**
- * Used to retrieve the props a component accepts. Can either be passed a string,
- * indicating a DOM element (e.g. 'div', 'span', etc.) or the type of a React
- * component.
- *
- * It's usually better to use {@link ComponentPropsWithRef} or {@link ComponentPropsWithoutRef}
- * instead of this type, as they let you be explicit about whether or not to include
- * the `ref` prop.
- *
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * // Retrieves the props an 'input' element accepts
- * type InputProps = React.ComponentProps<'input'>;
- * ```
- *
- * @example
- *
- * ```tsx
- * const MyComponent = (props: { foo: number, bar: string }) =>
;
- *
- * // Retrieves the props 'MyComponent' accepts
- * type MyComponentProps = React.ComponentProps;
- * ```
- */
- type ComponentProps> = T extends
- JSXElementConstructor ? P
- : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T]
- : {};
-
- /**
- * Used to retrieve the props a component accepts with its ref. Can either be
- * passed a string, indicating a DOM element (e.g. 'div', 'span', etc.) or the
- * type of a React component.
- *
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * // Retrieves the props an 'input' element accepts
- * type InputProps = React.ComponentPropsWithRef<'input'>;
- * ```
- *
- * @example
- *
- * ```tsx
- * const MyComponent = (props: { foo: number, bar: string }) => ;
- *
- * // Retrieves the props 'MyComponent' accepts
- * type MyComponentPropsWithRef = React.ComponentPropsWithRef;
- * ```
- */
- type ComponentPropsWithRef = T extends (new(props: infer P) => Component)
- ? PropsWithoutRef & RefAttributes>
- : PropsWithRef>;
- /**
- * Used to retrieve the props a custom component accepts with its ref.
- *
- * Unlike {@link ComponentPropsWithRef}, this only works with custom
- * components, i.e. components you define yourself. This is to improve
- * type-checking performance.
- *
- * @example
- *
- * ```tsx
- * const MyComponent = (props: { foo: number, bar: string }) => ;
- *
- * // Retrieves the props 'MyComponent' accepts
- * type MyComponentPropsWithRef = React.CustomComponentPropsWithRef;
- * ```
- */
- type CustomComponentPropsWithRef = T extends (new(props: infer P) => Component)
- ? (PropsWithoutRef & RefAttributes>)
- : T extends ((props: infer P, legacyContext?: any) => ReactNode) ? PropsWithRef
- : never;
-
- /**
- * Used to retrieve the props a component accepts without its ref. Can either be
- * passed a string, indicating a DOM element (e.g. 'div', 'span', etc.) or the
- * type of a React component.
- *
- * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
- *
- * @example
- *
- * ```tsx
- * // Retrieves the props an 'input' element accepts
- * type InputProps = React.ComponentPropsWithoutRef<'input'>;
- * ```
- *
- * @example
- *
- * ```tsx
- * const MyComponent = (props: { foo: number, bar: string }) =>
;
- *
- * // Retrieves the props 'MyComponent' accepts
- * type MyComponentPropsWithoutRef = React.ComponentPropsWithoutRef;
- * ```
- */
- type ComponentPropsWithoutRef = PropsWithoutRef>;
-
- type ComponentRef = T extends NamedExoticComponent<
- ComponentPropsWithoutRef & RefAttributes
- > ? Method
- : ComponentPropsWithRef extends RefAttributes ? Method
- : never;
-
- // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
- // but can be given its own specific name
- type MemoExoticComponent> = NamedExoticComponent> & {
- readonly type: T;
- };
-
- /**
- * Lets you skip re-rendering a component when its props are unchanged.
- *
- * @see {@link https://react.dev/reference/react/memo React Docs}
- *
- * @param Component The component to memoize.
- * @param propsAreEqual A function that will be used to determine if the props have changed.
- *
- * @example
- *
- * ```tsx
- * import { memo } from 'react';
- *
- * const SomeComponent = memo(function SomeComponent(props: { foo: string }) {
- * // ...
- * });
- * ```
- */
- function memo