@@ -51,7 +51,8 @@ type ReturnJSType =
5151 | 'ObjectKind'
5252 | 'ArrayKind'
5353 | 'NumberKind'
54- | 'StringKind' ;
54+ | 'StringKind'
55+ | 'ArrayBufferKind' ;
5556
5657export type MethodSerializationOutput = Readonly < {
5758 methodName : string ,
@@ -219,6 +220,9 @@ function getParamObjCType(
219220 */
220221 return notStruct ( wrapOptional ( 'NSArray *' , ! nullable ) ) ;
221222 }
223+ case 'ArrayBufferTypeAnnotation' : {
224+ return notStruct ( wrapOptional ( 'NSMutableData *' , ! nullable ) ) ;
225+ }
222226 }
223227
224228 const [ structTypeAnnotation ] = unwrapNullable (
@@ -388,9 +392,7 @@ function getReturnObjCType(
388392 case 'GenericObjectTypeAnnotation' :
389393 return wrapOptional ( 'NSDictionary *' , isRequired ) ;
390394 case 'ArrayBufferTypeAnnotation' :
391- throw new Error (
392- `Unsupported return type for ${ methodName } : ArrayBuffer is only supported for C++ TurboModules.` ,
393- ) ;
395+ return wrapOptional ( 'NSMutableData *' , isRequired ) ;
394396 default :
395397 typeAnnotation . type as 'MixedTypeAnnotation' ;
396398 throw new Error (
@@ -464,9 +466,7 @@ function getReturnJSType(
464466 throw new Error ( `Unsupported union member types` ) ;
465467 }
466468 case 'ArrayBufferTypeAnnotation' :
467- throw new Error (
468- `Unsupported return type for ${ methodName } : ArrayBuffer is only supported for C++ TurboModules.` ,
469- ) ;
469+ return 'ArrayBufferKind' ;
470470 default :
471471 typeAnnotation . type as 'MixedTypeAnnotation' ;
472472 throw new Error (
0 commit comments