@types/react 18.2.67 → 18.2.69

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/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for react (https://react.dev/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 18 Mar 2024 13:07:15 GMT
11
+ * Last updated: Fri, 22 Mar 2024 19:35:52 GMT
12
12
  * Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler), [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/canary.d.ts CHANGED
@@ -109,4 +109,8 @@ declare module "." {
109
109
  passthrough: State,
110
110
  reducer: (state: State, action: Action) => State,
111
111
  ): [State, (action: Action) => void];
112
+
113
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
114
+ cleanup: () => VoidOrUndefinedOnly;
115
+ }
112
116
  }
react/index.d.ts CHANGED
@@ -155,6 +155,8 @@ declare namespace React {
155
155
  readonly current: T | null;
156
156
  }
157
157
 
158
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
159
+ }
158
160
  /**
159
161
  * A callback fired whenever the ref's value changes.
160
162
  *
@@ -168,7 +170,15 @@ declare namespace React {
168
170
  * <div ref={(node) => console.log(node)} />
169
171
  * ```
170
172
  */
171
- type RefCallback<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"];
173
+ type RefCallback<T> = {
174
+ bivarianceHack(
175
+ instance: T | null,
176
+ ):
177
+ | void
178
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
179
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
180
+ ];
181
+ }["bivarianceHack"];
172
182
 
173
183
  /**
174
184
  * A union type of all possible shapes for React refs.
@@ -4069,18 +4079,33 @@ declare namespace React {
4069
4079
  // React.PropTypes
4070
4080
  // ----------------------------------------------------------------------
4071
4081
 
4082
+ /**
4083
+ * @deprecated Use `Validator` from the ´prop-types` instead.
4084
+ */
4072
4085
  type Validator<T> = PropTypes.Validator<T>;
4073
4086
 
4087
+ /**
4088
+ * @deprecated Use `Requireable` from the ´prop-types` instead.
4089
+ */
4074
4090
  type Requireable<T> = PropTypes.Requireable<T>;
4075
4091
 
4092
+ /**
4093
+ * @deprecated Use `ValidationMap` from the ´prop-types` instead.
4094
+ */
4076
4095
  type ValidationMap<T> = PropTypes.ValidationMap<T>;
4077
4096
 
4097
+ /**
4098
+ * @deprecated Use `WeakValidationMap` from the ´prop-types` instead.
4099
+ */
4078
4100
  type WeakValidationMap<T> = {
4079
4101
  [K in keyof T]?: null extends T[K] ? Validator<T[K] | null | undefined>
4080
4102
  : undefined extends T[K] ? Validator<T[K] | null | undefined>
4081
4103
  : Validator<T[K]>;
4082
4104
  };
4083
4105
 
4106
+ /**
4107
+ * @deprecated Use `PropTypes.*` where `PropTypes` comes from `import * as PropTypes from 'prop-types'` instead.
4108
+ */
4084
4109
  interface ReactPropTypes {
4085
4110
  any: typeof PropTypes.any;
4086
4111
  array: typeof PropTypes.array;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.2.67",
3
+ "version": "18.2.69",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -206,6 +206,6 @@
206
206
  "@types/scheduler": "*",
207
207
  "csstype": "^3.0.2"
208
208
  },
209
- "typesPublisherContentHash": "17d731d67f5490f9b91c951a6bd0f5b6917ba9f6fa4501778391ce4144c9eb13",
209
+ "typesPublisherContentHash": "a5439cab82f6b305cd6e219e60d20a0000468bf15584605d299749f947321ec7",
210
210
  "typeScriptVersion": "4.7"
211
211
  }
react/ts5.0/canary.d.ts CHANGED
@@ -109,4 +109,8 @@ declare module "." {
109
109
  passthrough: State,
110
110
  reducer: (state: State, action: Action) => State,
111
111
  ): [State, (action: Action) => void];
112
+
113
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
114
+ cleanup: () => VoidOrUndefinedOnly;
115
+ }
112
116
  }
react/ts5.0/index.d.ts CHANGED
@@ -155,6 +155,8 @@ declare namespace React {
155
155
  readonly current: T | null;
156
156
  }
157
157
 
158
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
159
+ }
158
160
  /**
159
161
  * A callback fired whenever the ref's value changes.
160
162
  *
@@ -168,7 +170,15 @@ declare namespace React {
168
170
  * <div ref={(node) => console.log(node)} />
169
171
  * ```
170
172
  */
171
- type RefCallback<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"];
173
+ type RefCallback<T> = {
174
+ bivarianceHack(
175
+ instance: T | null,
176
+ ):
177
+ | void
178
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
179
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
180
+ ];
181
+ }["bivarianceHack"];
172
182
 
173
183
  /**
174
184
  * A union type of all possible shapes for React refs.
@@ -4070,18 +4080,33 @@ declare namespace React {
4070
4080
  // React.PropTypes
4071
4081
  // ----------------------------------------------------------------------
4072
4082
 
4083
+ /**
4084
+ * @deprecated Use `Validator` from the ´prop-types` instead.
4085
+ */
4073
4086
  type Validator<T> = PropTypes.Validator<T>;
4074
4087
 
4088
+ /**
4089
+ * @deprecated Use `Requireable` from the ´prop-types` instead.
4090
+ */
4075
4091
  type Requireable<T> = PropTypes.Requireable<T>;
4076
4092
 
4093
+ /**
4094
+ * @deprecated Use `ValidationMap` from the ´prop-types` instead.
4095
+ */
4077
4096
  type ValidationMap<T> = PropTypes.ValidationMap<T>;
4078
4097
 
4098
+ /**
4099
+ * @deprecated Use `WeakValidationMap` from the ´prop-types` instead.
4100
+ */
4079
4101
  type WeakValidationMap<T> = {
4080
4102
  [K in keyof T]?: null extends T[K] ? Validator<T[K] | null | undefined>
4081
4103
  : undefined extends T[K] ? Validator<T[K] | null | undefined>
4082
4104
  : Validator<T[K]>;
4083
4105
  };
4084
4106
 
4107
+ /**
4108
+ * @deprecated Use `PropTypes.*` where `PropTypes` comes from `import * as PropTypes from 'prop-types'` instead.
4109
+ */
4085
4110
  interface ReactPropTypes {
4086
4111
  any: typeof PropTypes.any;
4087
4112
  array: typeof PropTypes.array;