ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
603 stars 154 forks source link

"declare const Tts = new ReactNativeTts()" gives TypeScript error "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference." #172

Closed ngocdaothanh closed 3 years ago

ngocdaothanh commented 3 years ago

Line 80 of https://github.com/ak1394/react-native-tts/blob/master/index.d.ts

declare const Tts = new ReactNativeTts();

gives error:

A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

TypeScript: 4.2.2

ngocdaothanh commented 3 years ago

I think the fix is changing the code to:

declare const Tts: ReactNativeTts;
ak1394 commented 3 years ago

Thanks! It should be fixed in 4.0.0 release.