@cabloy/types-react 19.2.9 → 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.
- package/global.d.ts +0 -5
- package/index.d.ts +32 -24
- package/package.json +1 -1
package/global.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ type NativeTransitionEvent = TransitionEvent;
|
|
|
21
21
|
type NativeUIEvent = UIEvent;
|
|
22
22
|
type NativeWheelEvent = WheelEvent;
|
|
23
23
|
|
|
24
|
+
interface HTMLVarElement {
|
|
25
|
+
name: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
interface HTMLActionElement {
|
|
25
30
|
stop?: boolean;
|
|
26
31
|
prevent?: boolean;
|
|
@@ -310,8 +315,10 @@ declare namespace React {
|
|
|
310
315
|
/**
|
|
311
316
|
* @deprecated
|
|
312
317
|
*/
|
|
313
|
-
interface ReactComponentElement<
|
|
314
|
-
extends
|
|
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>> {}
|
|
315
322
|
|
|
316
323
|
/**
|
|
317
324
|
* @deprecated Use `ReactElement<P, React.FunctionComponent<P>>`
|
|
@@ -1364,11 +1371,8 @@ declare namespace React {
|
|
|
1364
1371
|
* type MyComponentProps = React.ComponentProps<typeof MyComponent>;
|
|
1365
1372
|
* ```
|
|
1366
1373
|
*/
|
|
1367
|
-
type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =
|
|
1368
|
-
? Props
|
|
1369
|
-
: T extends keyof JSX.IntrinsicElements
|
|
1370
|
-
? JSX.IntrinsicElements[T]
|
|
1371
|
-
: {};
|
|
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] : {};
|
|
1372
1376
|
|
|
1373
1377
|
/**
|
|
1374
1378
|
* Used to retrieve the props a component accepts with its ref. Can either be
|
|
@@ -1393,12 +1397,13 @@ declare namespace React {
|
|
|
1393
1397
|
* type MyComponentPropsWithRef = React.ComponentPropsWithRef<typeof MyComponent>;
|
|
1394
1398
|
* ```
|
|
1395
1399
|
*/
|
|
1396
|
-
type ComponentPropsWithRef<T extends ElementType> =
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
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>;
|
|
1402
1407
|
/**
|
|
1403
1408
|
* Used to retrieve the props a custom component accepts with its ref.
|
|
1404
1409
|
*
|
|
@@ -1415,12 +1420,13 @@ declare namespace React {
|
|
|
1415
1420
|
* type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;
|
|
1416
1421
|
* ```
|
|
1417
1422
|
*/
|
|
1418
|
-
type CustomComponentPropsWithRef<T extends ComponentType> =
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
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;
|
|
1424
1430
|
|
|
1425
1431
|
/**
|
|
1426
1432
|
* Used to retrieve the props a component accepts without its ref. Can either be
|
|
@@ -3811,10 +3817,12 @@ declare namespace React {
|
|
|
3811
3817
|
| "track"
|
|
3812
3818
|
| "u"
|
|
3813
3819
|
| "ul"
|
|
3814
|
-
| "var"
|
|
3815
3820
|
| "video"
|
|
3816
3821
|
| "wbr"
|
|
3817
|
-
| "webview"
|
|
3822
|
+
| "webview"
|
|
3823
|
+
| "var"
|
|
3824
|
+
| "action"
|
|
3825
|
+
| "actionView";
|
|
3818
3826
|
|
|
3819
3827
|
// TODO: Move to react-dom
|
|
3820
3828
|
type SVGElementType =
|
|
@@ -3950,6 +3958,9 @@ declare namespace React {
|
|
|
3950
3958
|
|
|
3951
3959
|
interface IntrinsicElements {
|
|
3952
3960
|
// HTML
|
|
3961
|
+
// var: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
3962
|
+
var: HTMLVarElement;
|
|
3963
|
+
action: HTMLActionElement;
|
|
3953
3964
|
a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
3954
3965
|
abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
3955
3966
|
address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
@@ -4065,9 +4076,6 @@ declare namespace React {
|
|
|
4065
4076
|
track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
|
|
4066
4077
|
u: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
4067
4078
|
ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
|
|
4068
|
-
// var: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
4069
|
-
var: HTMLVarElement;
|
|
4070
|
-
action: HTMLActionElement;
|
|
4071
4079
|
video: React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
4072
4080
|
wbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
4073
4081
|
webview: React.DetailedHTMLProps<React.WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
|
package/package.json
CHANGED