@react-native/codegen 0.87.0-nightly-20260627-1101ef632 → 0.87.0-nightly-20260629-54b88d9de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -122,6 +122,10 @@ function getParamObjCType(hasteModuleName, methodName, param, structName, struct
|
|
|
122
122
|
{
|
|
123
123
|
return notStruct(wrapOptional('NSArray *', !nullable));
|
|
124
124
|
}
|
|
125
|
+
case 'ArrayBufferTypeAnnotation':
|
|
126
|
+
{
|
|
127
|
+
return notStruct(wrapOptional('NSMutableData *', !nullable));
|
|
128
|
+
}
|
|
125
129
|
}
|
|
126
130
|
const [structTypeAnnotation] = unwrapNullable(structCollector.process(structName, 'REGULAR', resolveAlias, wrapNullable(nullable, typeAnnotation)));
|
|
127
131
|
invariant(structTypeAnnotation.type !== 'ArrayTypeAnnotation', 'ArrayTypeAnnotations should have been processed earlier');
|
|
@@ -244,7 +248,7 @@ function getReturnObjCType(methodName, nullableTypeAnnotation) {
|
|
|
244
248
|
case 'GenericObjectTypeAnnotation':
|
|
245
249
|
return wrapOptional('NSDictionary *', isRequired);
|
|
246
250
|
case 'ArrayBufferTypeAnnotation':
|
|
247
|
-
|
|
251
|
+
return wrapOptional('NSMutableData *', isRequired);
|
|
248
252
|
default:
|
|
249
253
|
typeAnnotation.type;
|
|
250
254
|
throw new Error(`Unsupported return type for ${methodName}. Found: ${typeAnnotation.type}`);
|
|
@@ -310,7 +314,7 @@ function getReturnJSType(methodName, nullableTypeAnnotation) {
|
|
|
310
314
|
throw new Error(`Unsupported union member types`);
|
|
311
315
|
}
|
|
312
316
|
case 'ArrayBufferTypeAnnotation':
|
|
313
|
-
|
|
317
|
+
return 'ArrayBufferKind';
|
|
314
318
|
default:
|
|
315
319
|
typeAnnotation.type;
|
|
316
320
|
throw new Error(`Unsupported return type for ${methodName}. Found: ${typeAnnotation.type}`);
|
|
@@ -51,7 +51,8 @@ type ReturnJSType =
|
|
|
51
51
|
| 'ObjectKind'
|
|
52
52
|
| 'ArrayKind'
|
|
53
53
|
| 'NumberKind'
|
|
54
|
-
| 'StringKind'
|
|
54
|
+
| 'StringKind'
|
|
55
|
+
| 'ArrayBufferKind';
|
|
55
56
|
|
|
56
57
|
export type MethodSerializationOutput = Readonly<{
|
|
57
58
|
methodName: string,
|
|
@@ -219,6 +220,9 @@ function getParamObjCType(
|
|
|
219
220
|
*/
|
|
220
221
|
return notStruct(wrapOptional('NSArray *', !nullable));
|
|
221
222
|
}
|
|
223
|
+
case 'ArrayBufferTypeAnnotation': {
|
|
224
|
+
return notStruct(wrapOptional('NSMutableData *', !nullable));
|
|
225
|
+
}
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
const [structTypeAnnotation] = unwrapNullable(
|
|
@@ -388,9 +392,7 @@ function getReturnObjCType(
|
|
|
388
392
|
case 'GenericObjectTypeAnnotation':
|
|
389
393
|
return wrapOptional('NSDictionary *', isRequired);
|
|
390
394
|
case 'ArrayBufferTypeAnnotation':
|
|
391
|
-
|
|
392
|
-
`Unsupported return type for ${methodName}: ArrayBuffer is only supported for C++ TurboModules.`,
|
|
393
|
-
);
|
|
395
|
+
return wrapOptional('NSMutableData *', isRequired);
|
|
394
396
|
default:
|
|
395
397
|
typeAnnotation.type as 'MixedTypeAnnotation';
|
|
396
398
|
throw new Error(
|
|
@@ -464,9 +466,7 @@ function getReturnJSType(
|
|
|
464
466
|
throw new Error(`Unsupported union member types`);
|
|
465
467
|
}
|
|
466
468
|
case 'ArrayBufferTypeAnnotation':
|
|
467
|
-
|
|
468
|
-
`Unsupported return type for ${methodName}: ArrayBuffer is only supported for C++ TurboModules.`,
|
|
469
|
-
);
|
|
469
|
+
return 'ArrayBufferKind';
|
|
470
470
|
default:
|
|
471
471
|
typeAnnotation.type as 'MixedTypeAnnotation';
|
|
472
472
|
throw new Error(
|