react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

getAudioRoutes definition returns Promise<void>, but should return Promise<AudioRoute[]>

Open scarletcs opened this issue 2 years ago • 0 comments

Bug report

  • [x] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [x] Android

  • [x] iOS

Above are essentially N/A, this is a definitions bug that is reflected in the code editor.

Description

index.d.ts currently lists getAudioRoutes() as returning Promise<void>. The readme suggests it should be returning Promise<AudioRoute[]>, correlated by the Java module.

Using getAudioRoutes thus requires a cast of getAudioRoutes() as unknown as Promise<AudioRoute[]> or similar.

The problematic line is located here:

https://github.com/react-native-webrtc/react-native-callkeep/blob/cc308ce2ed33bcc12ef1ef95468f4a81de7d6d4e/index.d.ts#L225

This appears to have been broken in this change: https://github.com/react-native-webrtc/react-native-callkeep/commit/0cba24edc969241dceee2ac2ea2817ceefe6d927#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8

Steps to Reproduce

Use getAudioRoutes() in your code editor.

Versions

- Callkeep: 4.3.12
- React Native: N/A
- iOS: N/A
- Android: N/A
- Phone model: N/A 

Logs

N/A

scarletcs avatar Nov 16 '23 12:11 scarletcs