react-native-camera/types
David Castillo 85b6431353
Fixes type of the onStatusChange callback in types/index.d.ts
Currently, the `onStatusChange` has a type of 
```ts
onStatusChange?(event: {
    cameraStatus: CameraStatus;
    recordAudioPermissionStatus: keyof RecordAudioPermissionStatus;
  }): void
```
Which makes it very inconvenient to use with Typescript, having to set the `cameraStatus` field to `any` in the passed function:
```ts
const handleStatusChange = (event: {cameraStatus: any}) => {
    if (event.cameraStatus === 'NOT_AUTHORIZED') {
    }
  }
```
By changing it to
```ts
onStatusChange?(event: {
    cameraStatus: keyof CameraStatus;
    recordAudioPermissionStatus: keyof RecordAudioPermissionStatus;
  }): void
```
we're able to compare the new status against the intended type, autocomplete, and discard the `any`:
```ts

  const handleStatusChange = (event: {cameraStatus: keyof CameraStatus}) => {
    if (event.cameraStatus === 'NOT_AUTHORIZED') {
      onUnauthorized()
    }
  }
```
2019-06-19 12:53:44 -05:00
..
index.d.ts Fixes type of the onStatusChange callback in types/index.d.ts 2019-06-19 12:53:44 -05:00