react-native-screens-swiper icon indicating copy to clipboard operation
react-native-screens-swiper copied to clipboard

[ENHANCE] TypeScript compatibility 🧪

Open anthlasserre opened this issue 3 years ago • 3 comments

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> {}
}

anthlasserre avatar Jun 03 '21 14:06 anthlasserre

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

GeorgeHop avatar Jun 03 '21 19:06 GeorgeHop

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!

dorkyboi avatar Jun 04 '21 07:06 dorkyboi

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

GeorgeHop avatar Oct 01 '21 14:10 GeorgeHop