@types/react
Advanced tools
| /** | ||
| * These are types for things that are present in the React `next` 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/next"` 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/next' | ||
| * ``` | ||
| * | ||
| * It is also possible to include it through a triple-slash reference: | ||
| * | ||
| * ```ts | ||
| * /// <reference types="react/next" /> | ||
| * ``` | ||
| * | ||
| * 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 module '.' { | ||
| interface ThenableImpl<T> { | ||
| then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>; | ||
| } | ||
| interface UntrackedThenable<T> extends ThenableImpl<T> { | ||
| status?: void; | ||
| } | ||
| export interface PendingThenable<T> extends ThenableImpl<T> { | ||
| status: 'pending'; | ||
| } | ||
| export interface FulfilledThenable<T> extends ThenableImpl<T> { | ||
| status: 'fulfilled'; | ||
| value: T; | ||
| } | ||
| export interface RejectedThenable<T> extends ThenableImpl<T> { | ||
| status: 'rejected'; | ||
| reason: unknown; | ||
| } | ||
| export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>; | ||
| export type Usable<T> = Thenable<T> | Context<T>; | ||
| export function use<T>(usable: Usable<T>): T; | ||
| interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONValue> {} | ||
| export type ServerContextJSONValue = | ||
| | string | ||
| | boolean | ||
| | number | ||
| | null | ||
| | ServerContextJSONArray | ||
| | { [key: string]: ServerContextJSONValue }; | ||
| export interface ServerContext<T extends ServerContextJSONValue> { | ||
| Provider: Provider<T>; | ||
| } | ||
| /** | ||
| * 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<T extends ServerContextJSONValue>(context: ServerContext<T>): T; | ||
| export function createServerContext<T extends ServerContextJSONValue>( | ||
| globalName: string, | ||
| defaultValue: T, | ||
| ): ServerContext<T>; | ||
| // tslint:disable-next-line ban-types | ||
| export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction; | ||
| export function unstable_useCacheRefresh(): () => void; | ||
| } |
| /** | ||
| * 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 | ||
| * /// <reference types="react/experimental" /> | ||
| * ``` | ||
| * | ||
| * 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('./next'); | ||
| export {}; | ||
| 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 `<React.Fragment>`. | ||
| */ | ||
| children: ReactElement | Iterable<ReactElement>; | ||
| } | ||
| 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<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']> | 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 SuspenseList: ExoticComponent<SuspenseListProps>; | ||
| // tslint:disable-next-line ban-types | ||
| export function experimental_useEffectEvent<T extends Function>(event: T): T; | ||
| } |
| /* | ||
| 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 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 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 Text { } | ||
| interface TouchList { } | ||
| interface WebGLRenderingContext { } | ||
| interface WebGL2RenderingContext { } | ||
| interface TrustedHTML { } |
Sorry, the diff of this file is too big to display
| // Expose `JSX` namespace in `global` namespace | ||
| import './'; |
| // Expose `JSX` namespace in `global` namespace | ||
| import './'; |
| /** | ||
| * These are types for things that are present in the React `next` 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/next"` 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/next' | ||
| * ``` | ||
| * | ||
| * It is also possible to include it through a triple-slash reference: | ||
| * | ||
| * ```ts | ||
| * /// <reference types="react/next" /> | ||
| * ``` | ||
| * | ||
| * 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 module '.' { | ||
| interface ThenableImpl<T> { | ||
| then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>; | ||
| } | ||
| interface UntrackedThenable<T> extends ThenableImpl<T> { | ||
| status?: void; | ||
| } | ||
| export interface PendingThenable<T> extends ThenableImpl<T> { | ||
| status: 'pending'; | ||
| } | ||
| export interface FulfilledThenable<T> extends ThenableImpl<T> { | ||
| status: 'fulfilled'; | ||
| value: T; | ||
| } | ||
| export interface RejectedThenable<T> extends ThenableImpl<T> { | ||
| status: 'rejected'; | ||
| reason: unknown; | ||
| } | ||
| export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>; | ||
| export type Usable<T> = Thenable<T> | Context<T>; | ||
| export function use<T>(usable: Usable<T>): T; | ||
| interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONValue> {} | ||
| export type ServerContextJSONValue = | ||
| | string | ||
| | boolean | ||
| | number | ||
| | null | ||
| | ServerContextJSONArray | ||
| | { [key: string]: ServerContextJSONValue }; | ||
| export interface ServerContext<T extends ServerContextJSONValue> { | ||
| Provider: Provider<T>; | ||
| } | ||
| /** | ||
| * 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<T extends ServerContextJSONValue>(context: ServerContext<T>): T; | ||
| export function createServerContext<T extends ServerContextJSONValue>( | ||
| globalName: string, | ||
| defaultValue: T, | ||
| ): ServerContext<T>; | ||
| // tslint:disable-next-line ban-types | ||
| export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction; | ||
| export function unstable_useCacheRefresh(): () => void; | ||
| } |
+10
-90
@@ -37,9 +37,6 @@ /** | ||
| import React = require('.'); | ||
| import React = require('./next'); | ||
| export {}; | ||
| declare const UNDEFINED_VOID_ONLY: unique symbol; | ||
| type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never }; | ||
| declare module '.' { | ||
@@ -52,3 +49,3 @@ export interface SuspenseProps { | ||
| */ | ||
| unstable_expectedLoadTime?: number; | ||
| unstable_expectedLoadTime?: number | undefined; | ||
| } | ||
@@ -82,3 +79,3 @@ | ||
| */ | ||
| tail?: SuspenseListTailMode; | ||
| tail?: SuspenseListTailMode | undefined; | ||
| } | ||
@@ -90,7 +87,7 @@ | ||
| */ | ||
| revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']>; | ||
| revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']> | undefined; | ||
| /** | ||
| * The tail property is invalid when not using the `forwards` or `backwards` reveal orders. | ||
| */ | ||
| tail?: never; | ||
| tail?: never | undefined; | ||
| } | ||
@@ -111,87 +108,10 @@ | ||
| */ | ||
| export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>; | ||
| export const SuspenseList: ExoticComponent<SuspenseListProps>; | ||
| export interface SuspenseConfig { | ||
| busyDelayMs?: number; | ||
| busyMinDurationMs?: number; | ||
| } | ||
| // tslint:disable-next-line ban-types | ||
| export function experimental_useEffectEvent<T extends Function>(event: T): T; | ||
| // undocumented, considered for removal | ||
| export function unstable_withSuspenseConfig( | ||
| scope: () => VoidOrUndefinedOnly, | ||
| config: SuspenseConfig | null | undefined, | ||
| ): void; | ||
| // must be synchronous | ||
| export type TransitionFunction = () => VoidOrUndefinedOnly; | ||
| // strange definition to allow vscode to show documentation on the invocation | ||
| export interface TransitionStartFunction { | ||
| /** | ||
| * State updates caused inside the callback are allowed to be deferred. | ||
| * | ||
| * **If some state update causes a component to suspend, that state update should be wrapped in a transition.** | ||
| * | ||
| * @param callback A _synchronous_ function which causes state updates that can be deferred. | ||
| */ | ||
| (callback: TransitionFunction): void; | ||
| interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS { | ||
| functions: (formData: FormData) => void; | ||
| } | ||
| /** | ||
| * Returns a deferred version of the value that may “lag behind” it for at most `timeoutMs`. | ||
| * | ||
| * This is commonly used to keep the interface responsive when you have something that renders immediately | ||
| * based on user input and something that needs to wait for a data fetch. | ||
| * | ||
| * A good example of this is a text input. | ||
| * | ||
| * @param value The value that is going to be deferred | ||
| * | ||
| * @see https://reactjs.org/docs/concurrent-mode-reference.html#usedeferredvalue | ||
| */ | ||
| export function unstable_useDeferredValue<T>(value: T): T; | ||
| /** | ||
| * Allows components to avoid undesirable loading states by waiting for content to load | ||
| * before transitioning to the next screen. It also allows components to defer slower, | ||
| * data fetching updates until subsequent renders so that more crucial updates can be | ||
| * rendered immediately. | ||
| * | ||
| * The `useTransition` hook returns two values in an array. | ||
| * | ||
| * The first is a function that takes a callback. We can use it to tell React which state we want to defer. | ||
| * The seconda boolean. It’s React’s way of informing us whether we’re waiting for the transition to finish. | ||
| * | ||
| * **If some state update causes a component to suspend, that state update should be wrapped in a transition.** | ||
| * | ||
| * @param config An optional object with `timeoutMs` | ||
| * | ||
| * @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition | ||
| */ | ||
| export function unstable_useTransition(config?: SuspenseConfig | null): [TransitionStartFunction, boolean]; | ||
| const opaqueIdentifierBranding: unique symbol; | ||
| /** | ||
| * WARNING: Don't use this as a `string`. | ||
| * | ||
| * This is an opaque type that is not supposed to type-check structurally. | ||
| * It is only valid if returned from React methods and passed to React e.g. `<button aria-labelledby={opaqueIdentifier} />` | ||
| */ | ||
| // We can't create a type that would be rejected for string concatenation or `.toString()` calls. | ||
| // So in order to not have to add `string | OpaqueIdentifier` to every react-dom host prop we intersect it with `string`. | ||
| type OpaqueIdentifier = string & { | ||
| readonly [opaqueIdentifierBranding]: unknown; | ||
| // While this would cause `const stringified: string = opaqueIdentifier.toString()` to not type-check it also adds completions while typing. | ||
| // It would also still allow string concatenation. | ||
| // Unsure which is better. Not type-checking or not suggesting. | ||
| // toString(): void; | ||
| }; | ||
| export function unstable_useOpaqueIdentifier(): OpaqueIdentifier; | ||
| /** | ||
| * Similar to `useTransition` but allows uses where hooks are not available. | ||
| * | ||
| * @param callback A _synchronous_ function which causes state updates that can be deferred. | ||
| */ | ||
| export function unstable_startTransition(scope: TransitionFunction): void; | ||
| } |
@@ -43,2 +43,3 @@ /* | ||
| interface HTMLDataListElement extends HTMLElement { } | ||
| interface HTMLDetailsElement extends HTMLElement { } | ||
| interface HTMLDialogElement extends HTMLElement { } | ||
@@ -64,2 +65,3 @@ interface HTMLDivElement extends HTMLElement { } | ||
| interface HTMLMetaElement extends HTMLElement { } | ||
| interface HTMLMeterElement extends HTMLElement { } | ||
| interface HTMLObjectElement extends HTMLElement { } | ||
@@ -69,2 +71,3 @@ interface HTMLOListElement extends HTMLElement { } | ||
| interface HTMLOptionElement extends HTMLElement { } | ||
| interface HTMLOutputElement extends HTMLElement { } | ||
| interface HTMLParagraphElement extends HTMLElement { } | ||
@@ -89,2 +92,3 @@ interface HTMLParamElement extends HTMLElement { } | ||
| interface HTMLTextAreaElement extends HTMLElement { } | ||
| interface HTMLTimeElement extends HTMLElement { } | ||
| interface HTMLTitleElement extends HTMLElement { } | ||
@@ -152,2 +156,3 @@ interface HTMLTrackElement extends HTMLElement { } | ||
| interface FormData {} | ||
| interface Text { } | ||
@@ -157,1 +162,3 @@ interface TouchList { } | ||
| interface WebGL2RenderingContext { } | ||
| interface TrustedHTML { } |
+65
-8
| { | ||
| "name": "@types/react", | ||
| "version": "17.0.2", | ||
| "version": "18.2.0", | ||
| "description": "TypeScript definitions for React", | ||
| "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react", | ||
| "license": "MIT", | ||
@@ -35,7 +36,2 @@ "contributors": [ | ||
| { | ||
| "name": "Digiguru", | ||
| "url": "https://github.com/digiguru", | ||
| "githubUsername": "digiguru" | ||
| }, | ||
| { | ||
| "name": "Eric Anderson", | ||
@@ -134,2 +130,12 @@ "url": "https://github.com/ericanderson", | ||
| "githubUsername": "hellatan" | ||
| }, | ||
| { | ||
| "name": "Priyanshu Rav", | ||
| "url": "https://github.com/priyanshurav", | ||
| "githubUsername": "priyanshurav" | ||
| }, | ||
| { | ||
| "name": "Dmitry Semigradsky", | ||
| "url": "https://github.com/Semigradsky", | ||
| "githubUsername": "Semigradsky" | ||
| } | ||
@@ -139,2 +145,9 @@ ], | ||
| "types": "index.d.ts", | ||
| "typesVersions": { | ||
| "<=5.0": { | ||
| "*": [ | ||
| "ts5.0/*" | ||
| ] | ||
| } | ||
| }, | ||
| "repository": { | ||
@@ -148,6 +161,50 @@ "type": "git", | ||
| "@types/prop-types": "*", | ||
| "@types/scheduler": "*", | ||
| "csstype": "^3.0.2" | ||
| }, | ||
| "typesPublisherContentHash": "b4bc71e5ae8e6467bc315f57f8e7b98e248d5994ecaaf51bd4e674de77bfb6fc", | ||
| "typeScriptVersion": "3.4" | ||
| "typesPublisherContentHash": "78b0fe3f6c82d6b1f8f2da8f144be25ae0b224a58c8404ea721caac2ca4e6fd8", | ||
| "typeScriptVersion": "4.3", | ||
| "exports": { | ||
| ".": { | ||
| "types@<=5.0": { | ||
| "default": "./ts5.0/index.d.ts" | ||
| }, | ||
| "types": { | ||
| "default": "./index.d.ts" | ||
| } | ||
| }, | ||
| "./next": { | ||
| "types@<=5.0": { | ||
| "default": "./ts5.0/next.d.ts" | ||
| }, | ||
| "types": { | ||
| "default": "./next.d.ts" | ||
| } | ||
| }, | ||
| "./experimental": { | ||
| "types@<=5.0": { | ||
| "default": "./ts5.0/experimental.d.ts" | ||
| }, | ||
| "types": { | ||
| "default": "./experimental.d.ts" | ||
| } | ||
| }, | ||
| "./jsx-runtime": { | ||
| "types@<=5.0": { | ||
| "default": "./ts5.0/jsx-runtime.d.ts" | ||
| }, | ||
| "types": { | ||
| "default": "./jsx-runtime.d.ts" | ||
| } | ||
| }, | ||
| "./jsx-dev-runtime": { | ||
| "types@<=5.0": { | ||
| "default": "./ts5.0/jsx-dev-runtime.d.ts" | ||
| }, | ||
| "types": { | ||
| "default": "./jsx-dev-runtime.d.ts" | ||
| } | ||
| }, | ||
| "./package.json": "./package.json" | ||
| } | ||
| } |
+4
-4
@@ -5,3 +5,3 @@ # Installation | ||
| # Summary | ||
| This package contains type definitions for React (http://facebook.github.io/react/). | ||
| This package contains type definitions for React (https://react.dev/). | ||
@@ -12,7 +12,7 @@ # Details | ||
| ### Additional Details | ||
| * Last updated: Fri, 12 Feb 2021 18:02:47 GMT | ||
| * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types) | ||
| * Last updated: Tue, 25 Apr 2023 10:32:40 GMT | ||
| * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler) | ||
| * Global values: `React` | ||
| # 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), [Digiguru](https://github.com/digiguru), [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), and [Dale Tan](https://github.com/hellatan). | ||
| 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), [Dale Tan](https://github.com/hellatan), [Priyanshu Rav](https://github.com/priyanshurav), and [Dmitry Semigradsky](https://github.com/Semigradsky). |
Sorry, the diff of this file is too big to display
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
348390
116.73%15
87.5%6782
109%0
-100%3
50%+ Added
+ Added