@react-native/codegen 0.81.0-nightly-20250615-98f5a4e11 → 0.81.0-nightly-20250618-ce75271d4

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.
@@ -73,9 +73,9 @@ const ALL_GENERATORS = {
73
73
  generateViewConfigJs: generateViewConfigJs.generate,
74
74
  };
75
75
 
76
- type FilesOutput = Map<string, string>;
76
+ export type FilesOutput = Map<string, string>;
77
77
 
78
- type GenerateFunction = (
78
+ export type GenerateFunction = (
79
79
  libraryName: string,
80
80
  schema: SchemaType,
81
81
  packageName?: string,
@@ -83,11 +83,11 @@ type GenerateFunction = (
83
83
  headerPrefix?: string,
84
84
  ) => FilesOutput;
85
85
 
86
- type LibraryGeneratorsFunctions = $ReadOnly<{
86
+ export type LibraryGeneratorsFunctions = $ReadOnly<{
87
87
  [string]: Array<GenerateFunction>,
88
88
  }>;
89
89
 
90
- type LibraryOptions = $ReadOnly<{
90
+ export type LibraryOptions = $ReadOnly<{
91
91
  libraryName: string,
92
92
  schema: SchemaType,
93
93
  outputDirectory: string,
@@ -97,13 +97,13 @@ type LibraryOptions = $ReadOnly<{
97
97
  libraryGenerators?: LibraryGeneratorsFunctions,
98
98
  }>;
99
99
 
100
- type SchemasOptions = $ReadOnly<{
100
+ export type SchemasOptions = $ReadOnly<{
101
101
  schemas: {[string]: SchemaType},
102
102
  outputDirectory: string,
103
103
  supportedApplePlatforms?: {[string]: {[string]: boolean}},
104
104
  }>;
105
105
 
106
- type LibraryGenerators =
106
+ export type LibraryGenerators =
107
107
  | 'componentsAndroid'
108
108
  | 'componentsIOS'
109
109
  | 'descriptors'
@@ -116,14 +116,14 @@ type LibraryGenerators =
116
116
  | 'modulesCxx'
117
117
  | 'modulesIOS';
118
118
 
119
- type SchemasGenerators = 'providerIOS';
119
+ export type SchemasGenerators = 'providerIOS';
120
120
 
121
- type LibraryConfig = $ReadOnly<{
121
+ export type LibraryConfig = $ReadOnly<{
122
122
  generators: Array<LibraryGenerators>,
123
123
  test?: boolean,
124
124
  }>;
125
125
 
126
- type SchemasConfig = $ReadOnly<{
126
+ export type SchemasConfig = $ReadOnly<{
127
127
  generators: Array<SchemasGenerators>,
128
128
  test?: boolean,
129
129
  }>;
@@ -277,6 +277,7 @@ class FlowParser {
277
277
  if (
278
278
  node.declaration != null &&
279
279
  (node.declaration.type === 'TypeAlias' ||
280
+ node.declaration.type === 'OpaqueType' ||
280
281
  node.declaration.type === 'InterfaceDeclaration')
281
282
  ) {
282
283
  types[node.declaration.id.name] = node.declaration;
@@ -290,6 +291,7 @@ class FlowParser {
290
291
  types[node.declaration.id.name] = node.declaration;
291
292
  } else if (
292
293
  node.type === 'TypeAlias' ||
294
+ node.type === 'OpaqueType' ||
293
295
  node.type === 'InterfaceDeclaration' ||
294
296
  node.type === 'EnumDeclaration'
295
297
  ) {
@@ -469,6 +471,9 @@ class FlowParser {
469
471
  }
470
472
  }
471
473
  nextNodeForTypeAlias(typeAnnotation) {
474
+ if (typeAnnotation.type === 'OpaqueType') {
475
+ return typeAnnotation.impltype;
476
+ }
472
477
  return typeAnnotation.right;
473
478
  }
474
479
  nextNodeForEnum(typeAnnotation) {
@@ -296,6 +296,7 @@ class FlowParser implements Parser {
296
296
  if (
297
297
  node.declaration != null &&
298
298
  (node.declaration.type === 'TypeAlias' ||
299
+ node.declaration.type === 'OpaqueType' ||
299
300
  node.declaration.type === 'InterfaceDeclaration')
300
301
  ) {
301
302
  types[node.declaration.id.name] = node.declaration;
@@ -309,6 +310,7 @@ class FlowParser implements Parser {
309
310
  types[node.declaration.id.name] = node.declaration;
310
311
  } else if (
311
312
  node.type === 'TypeAlias' ||
313
+ node.type === 'OpaqueType' ||
312
314
  node.type === 'InterfaceDeclaration' ||
313
315
  node.type === 'EnumDeclaration'
314
316
  ) {
@@ -543,6 +545,10 @@ class FlowParser implements Parser {
543
545
  }
544
546
 
545
547
  nextNodeForTypeAlias(typeAnnotation: $FlowFixMe): $FlowFixMe {
548
+ if (typeAnnotation.type === 'OpaqueType') {
549
+ return typeAnnotation.impltype;
550
+ }
551
+
546
552
  return typeAnnotation.right;
547
553
  }
548
554
 
@@ -1041,7 +1041,8 @@ function handleGenericTypeAnnotation(
1041
1041
  let typeResolutionStatus;
1042
1042
  let node;
1043
1043
  switch (resolvedTypeAnnotation.type) {
1044
- case parser.typeAlias: {
1044
+ case parser.typeAlias:
1045
+ case 'OpaqueType': {
1045
1046
  typeResolutionStatus = getTypeResolutionStatus(
1046
1047
  'alias',
1047
1048
  typeAnnotation,
@@ -1233,7 +1233,8 @@ function handleGenericTypeAnnotation(
1233
1233
  let node;
1234
1234
 
1235
1235
  switch (resolvedTypeAnnotation.type) {
1236
- case parser.typeAlias: {
1236
+ case parser.typeAlias:
1237
+ case 'OpaqueType': {
1237
1238
  typeResolutionStatus = getTypeResolutionStatus(
1238
1239
  'alias',
1239
1240
  typeAnnotation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/codegen",
3
- "version": "0.81.0-nightly-20250615-98f5a4e11",
3
+ "version": "0.81.0-nightly-20250618-ce75271d4",
4
4
  "description": "Code generation tools for React Native",
5
5
  "license": "MIT",
6
6
  "repository": {