/** * TurboModule spec for the RNVexo native module (#67). Codegen reads this * file (see codegenConfig in package.json); it mirrors the existing bridge * surface exactly (ios/Vexo/RNVexo.mm, RNVexoModule.java). * * The runtime wrapper (src/vexo/engine/RNVexo.js) still resolves the module * through NativeModules, which works on both architectures (the New * Architecture serves TurboModules through the NativeModules proxy), so old * architecture consumers are unaffected. */ import type { TurboModule } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; // UnsafeObject represents the arbitrary dictionary handed to the native module. It MUST be imported // from CodegenTypes: RN codegen resolves this type by its reference name, so a local // `type UnsafeObject = object` makes codegen see the bare `object` keyword and reject it // (UnsupportedTypeAnnotationParserError: TSObjectKeyword — breaks the native build on every RN // version). The deep path exists across RN 0.74-0.87; this file is codegen input, not shipped types. import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes'; export interface Spec extends TurboModule { // config is handed straight to the closed-source Vexo SDK as a dictionary, // hence UnsafeObject rather than a typed shape. configureWithApiKey( apikey: string, deviceId: string | null, config: UnsafeObject ): Promise; blurImage(imageBase64: string, radius: number): Promise; startBackgroundTask(): Promise; endBackgroundTask(taskId: number): Promise; startRecording(sessionId: string): Promise; stopRecording(): Promise; } export default TurboModuleRegistry.get('RNVexo');