@react-native-windows/codegen 0.67.0 → 0.68.0-preview.1

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.
@@ -102,10 +102,10 @@ function translateParam(
102
102
  )}> const &`;
103
103
  }
104
104
  } else {
105
- return decorateType('React::JSValueArray', target);
105
+ return decorateType('::React::JSValueArray', target);
106
106
  }
107
107
  case 'GenericObjectTypeAnnotation':
108
- return decorateType('React::JSValue', target);
108
+ return decorateType('::React::JSValue', target);
109
109
  case 'ObjectTypeAnnotation':
110
110
  return decorateType(
111
111
  getAnonymousAliasCppName(aliases, baseAliasName, param),
@@ -194,7 +194,7 @@ export function translateSpecArgs(
194
194
  aliases: AliasMap,
195
195
  baseAliasName: string,
196
196
  ) {
197
- return params.map(param => {
197
+ return params.map((param) => {
198
198
  const translatedParam = translateSpecFunctionParam(
199
199
  param,
200
200
  aliases,
@@ -209,7 +209,7 @@ export function translateArgs(
209
209
  aliases: AliasMap,
210
210
  baseAliasName: string,
211
211
  ) {
212
- return params.map(param => {
212
+ return params.map((param) => {
213
213
  const translatedParam = translateFunctionParam(
214
214
  param,
215
215
  aliases,
@@ -45,10 +45,10 @@ function translateReturnType(
45
45
  `${baseAliasName}_element`,
46
46
  )}>`;
47
47
  } else {
48
- return 'React::JSValueArray';
48
+ return '::React::JSValueArray';
49
49
  }
50
50
  case 'GenericObjectTypeAnnotation':
51
- return 'React::JSValue';
51
+ return '::React::JSValue';
52
52
  case 'ObjectTypeAnnotation':
53
53
  return getAnonymousAliasCppName(aliases, baseAliasName, type);
54
54
  case 'ReservedTypeAnnotation': {
@@ -14,7 +14,7 @@ export function generateValidateConstants(
14
14
  aliases: AliasMap,
15
15
  ): [string, string] | undefined {
16
16
  const candidates = nativeModule.spec.properties.filter(
17
- prop => prop.name === 'getConstants',
17
+ (prop) => prop.name === 'getConstants',
18
18
  );
19
19
  if (candidates.length === 0) {
20
20
  return undefined;
@@ -35,7 +35,7 @@ function getPossibleMethodSignatures(
35
35
  const args = translateArgs(funcType.params, aliases, baseAliasName);
36
36
  if (isMethodReturnPromise(funcType)) {
37
37
  // TODO: type of the promise could be provided in the future
38
- args.push('React::ReactPromise<React::JSValue> &&result');
38
+ args.push('::React::ReactPromise<::React::JSValue> &&result');
39
39
  }
40
40
 
41
41
  // TODO: be much more exhastive on the possible method signatures that can be used..
@@ -65,7 +65,7 @@ function translatePossibleMethodSignatures(
65
65
  baseAliasName: string,
66
66
  ): string {
67
67
  return getPossibleMethodSignatures(prop, funcType, aliases, baseAliasName)
68
- .map(sig => `" ${sig}\\n"`)
68
+ .map((sig) => `" ${sig}\\n"`)
69
69
  .join('\n ');
70
70
  }
71
71
 
@@ -76,7 +76,7 @@ function renderProperties(
76
76
  ): string {
77
77
  // TODO: generate code for constants
78
78
  return properties
79
- .filter(prop => prop.name !== 'getConstants')
79
+ .filter((prop) => prop.name !== 'getConstants')
80
80
  .map((prop, index) => {
81
81
  // TODO: prop.optional === true
82
82
  // TODO: prop.typeAnnotation.type === 'NullableTypeAnnotation'
@@ -100,7 +100,7 @@ function renderProperties(
100
100
 
101
101
  if (isMethodReturnPromise(funcType)) {
102
102
  // TODO: type of the promise could be provided in the future
103
- traversedArgs.push('Promise<React::JSValue>');
103
+ traversedArgs.push('Promise<::React::JSValue>');
104
104
  }
105
105
 
106
106
  if (tuple) {