/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GenerateModuleObjCpp
 *
 * We create an umbrella header (and corresponding implementation) here since
 * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
 * must have a single output. More files => more genrule()s => slower builds.
 */

#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif

// Avoid multiple includes of RNSpeechSpec symbols
#ifndef RNSpeechSpec_H
#define RNSpeechSpec_H

#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTCxxConvert.h>
#import <React/RCTManagedPointer.h>
#import <ReactCommon/RCTTurboModule.h>
#import <optional>
#import <vector>


NS_ASSUME_NONNULL_BEGIN
namespace JS {
  namespace NativeSpeech {
    struct VoiceOptions {
      NSString *language() const;
      std::optional<double> volume() const;
      NSString *voice() const;
      std::optional<double> pitch() const;
      std::optional<double> rate() const;

      VoiceOptions(NSDictionary *const v) : _v(v) {}
    private:
      NSDictionary *_v;
    };
  }
}

@interface RCTCxxConvert (NativeSpeech_VoiceOptions)
+ (RCTManagedPointer *)JS_NativeSpeech_VoiceOptions:(id)json;
@end
@protocol NativeSpeechSpec <RCTBridgeModule, RCTTurboModule>

- (void)reset;
- (void)stop:(RCTPromiseResolveBlock)resolve
      reject:(RCTPromiseRejectBlock)reject;
- (void)pause:(RCTPromiseResolveBlock)resolve
       reject:(RCTPromiseRejectBlock)reject;
- (void)resume:(RCTPromiseResolveBlock)resolve
        reject:(RCTPromiseRejectBlock)reject;
- (void)isSpeaking:(RCTPromiseResolveBlock)resolve
            reject:(RCTPromiseRejectBlock)reject;
- (void)speak:(NSString *)text
      resolve:(RCTPromiseResolveBlock)resolve
       reject:(RCTPromiseRejectBlock)reject;
- (void)initialize:(JS::NativeSpeech::VoiceOptions &)options;
- (void)getAvailableVoices:(NSString *)language
                   resolve:(RCTPromiseResolveBlock)resolve
                    reject:(RCTPromiseRejectBlock)reject;
- (void)speakWithOptions:(NSString *)text
                 options:(JS::NativeSpeech::VoiceOptions &)options
                 resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject;

@end

@interface NativeSpeechSpecBase : NSObject {
@protected
facebook::react::EventEmitterCallback _eventEmitterCallback;
}
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;

- (void)emitOnError:(NSDictionary *)value;
- (void)emitOnStart:(NSDictionary *)value;
- (void)emitOnFinish:(NSDictionary *)value;
- (void)emitOnPause:(NSDictionary *)value;
- (void)emitOnResume:(NSDictionary *)value;
- (void)emitOnStopped:(NSDictionary *)value;
- (void)emitOnProgress:(NSDictionary *)value;
@end

namespace facebook::react {
  /**
   * ObjC++ class for module 'NativeSpeech'
   */
  class JSI_EXPORT NativeSpeechSpecJSI : public ObjCTurboModule {
  public:
    NativeSpeechSpecJSI(const ObjCTurboModule::InitParams &params);
  };
} // namespace facebook::react
inline NSString *JS::NativeSpeech::VoiceOptions::language() const
{
  id const p = _v[@"language"];
  return RCTBridgingToOptionalString(p);
}
inline std::optional<double> JS::NativeSpeech::VoiceOptions::volume() const
{
  id const p = _v[@"volume"];
  return RCTBridgingToOptionalDouble(p);
}
inline NSString *JS::NativeSpeech::VoiceOptions::voice() const
{
  id const p = _v[@"voice"];
  return RCTBridgingToOptionalString(p);
}
inline std::optional<double> JS::NativeSpeech::VoiceOptions::pitch() const
{
  id const p = _v[@"pitch"];
  return RCTBridgingToOptionalDouble(p);
}
inline std::optional<double> JS::NativeSpeech::VoiceOptions::rate() const
{
  id const p = _v[@"rate"];
  return RCTBridgingToOptionalDouble(p);
}
NS_ASSUME_NONNULL_END
#endif // RNSpeechSpec_H
