Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCE] TypeScript compatibility 馃И #1

Open
anthlasserre opened this issue Jun 3, 2021 · 3 comments
Open

[ENHANCE] TypeScript compatibility 馃И #1

anthlasserre opened this issue Jun 3, 2021 · 3 comments

Comments

@anthlasserre
Copy link

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
Copy link
Owner

GeorgeHop commented Jun 3, 2021

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

@dorkyboi
Copy link
Collaborator

dorkyboi commented Jun 4, 2021

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
Copy link
Owner

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

Repository owner deleted a comment from ansar-imam Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants