rimiti / react-native-toastify

:iphone: React Native cross-plateform (iOS / Android) Toast component highly customizable.
MIT License
33 stars 9 forks source link

Typescript definitions #6

Closed jsamr closed 5 years ago

jsamr commented 5 years ago

Quick definitions for anyone interested:

EDIT: Definitions merged from PR #7

declare module '@rimiti/react-native-toastify' {
  import { Component } from 'react'
  import { ViewProps, StyleProp } from 'react-native'
  namespace Toast {
    interface ToastProps {
      position?: 'top' | 'center' | 'bottom'
      textStyle?: StyleProp<Text>
      positionValue?: number
      fadeInDuration?: number
      fadeOutDuration?: number
      opacity?: number
      durationShort?: number
      defaultCloseDelay?: number
    }
  }
  class Toast extends Component<Toast.ToastProps & ViewProps> {
    public show(text: string, duration: number): void
  }
  export = Toast
}
rimiti commented 5 years ago

Thank you @jsamr for your contribution.

Could you create a PR to https://github.com/DefinitelyTyped/DefinitelyTyped with this type definition? It could be very useful for others people. 🚀

jsamr commented 5 years ago

@rimiti Yeah I have written a bunch of definitions for many libraries recently, and I am planning to publish those in DT, for those maintainers who don't wish to have an index.d.ts file in their repo.

Tell me whichever you prefer, I can also publish a PR here.

rimiti commented 5 years ago

Oh nice, you rock! If you can create a PR here, I think it could be better than in DT. 🚀

jsamr commented 5 years ago

@rimiti OK, it's gonna be done tonight !

jsamr commented 5 years ago

@rimiti see PR #7