diff --git a/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleCpp-test.js.snap b/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleCpp-test.js.snap index 06f976b26535a7..7e83959de67afa 100644 --- a/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleCpp-test.js.snap +++ b/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleCpp-test.js.snap @@ -16,13 +16,23 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getReadOnlyArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReadOnlyArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getReadOnlyArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArrayWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArrayWithAlias(rt, args[0].asObject(rt).asArray(rt), args[1].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArrayWithAlias( + rt, + args[0].asObject(rt).asArray(rt), + args[1].asObject(rt).asArray(rt) + ); } NativeArrayTurboModuleCxxSpecJSI::NativeArrayTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -32,10 +42,16 @@ NativeArrayTurboModuleCxxSpecJSI::NativeArrayTurboModuleCxxSpecJSI(std::shared_p methodMap_[\\"getArrayWithAlias\\"] = MethodMetadata {2, __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArrayWithAlias}; } static jsi::Value __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBoolean(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBoolean(rt, args[0].asBool()); + return static_cast(&turboModule)->getBoolean( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBooleanWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBooleanWithAlias(rt, args[0].asBool()); + return static_cast(&turboModule)->getBooleanWithAlias( + rt, + args[0].asBool() + ); } NativeBooleanTurboModuleCxxSpecJSI::NativeBooleanTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -44,11 +60,17 @@ NativeBooleanTurboModuleCxxSpecJSI::NativeBooleanTurboModuleCxxSpecJSI(std::shar methodMap_[\\"getBooleanWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBooleanWithAlias}; } static jsi::Value __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallbackWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallbackWithAlias(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallbackWithAlias( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } @@ -58,22 +80,43 @@ NativeCallbackTurboModuleCxxSpecJSI::NativeCallbackTurboModuleCxxSpecJSI(std::sh methodMap_[\\"getValueWithCallbackWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallbackWithAlias}; } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusRegular(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusRegular(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusRegular( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusStr(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusStr(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusStr( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusNum(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusNum(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusNum( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusFraction(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusFraction(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusFraction( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateType(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStateType(rt, args[0].asString(rt), args[1].asString(rt), args[2].asNumber(), args[3].asNumber()); + return static_cast(&turboModule)->getStateType( + rt, + args[0].asString(rt), + args[1].asString(rt), + args[2].asNumber(), + args[3].asNumber() + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateTypeWithEnums(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStateTypeWithEnums(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStateTypeWithEnums( + rt, + args[0].asObject(rt) + ); } NativeEnumTurboModuleCxxSpecJSI::NativeEnumTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -86,27 +129,44 @@ NativeEnumTurboModuleCxxSpecJSI::NativeEnumTurboModuleCxxSpecJSI(std::shared_ptr methodMap_[\\"getStateTypeWithEnums\\"] = MethodMetadata {1, __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateTypeWithEnums}; } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getString( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -120,10 +180,16 @@ NativeNullableTurboModuleCxxSpecJSI::NativeNullableTurboModuleCxxSpecJSI(std::sh methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {0, __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asNumber() + ); } static jsi::Value __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumberWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumberWithAlias(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumberWithAlias( + rt, + args[0].asNumber() + ); } NativeNumberTurboModuleCxxSpecJSI::NativeNumberTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -132,19 +198,33 @@ NativeNumberTurboModuleCxxSpecJSI::NativeNumberTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getNumberWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumberWithAlias}; } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObjectReadOnly(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObjectReadOnly(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObjectReadOnly( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObjectWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObjectWithAlias(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObjectWithAlias( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_difficultObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->difficultObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->difficultObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } NativeObjectTurboModuleCxxSpecJSI::NativeObjectTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -156,7 +236,9 @@ NativeObjectTurboModuleCxxSpecJSI::NativeObjectTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getConstants}; } static jsi::Value __hostFunction_NativeOptionalObjectTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } NativeOptionalObjectTurboModuleCxxSpecJSI::NativeOptionalObjectTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -164,16 +246,27 @@ NativeOptionalObjectTurboModuleCxxSpecJSI::NativeOptionalObjectTurboModuleCxxSpe methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeOptionalObjectTurboModuleCxxSpecJSI_getConstants}; } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSomeObj(rt); + return static_cast(&turboModule)->getSomeObj( + rt + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getPartialSomeObj(rt); + return static_cast(&turboModule)->getPartialSomeObj( + rt + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getSomeObjFromPartialSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSomeObjFromPartialSomeObj(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getSomeObjFromPartialSomeObj( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialPartial(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getPartialPartial(rt, args[0].asObject(rt), args[1].asObject(rt)); + return static_cast(&turboModule)->getPartialPartial( + rt, + args[0].asObject(rt), + args[1].asObject(rt) + ); } NativePartialAnnotationTurboModuleCxxSpecJSI::NativePartialAnnotationTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -184,10 +277,16 @@ NativePartialAnnotationTurboModuleCxxSpecJSI::NativePartialAnnotationTurboModule methodMap_[\\"getPartialPartial\\"] = MethodMetadata {2, __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialPartial}; } static jsi::Value __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asBool()); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromiseWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromiseWithAlias(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getValueWithPromiseWithAlias( + rt, + args[0].asString(rt) + ); } NativePromiseTurboModuleCxxSpecJSI::NativePromiseTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -196,45 +295,84 @@ NativePromiseTurboModuleCxxSpecJSI::NativePromiseTurboModuleCxxSpecJSI(std::shar methodMap_[\\"getValueWithPromiseWithAlias\\"] = MethodMetadata {1, __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromiseWithAlias}; } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, args[0].asBool()); + return static_cast(&turboModule)->getBool( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asString(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getObjectShape( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getAlias( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, args[0].getNumber()); + return static_cast(&turboModule)->getRootTag( + rt, + args[0].getNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, args[0].asNumber(), args[1].asString(rt), args[2].asObject(rt)); + return static_cast(&turboModule)->getValue( + rt, + args[0].asNumber(), + args[1].asString(rt), + args[2].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asBool()); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asBool() + ); } NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -254,45 +392,84 @@ NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getBool( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getObject( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getObjectShape( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getAlias( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getRootTag( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, args[0].asObject(rt).asArray(rt), args[1].asObject(rt).asArray(rt), args[2].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getValue( + rt, + args[0].asObject(rt).asArray(rt), + args[1].asObject(rt).asArray(rt), + args[2].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asObject(rt).asArray(rt) + ); } NativeSampleTurboModuleArraysCxxSpecJSI::NativeSampleTurboModuleArraysCxxSpecJSI(std::shared_ptr jsInvoker) @@ -312,54 +489,93 @@ NativeSampleTurboModuleArraysCxxSpecJSI::NativeSampleTurboModuleArraysCxxSpecJSI methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + auto result = static_cast(&turboModule)->getString( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObjectShape(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObjectShape( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getAlias(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getAlias( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getRootTag(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + auto result = static_cast(&turboModule)->getRootTag( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValue(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + auto result = static_cast(&turboModule)->getValue( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -380,53 +596,92 @@ NativeSampleTurboModuleNullableCxxSpecJSI::NativeSampleTurboModuleNullableCxxSpe methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + auto result = static_cast(&turboModule)->getString( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObjectShape( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getAlias(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getAlias( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getRootTag(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + auto result = static_cast(&turboModule)->getRootTag( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValue(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), count < 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), count < 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + auto result = static_cast(&turboModule)->getValue( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt))); + static_cast(&turboModule)->getValueWithCallback( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt)) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -447,45 +702,84 @@ NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI::NativeSampleTurboModuleNul methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + return static_cast(&turboModule)->getBool( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + return static_cast(&turboModule)->getNumber( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + return static_cast(&turboModule)->getString( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + return static_cast(&turboModule)->getArray( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObject( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObjectShape( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getAlias( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + return static_cast(&turboModule)->getRootTag( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), count < 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), count < 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + return static_cast(&turboModule)->getValue( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt))); + static_cast(&turboModule)->getValueWithCallback( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt)) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + return static_cast(&turboModule)->getValueWithPromise( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); } NativeSampleTurboModuleOptionalCxxSpecJSI::NativeSampleTurboModuleOptionalCxxSpecJSI(std::shared_ptr jsInvoker) @@ -505,10 +799,16 @@ NativeSampleTurboModuleOptionalCxxSpecJSI::NativeSampleTurboModuleOptionalCxxSpe methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeStringTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asString(rt) + ); } static jsi::Value __hostFunction_NativeStringTurboModuleCxxSpecJSI_getStringWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStringWithAlias(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getStringWithAlias( + rt, + args[0].asString(rt) + ); } NativeStringTurboModuleCxxSpecJSI::NativeStringTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -539,13 +839,23 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getReadOnlyArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReadOnlyArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getReadOnlyArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArrayWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArrayWithAlias(rt, args[0].asObject(rt).asArray(rt), args[1].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArrayWithAlias( + rt, + args[0].asObject(rt).asArray(rt), + args[1].asObject(rt).asArray(rt) + ); } NativeArrayTurboModuleCxxSpecJSI::NativeArrayTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -555,10 +865,16 @@ NativeArrayTurboModuleCxxSpecJSI::NativeArrayTurboModuleCxxSpecJSI(std::shared_p methodMap_[\\"getArrayWithAlias\\"] = MethodMetadata {2, __hostFunction_NativeArrayTurboModuleCxxSpecJSI_getArrayWithAlias}; } static jsi::Value __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBoolean(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBoolean(rt, args[0].asBool()); + return static_cast(&turboModule)->getBoolean( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBooleanWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBooleanWithAlias(rt, args[0].asBool()); + return static_cast(&turboModule)->getBooleanWithAlias( + rt, + args[0].asBool() + ); } NativeBooleanTurboModuleCxxSpecJSI::NativeBooleanTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -567,11 +883,17 @@ NativeBooleanTurboModuleCxxSpecJSI::NativeBooleanTurboModuleCxxSpecJSI(std::shar methodMap_[\\"getBooleanWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeBooleanTurboModuleCxxSpecJSI_getBooleanWithAlias}; } static jsi::Value __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallbackWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallbackWithAlias(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallbackWithAlias( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } @@ -581,22 +903,43 @@ NativeCallbackTurboModuleCxxSpecJSI::NativeCallbackTurboModuleCxxSpecJSI(std::sh methodMap_[\\"getValueWithCallbackWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeCallbackTurboModuleCxxSpecJSI_getValueWithCallbackWithAlias}; } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusRegular(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusRegular(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusRegular( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusStr(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusStr(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusStr( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusNum(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusNum(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusNum( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStatusFraction(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStatusFraction(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStatusFraction( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateType(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStateType(rt, args[0].asString(rt), args[1].asString(rt), args[2].asNumber(), args[3].asNumber()); + return static_cast(&turboModule)->getStateType( + rt, + args[0].asString(rt), + args[1].asString(rt), + args[2].asNumber(), + args[3].asNumber() + ); } static jsi::Value __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateTypeWithEnums(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStateTypeWithEnums(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getStateTypeWithEnums( + rt, + args[0].asObject(rt) + ); } NativeEnumTurboModuleCxxSpecJSI::NativeEnumTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -609,27 +952,44 @@ NativeEnumTurboModuleCxxSpecJSI::NativeEnumTurboModuleCxxSpecJSI(std::shared_ptr methodMap_[\\"getStateTypeWithEnums\\"] = MethodMetadata {1, __hostFunction_NativeEnumTurboModuleCxxSpecJSI_getStateTypeWithEnums}; } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getString( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -643,10 +1003,16 @@ NativeNullableTurboModuleCxxSpecJSI::NativeNullableTurboModuleCxxSpecJSI(std::sh methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {0, __hostFunction_NativeNullableTurboModuleCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asNumber() + ); } static jsi::Value __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumberWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumberWithAlias(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumberWithAlias( + rt, + args[0].asNumber() + ); } NativeNumberTurboModuleCxxSpecJSI::NativeNumberTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -655,19 +1021,33 @@ NativeNumberTurboModuleCxxSpecJSI::NativeNumberTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getNumberWithAlias\\"] = MethodMetadata {1, __hostFunction_NativeNumberTurboModuleCxxSpecJSI_getNumberWithAlias}; } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObjectReadOnly(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObjectReadOnly(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObjectReadOnly( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getGenericObjectWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getGenericObjectWithAlias(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getGenericObjectWithAlias( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_difficultObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->difficultObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->difficultObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } NativeObjectTurboModuleCxxSpecJSI::NativeObjectTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -679,7 +1059,9 @@ NativeObjectTurboModuleCxxSpecJSI::NativeObjectTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeObjectTurboModuleCxxSpecJSI_getConstants}; } static jsi::Value __hostFunction_NativeOptionalObjectTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } NativeOptionalObjectTurboModuleCxxSpecJSI::NativeOptionalObjectTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -687,16 +1069,27 @@ NativeOptionalObjectTurboModuleCxxSpecJSI::NativeOptionalObjectTurboModuleCxxSpe methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeOptionalObjectTurboModuleCxxSpecJSI_getConstants}; } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSomeObj(rt); + return static_cast(&turboModule)->getSomeObj( + rt + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getPartialSomeObj(rt); + return static_cast(&turboModule)->getPartialSomeObj( + rt + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getSomeObjFromPartialSomeObj(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSomeObjFromPartialSomeObj(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getSomeObjFromPartialSomeObj( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialPartial(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getPartialPartial(rt, args[0].asObject(rt), args[1].asObject(rt)); + return static_cast(&turboModule)->getPartialPartial( + rt, + args[0].asObject(rt), + args[1].asObject(rt) + ); } NativePartialAnnotationTurboModuleCxxSpecJSI::NativePartialAnnotationTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -707,10 +1100,16 @@ NativePartialAnnotationTurboModuleCxxSpecJSI::NativePartialAnnotationTurboModule methodMap_[\\"getPartialPartial\\"] = MethodMetadata {2, __hostFunction_NativePartialAnnotationTurboModuleCxxSpecJSI_getPartialPartial}; } static jsi::Value __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asBool()); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromiseWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromiseWithAlias(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getValueWithPromiseWithAlias( + rt, + args[0].asString(rt) + ); } NativePromiseTurboModuleCxxSpecJSI::NativePromiseTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -719,45 +1118,84 @@ NativePromiseTurboModuleCxxSpecJSI::NativePromiseTurboModuleCxxSpecJSI(std::shar methodMap_[\\"getValueWithPromiseWithAlias\\"] = MethodMetadata {1, __hostFunction_NativePromiseTurboModuleCxxSpecJSI_getValueWithPromiseWithAlias}; } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, args[0].asBool()); + return static_cast(&turboModule)->getBool( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asString(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getObjectShape( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getAlias( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, args[0].getNumber()); + return static_cast(&turboModule)->getRootTag( + rt, + args[0].getNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, args[0].asNumber(), args[1].asString(rt), args[2].asObject(rt)); + return static_cast(&turboModule)->getValue( + rt, + args[0].asNumber(), + args[1].asString(rt), + args[2].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asBool()); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asBool() + ); } NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -777,45 +1215,84 @@ NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getBool( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getObject( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getObjectShape( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getAlias( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getRootTag( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, args[0].asObject(rt).asArray(rt), args[1].asObject(rt).asArray(rt), args[2].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getValue( + rt, + args[0].asObject(rt).asArray(rt), + args[1].asObject(rt).asArray(rt), + args[2].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asObject(rt).asArray(rt) + ); } NativeSampleTurboModuleArraysCxxSpecJSI::NativeSampleTurboModuleArraysCxxSpecJSI(std::shared_ptr jsInvoker) @@ -835,54 +1312,93 @@ NativeSampleTurboModuleArraysCxxSpecJSI::NativeSampleTurboModuleArraysCxxSpecJSI methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleArraysCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + auto result = static_cast(&turboModule)->getString( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObjectShape(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObjectShape( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getAlias(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getAlias( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getRootTag(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + auto result = static_cast(&turboModule)->getRootTag( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValue(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + auto result = static_cast(&turboModule)->getValue( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -903,53 +1419,92 @@ NativeSampleTurboModuleNullableCxxSpecJSI::NativeSampleTurboModuleNullableCxxSpe methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleNullableCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getBool(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getBool( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNumber(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + auto result = static_cast(&turboModule)->getNumber( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getString(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + auto result = static_cast(&turboModule)->getString( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getArray(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + auto result = static_cast(&turboModule)->getArray( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getObject(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getObject( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObjectShape( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getAlias(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getAlias( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getRootTag(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + auto result = static_cast(&turboModule)->getRootTag( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValue(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), count < 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), count < 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + auto result = static_cast(&turboModule)->getValue( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt))); + static_cast(&turboModule)->getValueWithCallback( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt)) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getValueWithPromise(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + auto result = static_cast(&turboModule)->getValueWithPromise( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -970,45 +1525,84 @@ NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI::NativeSampleTurboModuleNul methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleNullableAndOptionalCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + return static_cast(&turboModule)->getBool( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber())); + return static_cast(&turboModule)->getNumber( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))); + return static_cast(&turboModule)->getString( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt))); + return static_cast(&turboModule)->getArray( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObject( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getObjectShape(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectShape(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getObjectShape( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAlias(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getAlias( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber())); + return static_cast(&turboModule)->getRootTag( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].getNumber()) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), count < 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), count < 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))); + return static_cast(&turboModule)->getValue( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)), + count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt))); + static_cast(&turboModule)->getValueWithCallback( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asFunction(rt)) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool())); + return static_cast(&turboModule)->getValueWithPromise( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asBool()) + ); } NativeSampleTurboModuleOptionalCxxSpecJSI::NativeSampleTurboModuleOptionalCxxSpecJSI(std::shared_ptr jsInvoker) @@ -1028,10 +1622,16 @@ NativeSampleTurboModuleOptionalCxxSpecJSI::NativeSampleTurboModuleOptionalCxxSpe methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleOptionalCxxSpecJSI_getValueWithPromise}; } static jsi::Value __hostFunction_NativeStringTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asString(rt) + ); } static jsi::Value __hostFunction_NativeStringTurboModuleCxxSpecJSI_getStringWithAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getStringWithAlias(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getStringWithAlias( + rt, + args[0].asString(rt) + ); } NativeStringTurboModuleCxxSpecJSI::NativeStringTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js index cef441f6fe1862..dd3ad09a60e9f0 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js @@ -40,8 +40,8 @@ const HostFunctionTemplate = ({ }>) => { const isNullable = returnTypeAnnotation.type === 'NullableTypeAnnotation'; const isVoid = returnTypeAnnotation.type === 'VoidTypeAnnotation'; - const methodCallArgs = ['rt', ...args].join(', '); - const methodCall = `static_cast<${hasteModuleName}CxxSpecJSI *>(&turboModule)->${methodName}(${methodCallArgs})`; + const methodCallArgs = [' rt', ...args].join(',\n '); + const methodCall = `static_cast<${hasteModuleName}CxxSpecJSI *>(&turboModule)->${methodName}(\n${methodCallArgs}\n )`; return `static jsi::Value __hostFunction_${hasteModuleName}CxxSpecJSI_${methodName}(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {${ isVoid @@ -139,7 +139,7 @@ function serializeArg( } else { let condition = `${val}.isNull() || ${val}.isUndefined()`; if (optional) { - condition = `count < ${index} || ${condition}`; + condition = `count <= ${index} || ${condition}`; } return `${condition} ? std::nullopt : std::make_optional(${expression})`; } diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap index a07e0f5a717c27..5ddbb60c3069f7 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap @@ -47,30 +47,50 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_difficult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->difficult(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->difficult( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionals(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->optionals(rt, args[0].asObject(rt)); + static_cast(&turboModule)->optionals( + rt, + args[0].asObject(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionalMethod(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->optionalMethod(rt, args[0].asObject(rt), args[1].asObject(rt).asFunction(rt), count < 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt).asArray(rt))); + static_cast(&turboModule)->optionalMethod( + rt, + args[0].asObject(rt), + args[1].asObject(rt).asFunction(rt), + count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt).asArray(rt)) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArrays(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getArrays(rt, args[0].asObject(rt)); + static_cast(&turboModule)->getArrays( + rt, + args[0].asObject(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNullableObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNullableObject(rt); + auto result = static_cast(&turboModule)->getNullableObject( + rt + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNullableGenericObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNullableGenericObject(rt); + auto result = static_cast(&turboModule)->getNullableGenericObject( + rt + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNullableArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNullableArray(rt); + auto result = static_cast(&turboModule)->getNullableArray( + rt + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } @@ -109,20 +129,39 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getMixed(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getMixed(rt, jsi::Value(rt, args[0])); + return static_cast(&turboModule)->getMixed( + rt, + jsi::Value(rt, args[0]) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNullableNumberFromNullableAlias(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getNullableNumberFromNullableAlias(rt, args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + auto result = static_cast(&turboModule)->getNullableNumberFromNullableAlias( + rt, + args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnums(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnums(rt, args[0].asNumber(), args[1].asNumber(), args[2].asString(rt)); + return static_cast(&turboModule)->getEnums( + rt, + args[0].asNumber(), + args[1].asNumber(), + args[2].asString(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getUnion(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getUnion(rt, args[0].asNumber(), args[1].asNumber(), args[2].asObject(rt), args[3].asString(rt)); + return static_cast(&turboModule)->getUnion( + rt, + args[0].asNumber(), + args[1].asNumber(), + args[2].asObject(rt), + args[3].asString(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnumReturn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnumReturn(rt); + return static_cast(&turboModule)->getEnumReturn( + rt + ); } NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -188,10 +227,15 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_AliasTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_AliasTurboModuleCxxSpecJSI_cropImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cropImage(rt, args[0].asObject(rt)); + static_cast(&turboModule)->cropImage( + rt, + args[0].asObject(rt) + ); return jsi::Value::undefined(); } @@ -225,16 +269,28 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeCameraRollManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeCameraRollManagerCxxSpecJSI_getPhotos(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getPhotos(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getPhotos( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeCameraRollManagerCxxSpecJSI_saveToCameraRoll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->saveToCameraRoll(rt, args[0].asString(rt), args[1].asString(rt)); + return static_cast(&turboModule)->saveToCameraRoll( + rt, + args[0].asString(rt), + args[1].asString(rt) + ); } static jsi::Value __hostFunction_NativeCameraRollManagerCxxSpecJSI_deletePhotos(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->deletePhotos(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->deletePhotos( + rt, + args[0].asObject(rt).asArray(rt) + ); } NativeCameraRollManagerCxxSpecJSI::NativeCameraRollManagerCxxSpecJSI(std::shared_ptr jsInvoker) @@ -245,23 +301,43 @@ NativeCameraRollManagerCxxSpecJSI::NativeCameraRollManagerCxxSpecJSI(std::shared methodMap_[\\"deletePhotos\\"] = MethodMetadata {1, __hostFunction_NativeCameraRollManagerCxxSpecJSI_deletePhotos}; } static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportFatalException(rt, args[0].asString(rt), args[1].asObject(rt).asArray(rt), args[2].asNumber()); + static_cast(&turboModule)->reportFatalException( + rt, + args[0].asString(rt), + args[1].asObject(rt).asArray(rt), + args[2].asNumber() + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportSoftException(rt, args[0].asString(rt), args[1].asObject(rt).asArray(rt), args[2].asNumber()); + static_cast(&turboModule)->reportSoftException( + rt, + args[0].asString(rt), + args[1].asObject(rt).asArray(rt), + args[2].asNumber() + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportException(rt, args[0].asObject(rt)); + static_cast(&turboModule)->reportException( + rt, + args[0].asObject(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_updateExceptionMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateExceptionMessage(rt, args[0].asString(rt), args[1].asObject(rt).asArray(rt), args[2].asNumber()); + static_cast(&turboModule)->updateExceptionMessage( + rt, + args[0].asString(rt), + args[1].asObject(rt).asArray(rt), + args[2].asNumber() + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissRedbox(rt); + static_cast(&turboModule)->dismissRedbox( + rt + ); return jsi::Value::undefined(); } @@ -298,48 +374,91 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool(rt, args[0].asBool()); + return static_cast(&turboModule)->getBool( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber(rt, args[0].asNumber()); + return static_cast(&turboModule)->getNumber( + rt, + args[0].asNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString(rt, args[0].asString(rt)); + return static_cast(&turboModule)->getString( + rt, + args[0].asString(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray(rt, args[0].asObject(rt).asArray(rt)); + return static_cast(&turboModule)->getArray( + rt, + args[0].asObject(rt).asArray(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject(rt, args[0].asObject(rt)); + return static_cast(&turboModule)->getObject( + rt, + args[0].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag(rt, args[0].getNumber()); + return static_cast(&turboModule)->getRootTag( + rt, + args[0].getNumber() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue(rt, args[0].asNumber(), args[1].asString(rt), args[2].asObject(rt)); + return static_cast(&turboModule)->getValue( + rt, + args[0].asNumber(), + args[1].asString(rt), + args[2].asObject(rt) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnumReturn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnumReturn(rt); + return static_cast(&turboModule)->getEnumReturn( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback(rt, args[0].asObject(rt).asFunction(rt)); + static_cast(&turboModule)->getValueWithCallback( + rt, + args[0].asObject(rt).asFunction(rt) + ); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise(rt, args[0].asBool()); + return static_cast(&turboModule)->getValueWithPromise( + rt, + args[0].asBool() + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithOptionalArg(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithOptionalArg(rt, count < 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt))); + return static_cast(&turboModule)->getValueWithOptionalArg( + rt, + count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt)) + ); } static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnums(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnums(rt, args[0].asNumber(), args[1].asNumber(), args[2].asString(rt)); + return static_cast(&turboModule)->getEnums( + rt, + args[0].asNumber(), + args[1].asNumber(), + args[2].asString(rt) + ); } NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) @@ -384,7 +503,9 @@ namespace facebook { namespace react { static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } @@ -393,10 +514,14 @@ NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc}; } static jsi::Value __hostFunction_NativeSampleTurboModule2CxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants(rt); + return static_cast(&turboModule)->getConstants( + rt + ); } static jsi::Value __hostFunction_NativeSampleTurboModule2CxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc(rt); + static_cast(&turboModule)->voidFunc( + rt + ); return jsi::Value::undefined(); } diff --git a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp index a937f818cb06da..7c3d62da2ba4a1 100644 --- a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp +++ b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp @@ -117,6 +117,12 @@ AsyncPromise NativeCxxModuleExample::getValueWithPromise( return promise; } +bool NativeCxxModuleExample::getWithWithOptionalArgs( + jsi::Runtime &rt, + std::optional optionalArg) { + return optionalArg.value_or(false); +} + void NativeCxxModuleExample::voidFunc(jsi::Runtime &rt) { // Nothing to do } diff --git a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.h b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.h index 3ef836bd0b21fa..2a1538bb6451a6 100644 --- a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.h +++ b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.h @@ -120,6 +120,10 @@ class NativeCxxModuleExample AsyncPromise getValueWithPromise(jsi::Runtime &rt, bool error); + bool getWithWithOptionalArgs( + jsi::Runtime &rt, + std::optional optionalArg); + void voidFunc(jsi::Runtime &rt); void emitCustomDeviceEvent(jsi::Runtime &rt, jsi::String eventName); diff --git a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js index 669a321a5e428d..f8d9e1b0df2686 100644 --- a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js +++ b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js @@ -70,6 +70,7 @@ export interface Spec extends TurboModule { +getValue: (x: number, y: string, z: ObjectStruct) => ValueStruct; +getValueWithCallback: (callback: (value: string) => void) => void; +getValueWithPromise: (error: boolean) => Promise; + +getWithWithOptionalArgs: (optionalArg?: boolean) => boolean; +voidFunc: () => void; +emitCustomDeviceEvent: (eventName: string) => void; } diff --git a/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js b/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js index 85b0e65bb737be..e1e5950053f38c 100644 --- a/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js @@ -55,6 +55,7 @@ type Examples = | 'promise' | 'rejectPromise' | 'voidFunc' + | 'optionalArgs' | 'emitDeviceEvent'; class NativeCxxModuleExampleExample extends React.Component<{||}, State> { @@ -99,6 +100,7 @@ class NativeCxxModuleExampleExample extends React.Component<{||}, State> { .then(() => {}) .catch(e => this._setResult('rejectPromise', e.message)), voidFunc: () => NativeCxxModuleExample?.voidFunc(), + optionalArgs: () => NativeCxxModuleExample?.getWithWithOptionalArgs(), emitDeviceEvent: () => { const CUSTOM_EVENT_TYPE = 'myCustomDeviceEvent'; DeviceEventEmitter.removeAllListeners(CUSTOM_EVENT_TYPE);