@types/react 18.3.13 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.3.13",
3
+ "version": "19.0.0",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -164,6 +164,11 @@
164
164
  "default": "./canary.d.ts"
165
165
  }
166
166
  },
167
+ "./compiler-runtime": {
168
+ "types": {
169
+ "default": "./compiler-runtime.d.ts"
170
+ }
171
+ },
167
172
  "./experimental": {
168
173
  "types@<=5.0": {
169
174
  "default": "./ts5.0/experimental.d.ts"
@@ -197,10 +202,9 @@
197
202
  },
198
203
  "scripts": {},
199
204
  "dependencies": {
200
- "@types/prop-types": "*",
201
205
  "csstype": "^3.0.2"
202
206
  },
203
207
  "peerDependencies": {},
204
- "typesPublisherContentHash": "0c1b68de2134ad9790e784b950711ed8c266328d5eeffe395e07963c8b58d037",
208
+ "typesPublisherContentHash": "1253101b15ad6f61c7c90cbebe1db819d75a4879f84c016ff343827776b1cf2d",
205
209
  "typeScriptVersion": "5.0"
206
210
  }
react/ts5.0/canary.d.ts CHANGED
@@ -30,137 +30,6 @@ export {};
30
30
  declare const UNDEFINED_VOID_ONLY: unique symbol;
31
31
  type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
32
32
 
33
- type NativeToggleEvent = ToggleEvent;
34
-
35
33
  declare module "." {
36
- export type Usable<T> = PromiseLike<T> | Context<T>;
37
-
38
- export function use<T>(usable: Usable<T>): T;
39
-
40
- interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONValue> {}
41
- export type ServerContextJSONValue =
42
- | string
43
- | boolean
44
- | number
45
- | null
46
- | ServerContextJSONArray
47
- | { [key: string]: ServerContextJSONValue };
48
- export interface ServerContext<T extends ServerContextJSONValue> {
49
- Provider: Provider<T>;
50
- }
51
- /**
52
- * Accepts a context object (the value returned from `React.createContext` or `React.createServerContext`) and returns the current
53
- * context value, as given by the nearest context provider for the given context.
54
- *
55
- * @version 16.8.0
56
- * @see https://react.dev/reference/react/useContext
57
- */
58
- function useContext<T extends ServerContextJSONValue>(context: ServerContext<T>): T;
59
- export function createServerContext<T extends ServerContextJSONValue>(
60
- globalName: string,
61
- defaultValue: T,
62
- ): ServerContext<T>;
63
-
64
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
65
- export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
66
-
67
34
  export function unstable_useCacheRefresh(): () => void;
68
-
69
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {
70
- functions: (formData: FormData) => void | Promise<void>;
71
- }
72
-
73
- export interface TransitionStartFunction {
74
- /**
75
- * Marks all state updates inside the async function as transitions
76
- *
77
- * @see {https://react.dev/reference/react/useTransition#starttransition}
78
- *
79
- * @param callback
80
- */
81
- (callback: () => Promise<VoidOrUndefinedOnly>): void;
82
- }
83
-
84
- /**
85
- * Similar to `useTransition` but allows uses where hooks are not available.
86
- *
87
- * @param callback An _asynchronous_ function which causes state updates that can be deferred.
88
- */
89
- export function startTransition(scope: () => Promise<VoidOrUndefinedOnly>): void;
90
-
91
- export function useOptimistic<State>(
92
- passthrough: State,
93
- ): [State, (action: State | ((pendingState: State) => State)) => void];
94
- export function useOptimistic<State, Action>(
95
- passthrough: State,
96
- reducer: (state: State, action: Action) => State,
97
- ): [State, (action: Action) => void];
98
-
99
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
100
- cleanup: () => VoidOrUndefinedOnly;
101
- }
102
-
103
- export function useActionState<State>(
104
- action: (state: Awaited<State>) => State | Promise<State>,
105
- initialState: Awaited<State>,
106
- permalink?: string,
107
- ): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
108
- export function useActionState<State, Payload>(
109
- action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
110
- initialState: Awaited<State>,
111
- permalink?: string,
112
- ): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
113
-
114
- interface DOMAttributes<T> {
115
- // Transition Events
116
- onTransitionCancel?: TransitionEventHandler<T> | undefined;
117
- onTransitionCancelCapture?: TransitionEventHandler<T> | undefined;
118
- onTransitionRun?: TransitionEventHandler<T> | undefined;
119
- onTransitionRunCapture?: TransitionEventHandler<T> | undefined;
120
- onTransitionStart?: TransitionEventHandler<T> | undefined;
121
- onTransitionStartCapture?: TransitionEventHandler<T> | undefined;
122
- }
123
-
124
- type ToggleEventHandler<T = Element> = EventHandler<ToggleEvent<T>>;
125
-
126
- interface HTMLAttributes<T> {
127
- popover?: "" | "auto" | "manual" | undefined;
128
- popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
129
- popoverTarget?: string | undefined;
130
- onToggle?: ToggleEventHandler<T> | undefined;
131
- onBeforeToggle?: ToggleEventHandler<T> | undefined;
132
- }
133
-
134
- interface ToggleEvent<T = Element> extends SyntheticEvent<T, NativeToggleEvent> {
135
- oldState: "closed" | "open";
136
- newState: "closed" | "open";
137
- }
138
-
139
- interface LinkHTMLAttributes<T> {
140
- precedence?: string | undefined;
141
- }
142
-
143
- interface StyleHTMLAttributes<T> {
144
- href?: string | undefined;
145
- precedence?: string | undefined;
146
- }
147
-
148
- /**
149
- * @internal Use `Awaited<ReactNode>` instead
150
- */
151
- // Helper type to enable `Awaited<ReactNode>`.
152
- // Must be a copy of the non-thenables of `ReactNode`.
153
- type AwaitedReactNode =
154
- | ReactElement
155
- | string
156
- | number
157
- | Iterable<AwaitedReactNode>
158
- | ReactPortal
159
- | boolean
160
- | null
161
- | undefined;
162
- interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {
163
- promises: Promise<AwaitedReactNode>;
164
- bigints: bigint;
165
- }
166
35
  }
@@ -122,11 +122,4 @@ declare module "." {
122
122
  value: TaintableUniqueValue,
123
123
  ): void;
124
124
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
125
-
126
- export interface HTMLAttributes<T> {
127
- /**
128
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
129
- */
130
- inert?: boolean | undefined;
131
- }
132
125
  }