@cabloy/types-react 19.2.10 → 19.2.11

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.
Files changed (2) hide show
  1. package/index.d.ts +20 -29
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -32,15 +32,6 @@ interface HTMLActionElement {
32
32
  children?: React.ReactNode;
33
33
  }
34
34
 
35
- interface HTMLActionElementBase {
36
- res?: string;
37
- }
38
-
39
- interface HTMLActionViewElement extends HTMLActionElementBase {
40
- resource?: string;
41
- id?: string;
42
- }
43
-
44
35
  /**
45
36
  * Used to represent DOM API's where users can either pass
46
37
  * true or false as a boolean or as its equivalent strings.
@@ -324,8 +315,10 @@ declare namespace React {
324
315
  /**
325
316
  * @deprecated
326
317
  */
327
- interface ReactComponentElement<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>, P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>>
328
- extends ReactElement<P, Exclude<T, number>> {}
318
+ interface ReactComponentElement<
319
+ T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
320
+ P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
321
+ > extends ReactElement<P, Exclude<T, number>> {}
329
322
 
330
323
  /**
331
324
  * @deprecated Use `ReactElement<P, React.FunctionComponent<P>>`
@@ -1378,11 +1371,8 @@ declare namespace React {
1378
1371
  * type MyComponentProps = React.ComponentProps<typeof MyComponent>;
1379
1372
  * ```
1380
1373
  */
1381
- type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = T extends JSXElementConstructor<infer Props>
1382
- ? Props
1383
- : T extends keyof JSX.IntrinsicElements
1384
- ? JSX.IntrinsicElements[T]
1385
- : {};
1374
+ type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =
1375
+ T extends JSXElementConstructor<infer Props> ? Props : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : {};
1386
1376
 
1387
1377
  /**
1388
1378
  * Used to retrieve the props a component accepts with its ref. Can either be
@@ -1407,12 +1397,13 @@ declare namespace React {
1407
1397
  * type MyComponentPropsWithRef = React.ComponentPropsWithRef<typeof MyComponent>;
1408
1398
  * ```
1409
1399
  */
1410
- type ComponentPropsWithRef<T extends ElementType> = T extends JSXElementConstructor<infer Props>
1411
- ? // If it's a class i.e. newable we're dealing with a class component
1412
- T extends abstract new (args: any) => any
1413
- ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1414
- : Props
1415
- : ComponentProps<T>;
1400
+ type ComponentPropsWithRef<T extends ElementType> =
1401
+ T extends JSXElementConstructor<infer Props>
1402
+ ? // If it's a class i.e. newable we're dealing with a class component
1403
+ T extends abstract new (args: any) => any
1404
+ ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1405
+ : Props
1406
+ : ComponentProps<T>;
1416
1407
  /**
1417
1408
  * Used to retrieve the props a custom component accepts with its ref.
1418
1409
  *
@@ -1429,12 +1420,13 @@ declare namespace React {
1429
1420
  * type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;
1430
1421
  * ```
1431
1422
  */
1432
- type CustomComponentPropsWithRef<T extends ComponentType> = T extends JSXElementConstructor<infer Props>
1433
- ? // If it's a class i.e. newable we're dealing with a class component
1434
- T extends abstract new (args: any) => any
1435
- ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1436
- : Props
1437
- : never;
1423
+ type CustomComponentPropsWithRef<T extends ComponentType> =
1424
+ T extends JSXElementConstructor<infer Props>
1425
+ ? // If it's a class i.e. newable we're dealing with a class component
1426
+ T extends abstract new (args: any) => any
1427
+ ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1428
+ : Props
1429
+ : never;
1438
1430
 
1439
1431
  /**
1440
1432
  * Used to retrieve the props a component accepts without its ref. Can either be
@@ -3969,7 +3961,6 @@ declare namespace React {
3969
3961
  // var: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3970
3962
  var: HTMLVarElement;
3971
3963
  action: HTMLActionElement;
3972
- actionView: HTMLActionViewElement;
3973
3964
  a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
3974
3965
  abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3975
3966
  address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/types-react",
3
- "version": "19.2.10",
3
+ "version": "19.2.11",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",