Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions types/brainhubeu__react-carousel/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"@typescript-eslint/no-empty-interface": "off"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Carousel, {
clickToChangePlugin,
Dots,
fastSwipePlugin,
type ImgProps,
infinitePlugin,
rtlPlugin,
slidesToScrollPlugin,
Expand All @@ -18,7 +19,7 @@ interface MyCarouselProps {

interface MyCarouselState {
value: number;
slides: Array<React.ReactComponentElement<"img">>;
slides: ImgProps[];
}

class MyCarousel extends React.Component<MyCarouselProps, MyCarouselState> {
Expand Down
9 changes: 8 additions & 1 deletion types/brainhubeu__react-carousel/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
export type ImgProps = React.ReactComponentElement<"img">;
export type ImgProps = ReactComponentElement<"img">;

export interface DotsProps {
number?: number | undefined;
Expand Down Expand Up @@ -68,3 +68,10 @@ export const centeredPlugin: CarouselPluginFunc;
export const slidesToScrollPlugin: CarouselPluginFunc;
export const arrowsPlugin: CarouselPluginFunc;
export const fastSwipePlugin: CarouselPluginFunc;

interface ReactComponentElement<
T extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<any>,
P = Pick<React.ComponentProps<T>, Exclude<keyof React.ComponentProps<T>, "key" | "ref">>,
> extends React.ReactElement<P, Exclude<T, number>> {}

export {};
3 changes: 3 additions & 0 deletions types/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ declare namespace React {
key: string | null;
}

/**
* @deprecated
*/
interface ReactComponentElement<
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
Expand Down
3 changes: 3 additions & 0 deletions types/react/ts5.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ declare namespace React {
key: string | null;
}

/**
* @deprecated
*/
interface ReactComponentElement<
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
Expand Down