nhagen / react-intercom

A component to configure and enable Intercom in your react application
MIT License
237 stars 72 forks source link

Types for IntercomAPI #83

Open LasaleFamine opened 4 years ago

LasaleFamine commented 4 years ago

Hello there, I'm trying to use the module with Typescript and I just saw that there is a missing type for IntercomAPI. Is there any plan to add and export also that types? Thanks for the module BTW!

EDIT: If this can help, here is my current extends of your types:

import * as ReactIntercom from 'react-intercom';

type IntercomActions = 'boot'
| 'shutdown'
| 'hide'
| 'update'
| 'show'
| 'showNewMessage'
| 'showMessages'
| 'onHide'
| 'onShow'
| 'onUnreadCountChange'
| 'trackEvent'
| 'getVisitorId'
| 'startTour'

type IntercomOptions = any;

declare module 'react-intercom' {
  const IntercomAPI: (action: IntercomActions, options?: IntercomOptions) => void;
}
giopetris commented 4 years ago

Any update on this?

alan345 commented 4 years ago

Hello! Any news? Thanks

alan345 commented 4 years ago

Great thanks!