GeorgeHop / react-native-screens-swiper

:point_right: Screens swiper lib. fully cross platform(IOS, Android) created for building best UI in your app. swipeable navigation, user profile(like instagram), and many more. :point_left: Just take and try. :v:
https://github.com/GeorgeHop/react-native-screens-swiper
MIT License
19 stars 4 forks source link

[ENHANCE] TypeScript compatibility 🧪 #1

Open anthlasserre opened 3 years ago

anthlasserre commented 3 years ago

Hey @GeorgeHop and @dorkyboi congrats and thanks for this good work 💪🏼 I am using your library on a React Native TypeScript project. I needed to type your library to enhance my project.

Can you confirm or update some types that can not be good ? I plan to enhance your library with a new PR with it.

Thank you so much, Cheers

declare module 'react-native-screens-swiper' {
  import React, { ComponentProps } from 'react';
  import { FlatListProps, TextStyle, ViewStyle } from 'react-native';

  export interface SwiperDataType {
    tabLabel: string;
    component: React.ReactNode;
    props?: ComponentProps;
  }

  export interface SwiperStyle {
    pillContainer?: ViewStyle;
    pillButton?: ViewStyle;
    pillActive?: ViewStyle;
    pillLabel?: TextStyle;
    activeLabel?: TextStyle;
    borderActive?: ViewStyle;
    pillsOverflow?: ViewStyle;
  }

  export interface SwiperProps extends FlatListProps {
    style?: SwiperStyle;
    data: SwiperDataType[];
    isStaticPills?: boolean;
    stickyHeaderEnabled?: boolean;
    scrollableContainer?: boolean;
    stickyHeaderIndex?: number;
  }

  export default class Swiper extends React.Component<SwiperProps, any> {}
}
GeorgeHop commented 3 years ago

Hi ! I think it will be great :) How I see everything is fine, so you can make the PR.

dorkyboi commented 3 years ago

Hi @anthlasserre,

thank you for your interest in our library, it really means alot to us that people are using what we made :) I went through your types, everything seems to check out. Feel free to submit a PR and we'll release a new version as soon as possible.

Cheers!

GeorgeHop commented 2 years ago

Hi @ansar-imam I created other issue for this bug. Let's continue there.