diff --git a/ios/RNPitchySpec.h b/ios/RNPitchySpec.h new file mode 100644 index 0000000..61f1dfa --- /dev/null +++ b/ios/RNPitchySpec.h @@ -0,0 +1,37 @@ +#ifdef __cplusplus +#pragma once +#endif + +#import +#import + +/** + * Spec protocol for the Pitchy native module. + * This protocol defines the interface for the React Native JavaScript code to interact with. + */ +@protocol NativePitchySpec + +/** + * Initialize the audio engine with the provided configuration. + */ +- (void)init:(NSDictionary *)config; + +/** + * Start pitch detection. + */ +- (void)start:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +/** + * Stop pitch detection. + */ +- (void)stop:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +/** + * Query if pitch detection is currently active. + */ +- (void)isRecording:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end