LeeKyoungIl/react-native-image-converter

Add TypeScript support

Opened this issue · 2 comments

I figure this will never happen, but in case anyone needed types, here is what works for me

declare module 'react-native-image-converter' {
  interface ConvertArgs {
    path: string
    grayscale?: boolean
    base64?: boolean
    resizeRatio?: number
    imageQuality?: number
  }
  interface ConvertResponse {
    success: boolean
    errorMsg: string
    imageURI: string
    base64String: string
  }
  type ConvertFunction = (params: ConvertArgs) => Promise<ConvertResponse>

  const convert: ConvertFunction

  export { convert }
}

You can add it to https://definitelytyped.org/ :-)

@euZebe Shouldn't the author do this? I didn't realize the community could submit types