diff --git a/package.json b/package.json index 7543e992..a0e619f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rn-boiler-template", "private": false, - "version": "1.72.38", + "version": "1.74.0", "description": "Clean and minimalist React Native template for a quick start with TypeScript and components", "scripts": { "test": "exit 0" diff --git a/template/GITLABRUNNER.MD b/template/GITLABRUNNER.MD index 8f31cd7c..bf186982 100644 --- a/template/GITLABRUNNER.MD +++ b/template/GITLABRUNNER.MD @@ -1,4 +1,3 @@ - You can config gitlab CI runner to create build automatically. ## Config workflow @@ -24,7 +23,6 @@ You can config gitlab CI runner to create build automatically. - Step 2: Add 2 variable: - BRANCH_NAME: branch of repo want to build. ex: develop, main, ... - BASE_ENV_ARGS: env want to build. String with "," separator. This will use for fastlane. ex: dev,prod - ``` ### .gitlab-ci.yml @@ -38,13 +36,13 @@ default: - macos_shared variables: - GIT_CLEAN_FLAGS: "none" + GIT_CLEAN_FLAGS: 'none' # BRANCH_NAME: "develop" - FASTLANE_SCRIPT_ANDROID: "bundle exec fastlane android" - FASTLANE_SCRIPT_IOS: "bundle exec fastlane ios" + FASTLANE_SCRIPT_ANDROID: 'bundle exec fastlane android' + FASTLANE_SCRIPT_IOS: 'bundle exec fastlane ios' # BASE_ENV_ARGS: "dev" - EXPORT_DIR_ARGS_NAME: "export_dir" - EXPORT_FOLDER: "export/$BRANCH_NAME" + EXPORT_DIR_ARGS_NAME: 'export_dir' + EXPORT_FOLDER: 'export/$BRANCH_NAME' clone-code-project: stage: clone @@ -97,7 +95,7 @@ build-android: - fnm use $NODE_VERSION script: - echo "sdk.dir=$ANDROID_HOME" > android/local.properties - - npx ts-node build_script/build-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER + - node build-ci/build-android.js $BASE_ENV_ARGS $EXPORT_FOLDER needs: - job: install-dependencies allow_failure: true @@ -108,7 +106,7 @@ deploy-android: - echo "Deploy android app ..." - cd repo/$BRANCH_NAME script: - - npx ts-node build_script/deploy-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER + - node build-ci/deploy-android.js $BASE_ENV_ARGS $EXPORT_FOLDER needs: - job: build-android allow_failure: true @@ -120,7 +118,7 @@ build-ios: - cd repo/$BRANCH_NAME - fnm use $NODE_VERSION script: - - npx ts-node build_script/build-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER + - node build-ci/build-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER needs: - job: install-dependencies allow_failure: true @@ -131,7 +129,7 @@ deploy-ios: - echo "Deploy ios app ..." - cd repo/$BRANCH_NAME script: - - npx ts-node build_script/deploy-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER + - node build-ci/deploy-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER needs: - job: build-ios allow_failure: true @@ -154,7 +152,6 @@ clean-up: script: - rm -rf $BRANCH_NAME needs: [release, deploy-ios, deploy-android] - ``` ### pull_repo.sh @@ -168,9 +165,9 @@ mkdir -p repo/$branch cd repo/$branch rm -rf fastlane git clone $repo -b $branch . -# copy fastlane and build_script to $branch folder +# copy fastlane and build-ci to $branch folder cp -r ../../fastlane . -cp -r ../../build_script . +cp -r ../../build-ci . ``` @@ -203,9 +200,9 @@ done ### build-ci -#### build-android.ts +#### build-android.js -```ts +```js import { execSync } from 'child_process'; (() => { @@ -231,12 +228,11 @@ import { execSync } from 'child_process'; ); }); })(); - ``` -#### deploy-android.ts +#### deploy-android.js -```ts +```js import { execSync } from 'child_process'; (() => { @@ -255,12 +251,11 @@ import { execSync } from 'child_process'; ); }); })(); - ``` -#### build-ios.ts +#### build-ios.js -```ts +```js import { execSync } from 'child_process'; (() => { @@ -279,12 +274,11 @@ import { execSync } from 'child_process'; ); }); })(); - ``` -#### deploy-ios.ts +#### deploy-ios.js -```ts +```js import { execSync } from 'child_process'; (() => { @@ -303,19 +297,18 @@ import { execSync } from 'child_process'; ); }); })(); - ``` > Folder structure like: . - ├── fastlane - ├── build-ci - │ ├── build-android.ts - │ ├── deploy-android.ts - │ ├── build-ios.ts - │ └── deploy-ios.ts - ├── .gitlab-ci.yml - ├── pull_repo.sh - ├── release.sh + ├── fastlane + ├── build-ci + │ ├── build-android.js + │ ├── deploy-android.js + │ ├── build-ios.js + │ └── deploy-ios.js + ├── .gitlab-ci.yml + ├── pull_repo.sh + ├── release.sh └── README.md diff --git a/template/Gemfile b/template/Gemfile index 47a45fe5..35f8ba5c 100644 --- a/template/Gemfile +++ b/template/Gemfile @@ -1,6 +1,8 @@ source 'https://rubygems.org' + # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" + # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper # bound in the template on Cocoapods with next React Native release. gem 'cocoapods', '>= 1.13', '< 1.15' diff --git a/template/__tests__/App.test.tsx b/template/__tests__/App.test.tsx new file mode 100644 index 00000000..b2345d8d --- /dev/null +++ b/template/__tests__/App.test.tsx @@ -0,0 +1,14 @@ +/** + * @format + */ + +import 'react-native'; +import React from 'react'; + +import renderer from 'react-test-renderer'; + +import { MyApp } from '../src/app'; + +it('renders correctly', () => { + renderer.create(); +}); diff --git a/template/_babelrc b/template/_babelrc deleted file mode 100644 index 9b67d011..00000000 --- a/template/_babelrc +++ /dev/null @@ -1,39 +0,0 @@ -{ - "env": { - "production": { - "plugins": ["transform-remove-console"] - } - }, - "plugins": [ - [ - "module-resolver", - { - "root": ["./"], - "alias": { - "@env": "./env-config", - "@assets": "./src/app/assets", - "@common": "./src/app/common", - "@app-emitter": "./src/app/common/emitter", - "@app-firebase": "./src/app/common/firebase", - "@hooks": "./src/app/common/hooks", - "@validate": "./src/app/common/zod-validate", - "@listener": "./src/app/common/redux/listener.ts", - "@animated": "./src/app/common/animated", - "@screens": "./src/app/screens", - "@components": "./src/app/library/components", - "@rn-core": "./src/app/library/components/core", - "@networking": "./src/app/library/networking", - "@utils": "./src/app/library/utils", - "@storage": "./src/app/library/utils/storage", - "@model": "./src/app/model", - "@navigation": "./src/app/navigation", - "@store": "./src/app/redux/store", - "@redux-slice": "./src/app/redux/action-slice", - "@redux-selector": "./src/app/redux/selector", - "@redux-action-type": "./src/app/redux/action-type", - "@theme": "./src/app/themes" - } - } - ] - ] -} diff --git a/template/_bundle/config b/template/_bundle/config index d137d242..848943bb 100644 --- a/template/_bundle/config +++ b/template/_bundle/config @@ -1,2 +1,2 @@ BUNDLE_PATH: "vendor/bundle" -BUNDLE_FORCE_RUBY_PLATFORM: 1 \ No newline at end of file +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/template/_eslintrc.js b/template/_eslintrc.js deleted file mode 100644 index bbcbeb8e..00000000 --- a/template/_eslintrc.js +++ /dev/null @@ -1,171 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - plugins: ['import'], - parserOptions: { - sourceType: 'module', - }, - settings: { - 'import/resolver': { - node: { - extensions: [ - '.js', - '.jsx', - '.ts', - '.tsx', - '.d.ts', - '.android.js', - '.android.jsx', - '.android.ts', - '.android.tsx', - '.ios.js', - '.ios.jsx', - '.ios.ts', - '.ios.tsx', - '.web.js', - '.web.jsx', - '.web.ts', - '.web.tsx', - ], - }, - }, - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - '@react-native', - ], - rules: { - 'no-undef': 'off', - quotes: [ - 'error', - 'single', - { - avoidEscape: true, - }, - ], - 'max-params': ['error', 3], - 'no-empty-pattern': 1, - '@typescript-eslint/no-empty-function': 1, - '@typescript-eslint/ban-ts-comment': 2, - '@typescript-eslint/no-explicit-any': 1, - '@typescript-eslint/explicit-module-boundary-types': 0, - 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }], - 'react-native/no-unused-styles': 2, - 'react-native/split-platform-components': 2, - 'react-native/no-inline-styles': 0, - 'react-native/no-color-literals': 0, - 'react-native/no-raw-text': 0, - 'import/no-extraneous-dependencies': 2, - 'import/extensions': ['error', 'never', { svg: 'always' }], - 'for-direction': 2, - 'no-cond-assign': 2, - 'no-constant-condition': 2, - 'no-inline-comments': 2, - 'no-promise-executor-return': 2, - 'no-fallthrough': 2, - 'no-dupe-args': 2, - 'no-dupe-keys': 2, - 'no-import-assign': 2, - 'no-dupe-else-if': 2, - 'no-duplicate-imports': 2, - 'no-ex-assign': 2, - 'padding-line-between-statements': [ - 'error', - { blankLine: 'always', prev: '*', next: 'return' }, - { blankLine: 'always', prev: '*', next: 'export' }, - { blankLine: 'always', prev: 'break', next: ['case'] }, - { blankLine: 'always', prev: '*', next: 'default' }, - { - blankLine: 'always', - prev: ['import', 'cjs-import'], - next: ['const', 'function', 'iife'], - }, - { - blankLine: 'always', - prev: [ - 'default', - 'block-like', - 'cjs-import', - 'cjs-export', - 'const', - 'function', - 'iife', - 'expression', - ], - next: '*', - }, - ], - 'no-shadow': 0, - 'sort-imports': [ - 'error', - { - ignoreCase: true, - ignoreDeclarationSort: true, - }, - ], - 'import/order': [ - 'error', - { - groups: [ - 'internal', - 'external', - 'builtin', - 'index', - 'sibling', - 'parent', - ], - pathGroups: [ - { - pattern: 'react+(|-native)', - group: 'external', - position: 'before', - }, - { - pattern: 'react+(|-*)', - group: 'external', - position: 'before', - }, - ], - pathGroupsExcludedImportTypes: [], - 'newlines-between': 'always', - alphabetize: { - order: 'asc', - caseInsensitive: true, - }, - }, - ], - 'import/no-duplicates': 2, - 'import/no-useless-path-segments': 2, - 'import/prefer-default-export': 0, - 'import/named': 0, - 'import/namespace': 0, - 'import/default': 0, - 'import/no-named-as-default-member': 0, - 'import/no-named-as-default': 0, - 'import/no-unused-modules': 0, - 'import/no-deprecated': 0, - '@typescript-eslint/indent': 0, - 'import/no-anonymous-default-export': 2, - 'react-hooks/rules-of-hooks': 1, - 'react-hooks/exhaustive-deps': [ - 'warn', - { additionalHooks: '(useDidMount)' }, - ], - 'jest/no-identical-title': 2, - 'jest/valid-expect': 2, - camelcase: 0, - 'prefer-destructuring': 2, - 'no-nested-ternary': 2, - 'comma-dangle': 0, - 'prettier/prettier': [ - 'error', - { - endOfLine: 'auto', - }, - ], - }, - env: { - node: true, - es2020: true, - }, -}; diff --git a/template/_gitignore b/template/_gitignore index 64dd1052..7f3ba68e 100644 --- a/template/_gitignore +++ b/template/_gitignore @@ -1,15 +1,9 @@ # OSX - # - .DS_Store -*.hprof -.cxx/ # Xcode - # - build/ *.pbxuser !default.pbxuser @@ -26,57 +20,32 @@ DerivedData *.hmap *.ipa *.xcuserstate -.xcode.env.local +**/.xcode.env.local # Android/IntelliJ - # - build/ .idea -.gradle/ -proguard/ -*.log -.navigation/ +.gradle local.properties *.iml -*.apk -*.aab -*.aar -*.ap_ -android/**/*.keystore +*.hprof +.cxx/ +*.keystore !debug.keystore -# Auto generate env - -.base.env -env.d.ts -env-config.ts - # node.js - # - node_modules/ npm-debug.log yarn-error.log -# BUCK - -buck-out/ -\.buckd/ - # fastlane - # - # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the - -# screenshots whenever they are needed - -# For more information about the recommended setup visit - -# +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ **/fastlane/report.xml **/fastlane/Preview.html @@ -84,32 +53,30 @@ buck-out/ **/fastlane/test_output # Bundle artifact - *.jsbundle -# CocoaPods - -/ios/Pods/ +# Ruby / CocoaPods +**/Pods/ /vendor/bundle/ -ios/prebuild.log -ios/tmp.xcconfig -*.app.dSYM.zip -# testing +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* +# testing /coverage -# Expo - -.expo -dist/ -web-build/ - # Yarn - .yarn/* !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions + +# Expo +.expo +dist/ +web-build/ + +# Sonar +.scannerwork/ \ No newline at end of file diff --git a/template/_prettierrc.js b/template/_prettierrc.js index 74eaef56..eb531752 100644 --- a/template/_prettierrc.js +++ b/template/_prettierrc.js @@ -1,7 +1,7 @@ module.exports = { + arrowParens: 'avoid', bracketSpacing: true, jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', - arrowParens: 'avoid', }; diff --git a/template/_watchmanconfig b/template/_watchmanconfig index 9e26dfee..0967ef42 100644 --- a/template/_watchmanconfig +++ b/template/_watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/template/_yarnrc.yml b/template/_yarnrc.yml index f207cedb..2a068e50 100644 --- a/template/_yarnrc.yml +++ b/template/_yarnrc.yml @@ -6,3 +6,4 @@ plugins: - .yarn/plugins/plugin-after-install.js yarnPath: .yarn/releases/yarn-3.6.4.cjs + diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index d91b5c25..8d2ec320 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -3,10 +3,10 @@ apply plugin: "org.jetbrains.kotlin.android" apply plugin: "com.facebook.react" project.ext.keyFiles = [ // Default key file when clean project - debug : 'env/dev.json', + debug: 'env/dev.json', // dev = flavor name - dev : 'env/dev.json' + dev : 'env/dev.json' ] apply from: project(':react-native-keys').projectDir.getPath() + "/RNKeys.gradle" @@ -58,6 +58,10 @@ react { // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] // + // Added by install-expo-modules + entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim()) + cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim()) + bundleCommand = "export:embed" } /** @@ -80,17 +84,14 @@ def jscFlavor = 'org.webkit:android-jsc:+' android { ndkVersion rootProject.ext.ndkVersion - flavorDimensions("default") buildToolsVersion rootProject.ext.buildToolsVersion compileSdk rootProject.ext.compileSdkVersion - - // Keep productFlavors to create variant - // Multiple Google-service.json: Add file .json to folder Flavor + flavorDimensions "default" productFlavors { dev { - } } + namespace "com.helloworld" defaultConfig { resValue "string", "build_config_package", "com.helloworld" @@ -107,8 +108,6 @@ android { keyAlias 'androiddebugkey' keyPassword 'android' } - release { - } } buildTypes { debug { @@ -118,25 +117,16 @@ android { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug - signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } - packagingOptions { - pickFirst 'lib/x86/libcrypto.so' - pickFirst 'lib/x86_64/libcrypto.so' - pickFirst 'lib/armeabi-v7a/libcrypto.so' - pickFirst 'lib/arm64-v8a/libcrypto.so' - } } dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration") - if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { @@ -145,12 +135,3 @@ dependencies { } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) - -task prepare() { - def flavor = project.keys.get("FLAVOR") - def envPath = project.ext.keyFiles.find { it.key == flavor }?.value - exec { - workingDir = rootProject.projectDir.path.replace("/android", "") - commandLine 'node', './scripts/prepare.js', envPath - } -} \ No newline at end of file diff --git a/template/android/app/src/debug/AndroidManifest.xml b/template/android/app/src/debug/AndroidManifest.xml index 9b2a684b..eb98c01a 100644 --- a/template/android/app/src/debug/AndroidManifest.xml +++ b/template/android/app/src/debug/AndroidManifest.xml @@ -5,5 +5,5 @@ - \ No newline at end of file + tools:ignore="GoogleAppIndexingWarning"/> + diff --git a/template/android/app/src/main/AndroidManifest.xml b/template/android/app/src/main/AndroidManifest.xml index ccf069df..5f6589ab 100644 --- a/template/android/app/src/main/AndroidManifest.xml +++ b/template/android/app/src/main/AndroidManifest.xml @@ -1,26 +1,16 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/android/app/src/main/ic_launcher-playstore.png b/template/android/app/src/main/ic_launcher-playstore.png new file mode 100644 index 00000000..a81616e3 Binary files /dev/null and b/template/android/app/src/main/ic_launcher-playstore.png differ diff --git a/template/android/app/src/main/java/com/helloworld/MainActivity.kt b/template/android/app/src/main/java/com/helloworld/MainActivity.kt index 4d82f168..3bfade08 100644 --- a/template/android/app/src/main/java/com/helloworld/MainActivity.kt +++ b/template/android/app/src/main/java/com/helloworld/MainActivity.kt @@ -1,6 +1,7 @@ package com.helloworld - import android.os.Bundle +import expo.modules.ReactActivityDelegateWrapper + import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled @@ -9,10 +10,10 @@ import com.zoontek.rnbootsplash.RNBootSplash class MainActivity : ReactActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(null) - RNBootSplash.init(this, R.style.BootTheme) - } + override fun onCreate(savedInstanceState: Bundle?) { + RNBootSplash.init(this, R.style.BootTheme) + super.onCreate(null) + } /** * Returns the name of the main component registered from JavaScript. This is used to schedule @@ -25,5 +26,5 @@ class MainActivity : ReactActivity() { * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] */ override fun createReactActivityDelegate(): ReactActivityDelegate = - DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) + ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)) } diff --git a/template/android/app/src/main/java/com/helloworld/MainApplication.kt b/template/android/app/src/main/java/com/helloworld/MainApplication.kt index b7ad04e4..9c09527e 100644 --- a/template/android/app/src/main/java/com/helloworld/MainApplication.kt +++ b/template/android/app/src/main/java/com/helloworld/MainApplication.kt @@ -1,4 +1,7 @@ package com.helloworld +import android.content.res.Configuration +import expo.modules.ApplicationLifecycleDispatcher +import expo.modules.ReactNativeHostWrapper import android.app.Application import com.facebook.react.PackageList @@ -9,13 +12,12 @@ import com.facebook.react.ReactPackage import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost -import com.facebook.react.flipper.ReactNativeFlipper import com.facebook.soloader.SoLoader class MainApplication : Application(), ReactApplication { override val reactNativeHost: ReactNativeHost = - object : DefaultReactNativeHost(this) { + ReactNativeHostWrapper(this, object : DefaultReactNativeHost(this) { override fun getPackages(): List = PackageList(this).packages.apply { // Packages that cannot be autolinked yet can be added manually here, for example: @@ -28,10 +30,10 @@ class MainApplication : Application(), ReactApplication { override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED - } + }) override val reactHost: ReactHost - get() = getDefaultReactHost(this.applicationContext, reactNativeHost) + get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost) override fun onCreate() { super.onCreate() @@ -40,6 +42,11 @@ class MainApplication : Application(), ReactApplication { // If you opted-in for the New Architecture, we load the native entry point for this app. load() } - ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) + ApplicationLifecycleDispatcher.onApplicationCreate(this) } -} \ No newline at end of file + + override fun onConfigurationChanged(newConfig: Configuration) { + super.onConfigurationChanged(newConfig) + ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig) + } +} diff --git a/template/android/app/src/main/res/drawable-hdpi/bootsplash_logo.png b/template/android/app/src/main/res/drawable-hdpi/bootsplash_logo.png index a217defa..21a3b5c1 100644 Binary files a/template/android/app/src/main/res/drawable-hdpi/bootsplash_logo.png and b/template/android/app/src/main/res/drawable-hdpi/bootsplash_logo.png differ diff --git a/template/android/app/src/main/res/drawable-mdpi/bootsplash_logo.png b/template/android/app/src/main/res/drawable-mdpi/bootsplash_logo.png index c5dda243..5454caaa 100644 Binary files a/template/android/app/src/main/res/drawable-mdpi/bootsplash_logo.png and b/template/android/app/src/main/res/drawable-mdpi/bootsplash_logo.png differ diff --git a/template/android/app/src/main/res/drawable-xhdpi/bootsplash_logo.png b/template/android/app/src/main/res/drawable-xhdpi/bootsplash_logo.png index 5615598e..c614dbc6 100644 Binary files a/template/android/app/src/main/res/drawable-xhdpi/bootsplash_logo.png and b/template/android/app/src/main/res/drawable-xhdpi/bootsplash_logo.png differ diff --git a/template/android/app/src/main/res/drawable-xxhdpi/bootsplash_logo.png b/template/android/app/src/main/res/drawable-xxhdpi/bootsplash_logo.png index e6ad1e64..df633af5 100644 Binary files a/template/android/app/src/main/res/drawable-xxhdpi/bootsplash_logo.png and b/template/android/app/src/main/res/drawable-xxhdpi/bootsplash_logo.png differ diff --git a/template/android/app/src/main/res/drawable/rn_edit_text_material.xml b/template/android/app/src/main/res/drawable/rn_edit_text_material.xml index ab58c0f4..5c25e728 100644 --- a/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/template/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -1,9 +1,12 @@ - \ No newline at end of file + + diff --git a/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc..00000000 --- a/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc..00000000 --- a/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index bcafbad7..0a63e491 100644 Binary files a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index b7c6218d..c2b8dc18 100644 Binary files a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 5ad3a3ad..0336ac1c 100644 Binary files a/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 621ac7d2..2cf10148 100644 Binary files a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 53775f29..cee9eb87 100644 Binary files a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 38e91369..f48b4d91 100644 Binary files a/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index ef1db239..d458ebcb 100644 Binary files a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index b2c6e4e0..1af72d98 100644 Binary files a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 33fcd4dc..e15126fd 100644 Binary files a/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 9e99bb4b..c23273bf 100644 Binary files a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index a81b2675..f7771eab 100644 Binary files a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 14801035..175ec11f 100644 Binary files a/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 52928a3c..750d4d29 100644 Binary files a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index c3738660..d0d40d11 100644 Binary files a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index face0c3f..76ada0b6 100644 Binary files a/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/template/android/app/src/main/res/values/colors.xml b/template/android/app/src/main/res/values/colors.xml index 52bb5f15..8d597fa2 100644 --- a/template/android/app/src/main/res/values/colors.xml +++ b/template/android/app/src/main/res/values/colors.xml @@ -1,6 +1,5 @@ - #00FFFFFF #FFFFFF #FFFFFF - + \ No newline at end of file diff --git a/template/android/app/src/main/res/values/styles.xml b/template/android/app/src/main/res/values/styles.xml index 22f04327..e688a7c3 100644 --- a/template/android/app/src/main/res/values/styles.xml +++ b/template/android/app/src/main/res/values/styles.xml @@ -12,9 +12,10 @@ - \ No newline at end of file diff --git a/template/android/build.gradle b/template/android/build.gradle index 1c4fae03..6fcf4cf7 100644 --- a/template/android/build.gradle +++ b/template/android/build.gradle @@ -1,13 +1,11 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 - ndkVersion = "25.1.8937393" - kotlinVersion = "1.8.0" + ndkVersion = "26.1.10909125" + kotlinVersion = "1.9.22" } repositories { google() @@ -17,7 +15,7 @@ buildscript { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") - } } + apply plugin: "com.facebook.react.rootproject" diff --git a/template/android/gradle/wrapper/gradle-wrapper.properties b/template/android/gradle/wrapper/gradle-wrapper.properties index ed2be394..2ea3535d 100644 --- a/template/android/gradle/wrapper/gradle-wrapper.properties +++ b/template/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/template/android/gradlew b/template/android/gradlew index 0adc8e1a..1aa94a42 100755 --- a/template/android/gradlew +++ b/template/android/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/template/android/gradlew.bat b/template/android/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/template/android/gradlew.bat +++ b/template/android/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/template/appicon/appicon-dev.png b/template/assets/appicon/appicon-dev.png similarity index 100% rename from template/appicon/appicon-dev.png rename to template/assets/appicon/appicon-dev.png diff --git a/template/appicon/appicon.png b/template/assets/appicon/appicon.png similarity index 100% rename from template/appicon/appicon.png rename to template/assets/appicon/appicon.png diff --git a/template/assets/bootsplash_logo.png b/template/assets/bootsplash_logo.png index 1f85419c..78cc7450 100644 Binary files a/template/assets/bootsplash_logo.png and b/template/assets/bootsplash_logo.png differ diff --git a/template/assets/bootsplash_logo@1,5x.png b/template/assets/bootsplash_logo@1,5x.png index 5b8354db..e0509430 100644 Binary files a/template/assets/bootsplash_logo@1,5x.png and b/template/assets/bootsplash_logo@1,5x.png differ diff --git a/template/assets/bootsplash_logo@2x.png b/template/assets/bootsplash_logo@2x.png index cea7fd6a..38bd9396 100644 Binary files a/template/assets/bootsplash_logo@2x.png and b/template/assets/bootsplash_logo@2x.png differ diff --git a/template/assets/bootsplash_logo@3x.png b/template/assets/bootsplash_logo@3x.png index f072b8bb..edd30cd9 100644 Binary files a/template/assets/bootsplash_logo@3x.png and b/template/assets/bootsplash_logo@3x.png differ diff --git a/template/src/app/assets/fonts/Manrope-Bold.ttf b/template/assets/fonts/Manrope-Bold.ttf similarity index 100% rename from template/src/app/assets/fonts/Manrope-Bold.ttf rename to template/assets/fonts/Manrope-Bold.ttf diff --git a/template/src/app/assets/fonts/Manrope-Medium.ttf b/template/assets/fonts/Manrope-Medium.ttf similarity index 100% rename from template/src/app/assets/fonts/Manrope-Medium.ttf rename to template/assets/fonts/Manrope-Medium.ttf diff --git a/template/src/app/assets/fonts/Manrope-SemiBold.ttf b/template/assets/fonts/Manrope-SemiBold.ttf similarity index 100% rename from template/src/app/assets/fonts/Manrope-SemiBold.ttf rename to template/assets/fonts/Manrope-SemiBold.ttf diff --git a/template/src/app/assets/fonts/Roboto-Italic.ttf b/template/assets/fonts/Roboto-Italic.ttf similarity index 100% rename from template/src/app/assets/fonts/Roboto-Italic.ttf rename to template/assets/fonts/Roboto-Italic.ttf diff --git a/template/src/app/assets/fonts/Roboto-Regular.ttf b/template/assets/fonts/Roboto-Regular.ttf similarity index 100% rename from template/src/app/assets/fonts/Roboto-Regular.ttf rename to template/assets/fonts/Roboto-Regular.ttf diff --git a/template/src/app/assets/fonts/icons.ttf b/template/assets/fonts/icons.ttf similarity index 100% rename from template/src/app/assets/fonts/icons.ttf rename to template/assets/fonts/icons.ttf diff --git a/template/assets/fonts/index.ts b/template/assets/fonts/index.ts new file mode 100644 index 00000000..043e37fd --- /dev/null +++ b/template/assets/fonts/index.ts @@ -0,0 +1,8 @@ +export const fonts = { + icons: require('./icons.ttf'), + manrope_medium: require('./Manrope-Medium.ttf'), + manrope_bold: require('./Manrope-Bold.ttf'), + manrope_semibold: require('./Manrope-SemiBold.ttf'), + roboto_regular: require('./Roboto-Regular.ttf'), + roboto_italic: require('./Roboto-Italic.ttf'), +}; diff --git a/template/src/app/assets/icon/index.ts b/template/assets/icon/index.ts similarity index 100% rename from template/src/app/assets/icon/index.ts rename to template/assets/icon/index.ts diff --git a/template/src/app/assets/icon/source/chevron_left.png b/template/assets/icon/source/chevron_left.png similarity index 100% rename from template/src/app/assets/icon/source/chevron_left.png rename to template/assets/icon/source/chevron_left.png diff --git a/template/src/app/assets/icon/source/chevron_right.png b/template/assets/icon/source/chevron_right.png similarity index 100% rename from template/src/app/assets/icon/source/chevron_right.png rename to template/assets/icon/source/chevron_right.png diff --git a/template/src/app/assets/icon/source/done.png b/template/assets/icon/source/done.png similarity index 100% rename from template/src/app/assets/icon/source/done.png rename to template/assets/icon/source/done.png diff --git a/template/src/app/assets/image/index.ts b/template/assets/image/index.ts similarity index 100% rename from template/src/app/assets/image/index.ts rename to template/assets/image/index.ts diff --git a/template/src/app/assets/image/source/bg.png b/template/assets/image/source/bg.png similarity index 100% rename from template/src/app/assets/image/source/bg.png rename to template/assets/image/source/bg.png diff --git a/template/src/app/assets/image/source/bg@2x.png b/template/assets/image/source/bg@2x.png similarity index 100% rename from template/src/app/assets/image/source/bg@2x.png rename to template/assets/image/source/bg@2x.png diff --git a/template/src/app/assets/image/source/bg@3x.png b/template/assets/image/source/bg@3x.png similarity index 100% rename from template/src/app/assets/image/source/bg@3x.png rename to template/assets/image/source/bg@3x.png diff --git a/template/src/app/assets/image/source/default.png b/template/assets/image/source/default.png similarity index 100% rename from template/src/app/assets/image/source/default.png rename to template/assets/image/source/default.png diff --git a/template/src/app/assets/image/source/default@2x.png b/template/assets/image/source/default@2x.png similarity index 100% rename from template/src/app/assets/image/source/default@2x.png rename to template/assets/image/source/default@2x.png diff --git a/template/src/app/assets/image/source/default@3x.png b/template/assets/image/source/default@3x.png similarity index 100% rename from template/src/app/assets/image/source/default@3x.png rename to template/assets/image/source/default@3x.png diff --git a/template/splash/splash.png b/template/assets/splash/splash.png similarity index 100% rename from template/splash/splash.png rename to template/assets/splash/splash.png diff --git a/template/babel.config.js b/template/babel.config.js index ffd114b9..f5fd86cb 100644 --- a/template/babel.config.js +++ b/template/babel.config.js @@ -1,9 +1,41 @@ module.exports = { - presets: ['module:@react-native/babel-preset'], env: { production: { plugins: ['transform-remove-console'], }, }, - plugins: ['react-native-reanimated/plugin'], + plugins: [ + 'react-native-reanimated/plugin', + [ + 'module-resolver', + { + alias: { + '@animated': './src/app/common/animated', + '@app-emitter': './src/app/common/emitter', + '@app-firebase': './src/app/common/firebase', + '@assets': './assets', + '@common': './src/app/common', + '@components': './src/app/library/components', + '@env': './env-config', + '@hooks': './src/app/common/hooks', + '@listener': './src/app/common/redux/listener.ts', + '@model': './src/app/model', + '@navigation': './src/app/navigation', + '@networking': './src/app/library/networking', + '@redux-action-type': './src/app/redux/action-type', + '@redux-selector': './src/app/redux/selector', + '@redux-slice': './src/app/redux/action-slice', + '@rn-core': './src/app/library/components/core', + '@screens': './src/app/screens', + '@storage': './src/app/library/utils/storage', + '@store': './src/app/redux/store', + '@theme': './src/app/themes', + '@utils': './src/app/library/utils', + '@validate': './src/app/common/zod-validate', + }, + root: ['./'], + }, + ], + ], + presets: ['module:@react-native/babel-preset'], }; diff --git a/template/declare/array/index.d.ts b/template/declare/@types/array.d.ts similarity index 80% rename from template/declare/array/index.d.ts rename to template/declare/@types/array.d.ts index a03c36ac..9e3314fc 100644 --- a/template/declare/array/index.d.ts +++ b/template/declare/@types/array.d.ts @@ -11,4 +11,8 @@ declare global { */ searchAllProps(keyword: string | number): Array; } + + interface ArrayConstructor { + validArray(source: T[]): T[]; + } } diff --git a/template/declare/global/index.d.ts b/template/declare/@types/global.d.ts similarity index 84% rename from template/declare/global/index.d.ts rename to template/declare/@types/global.d.ts index bb7d9b7a..de89c6af 100644 --- a/template/declare/global/index.d.ts +++ b/template/declare/@types/global.d.ts @@ -14,7 +14,27 @@ declare module 'react' { props: P & import('react').RefAttributes, ) => import('react').ReactElement | null; } + declare global { + type TypesBase = + | 'bigint' + | 'boolean' + | 'function' + | 'number' + | 'object' + | 'string' + | 'symbol' + | 'undefined'; + + function isTypeof(source: any, type: TypesBase): source is TypesBase; + + function execFunc any>( + func?: Fn, + ...args: Parameters + ): void; + + function randomUniqueId(): string; + type ActionBase = T extends undefined ? { type: string; diff --git a/template/declare/number/index.d.ts b/template/declare/@types/number.d.ts similarity index 100% rename from template/declare/number/index.d.ts rename to template/declare/@types/number.d.ts diff --git a/template/declare/@types/string.d.ts b/template/declare/@types/string.d.ts new file mode 100644 index 00000000..d2739d45 --- /dev/null +++ b/template/declare/@types/string.d.ts @@ -0,0 +1,30 @@ +export {}; + +declare global { + interface String { + /** + * Convert string to camel case + */ + capitalize(): string; + + /** + * Convert all UTF-8 to ASCII lowercase. + */ + changeAlias(): string; + + /** + * Return true if string is empty + */ + isEmpty(): boolean; + + /** + * Remove all characters except 0-9 + */ + removeChar(): string; + + /** + * Get all URL from string + */ + getURL(): Array; + } +} diff --git a/template/declare/array/index.ts b/template/declare/array/index.ts index a147dff5..6209f87c 100644 --- a/template/declare/array/index.ts +++ b/template/declare/array/index.ts @@ -15,3 +15,11 @@ Array.prototype.searchAllProps = function (keyword: string | number) { }); }); }; + +Array.validArray = function (source: T[]): T[] { + if (Array.isArray(source)) { + return source; + } + + return [] as T[]; +}; diff --git a/template/declare/global/index.ts b/template/declare/global/index.ts new file mode 100644 index 00000000..fa376adb --- /dev/null +++ b/template/declare/global/index.ts @@ -0,0 +1,28 @@ +globalThis.randomUniqueId = function () { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + // eslint-disable-next-line no-bitwise + const r = (Math.random() * 16) | 0, + // eslint-disable-next-line no-bitwise + v = c === 'x' ? r : (r & 0x3) | 0x8; + + return v.toString(16); + }); +}; + +globalThis.execFunc = function any>( + func?: Fn, + ...args: Parameters +) { + if (typeof func === 'function') { + func(...args); + } +}; + +globalThis.isTypeof = function ( + source: any, + type: TypesBase, +): source is TypesBase { + return typeof source === type; +}; + +export {}; diff --git a/template/declare/index.ts b/template/declare/index.ts index d55c418e..1f864739 100644 --- a/template/declare/index.ts +++ b/template/declare/index.ts @@ -3,3 +3,5 @@ export * from './string'; export * from './array'; export * from './number'; + +export * from './global'; diff --git a/template/declare/number/index.ts b/template/declare/number/index.ts index d046a9f5..aa746833 100644 --- a/template/declare/number/index.ts +++ b/template/declare/number/index.ts @@ -19,7 +19,44 @@ Number.prototype.toTime = function () { }; Number.prototype.currencyFormat = function (comma = ',') { - return String(this).replace(/(\d)(?=(\d{3})+\b)/g, `$1${comma}`); + const numberStr = this.toString(); + + console.log(numberStr); + + // Split the number into integer and decimal parts + let [integerPart, decimalPart] = numberStr.split('.'); + + // Function to add commas to a part of the number + function addCommas(part: string) { + let result = ''; + let count = 0; + + // Traverse the part from right to left and add commas + for (let i = part.length - 1; i >= 0; i--) { + result = part[i] + result; + + count++; + + if (count === 3 && i !== 0) { + result = comma + result; + + count = 0; + } + } + + return result; + } + + // Format integer and decimal parts + integerPart = addCommas(integerPart); + + if (decimalPart) { + decimalPart = addCommas(decimalPart); + + return `${integerPart}.${decimalPart}`; + } else { + return integerPart; + } }; Number.prototype.roundMaxFixed = function (maxDecimals = 2) { diff --git a/template/declare/string/constant.ts b/template/declare/string/constant.ts deleted file mode 100644 index 8406525b..00000000 --- a/template/declare/string/constant.ts +++ /dev/null @@ -1,101 +0,0 @@ -export const KANA_FULL_HALF_MAP = { - ガ: 'ガ', - ギ: 'ギ', - グ: 'グ', - ゲ: 'ゲ', - ゴ: 'ゴ', - ザ: 'ザ', - ジ: 'ジ', - ズ: 'ズ', - ゼ: 'ゼ', - ゾ: 'ゾ', - ダ: 'ダ', - ヂ: 'ヂ', - ヅ: 'ヅ', - デ: 'デ', - ド: 'ド', - バ: 'バ', - ビ: 'ビ', - ブ: 'ブ', - ベ: 'ベ', - ボ: 'ボ', - パ: 'パ', - ピ: 'ピ', - プ: 'プ', - ペ: 'ペ', - ポ: 'ポ', - ヴ: 'ヴ', - ヷ: 'ヷ', - ヺ: 'ヺ', - ア: 'ア', - イ: 'イ', - ウ: 'ウ', - エ: 'エ', - オ: 'オ', - カ: 'カ', - キ: 'キ', - ク: 'ク', - ケ: 'ケ', - コ: 'コ', - サ: 'サ', - シ: 'シ', - ス: 'ス', - セ: 'セ', - ソ: 'ソ', - タ: 'タ', - チ: 'チ', - ツ: 'ツ', - テ: 'テ', - ト: 'ト', - ナ: 'ナ', - ニ: 'ニ', - ヌ: 'ヌ', - ネ: 'ネ', - ノ: 'ノ', - ハ: 'ハ', - ヒ: 'ヒ', - フ: 'フ', - ヘ: 'ヘ', - ホ: 'ホ', - マ: 'マ', - ミ: 'ミ', - ム: 'ム', - メ: 'メ', - モ: 'モ', - ヤ: 'ヤ', - ユ: 'ユ', - ヨ: 'ヨ', - ラ: 'ラ', - リ: 'リ', - ル: 'ル', - レ: 'レ', - ロ: 'ロ', - ワ: 'ワ', - ヲ: 'ヲ', - ン: 'ン', - ァ: 'ァ', - ィ: 'ィ', - ゥ: 'ゥ', - ェ: 'ェ', - ォ: 'ォ', - ッ: 'ッ', - ャ: 'ャ', - ュ: 'ュ', - ョ: 'ョ', - '。': '。', - '、': '、', - ー: 'ー', - '「': '「', - '」': '」', - '・': '・', - '1': '1', - '2': '2', - '3': '3', - '4': '4', - '5': '5', - '6': '6', - '7': '7', - '8': '8', - '9': '9', - '0': '0', -} as Record; diff --git a/template/declare/string/index.d.ts b/template/declare/string/index.d.ts deleted file mode 100644 index 255d226c..00000000 --- a/template/declare/string/index.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -export {}; - -declare global { - interface String { - /** - * Convert string to camel case - */ - capitalize(): string; - - /** - * Convert all UTF-8 to ASCII lowercase. - */ - changeAlias(): string; - - /** - * Remove html tag from string - */ - removeHtmlTag(): string; - - /** - * Return true if string is empty - */ - isEmpty(): boolean; - - /** - * Remove all characters except 0-9 - */ - removeChar(): string; - - /** - * Get all URL from string - */ - getURL(): Array; - - /** - * Replaces all match with string - */ - replaceAll(searchValue: string, replaceValue: string): string; - - /** - * Convert string color to hex color - */ - toHexColor(): string; - - /** - * Convert japanese full width to half width - */ - toHalfWidth(): string; - - /** - * Convert japanese half width to full width - */ - toFullWidth(): string; - - /** - * Create random string ID - */ - randomUniqueId(): string; - } -} diff --git a/template/declare/string/index.ts b/template/declare/string/index.ts index 84aceccf..9260e2de 100644 --- a/template/declare/string/index.ts +++ b/template/declare/string/index.ts @@ -1,46 +1,39 @@ /* eslint-disable no-extend-native */ -import { processColor } from 'react-native'; - -import { KANA_FULL_HALF_MAP } from './constant'; String.prototype.capitalize = function () { return this.charAt(0).toUpperCase() + this.slice(1); }; String.prototype.changeAlias = function () { - let str = this + ''; - str = str.toLowerCase(); + let str = this.toLowerCase(); - str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, 'a'); + // Replace Vietnamese diacritics + str = str.replace(/[àáạảãâầấậẩẫăằắặẳẵ]/g, 'a'); - str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, 'e'); + str = str.replace(/[èéẹẻẽêềếệểễ]/g, 'e'); - str = str.replace(/ì|í|ị|ỉ|ĩ/g, 'i'); + str = str.replace(/[ìíịỉĩ]/g, 'i'); - str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, 'o'); + str = str.replace(/[òóọỏõôồốộổỗơờớợởỡ]/g, 'o'); - str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, 'u'); + str = str.replace(/[ùúụủũưừứựửữ]/g, 'u'); - str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, 'y'); + str = str.replace(/[ỳýỵỷỹ]/g, 'y'); str = str.replace(/đ/g, 'd'); - str = str.replace( - /!|@|%|\^|\*|\(|\)|\+|=|<|>|\?|\/|,|\.|:|;|'|"|&|#|\[|\]|~|\$|_|`|-|{|}|\||\\/g, - '', - ); + // Remove special characters + str = str.replace(/[!@%^*()+=<>,.?/:;'"&#[]~$_`{|}|\\-]+/g, ''); - str = str.replace(/ + /g, ' '); + // Replace multiple spaces with single space + str = str.replace(/ +/g, ' '); + // Trim leading and trailing spaces str = str.trim(); return str; }; -String.prototype.removeHtmlTag = function () { - return this.replace(/<\/?[^>]+(>|$)/g, ''); -}; - String.prototype.isEmpty = function () { return this.trim().length === 0; }; @@ -50,72 +43,11 @@ String.prototype.removeChar = function () { }; String.prototype.getURL = function () { + // Simplified URL detection regex const detectUrls = - /((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(?::[0-9]{1,5})?(?:\/[a-z0-9_\-.~]+)*(?:\/(?:[a-z0-9_\-.]*)(?:\?[a-z0-9+_\-.%=&]*)?)?(?:#[a-zA-Z0-9!$&'(?:)*+.=-_~:@/?]*)?)(?:\s+|$)/; - - return this.split(detectUrls).filter(v => detectUrls.test(v)); -}; - -String.prototype.replaceAll = function ( - searchValue: string, - replaceValue: string, -) { - return this.split(searchValue).join(replaceValue); -}; - -String.prototype.toHexColor = function () { - const processedColor = processColor(this as string); - - const colorStr = `${(processedColor ?? '').toString(16)}`; - - const withoutAlpha = colorStr.substring(2, colorStr.length); - - const alpha = colorStr.substring(0, 2); - - return `#${withoutAlpha}${alpha}`; -}; - -String.prototype.toHalfWidth = function () { - const reg = new RegExp( - '(' + Object.keys(KANA_FULL_HALF_MAP).join('|') + ')', - 'g', - ); - - return this.replace(reg, function (match) { - return KANA_FULL_HALF_MAP[match]; - }) - .replace(/゛/g, '゙') - .replace(/゜/g, '゚'); -}; - -String.prototype.toFullWidth = function () { - const kanaHalfFullMap: Record = {}; - - Object.keys(KANA_FULL_HALF_MAP).forEach(key => { - kanaHalfFullMap[KANA_FULL_HALF_MAP[key]] = key; - }); - - const reg = new RegExp( - '(' + Object.keys(kanaHalfFullMap).join('|') + ')', - 'g', - ); - - return this.replace(reg, function (match) { - return kanaHalfFullMap[match]; - }) - .replace(/゙/g, '゛') - .replace(/゚/g, '゜'); -}; - -String.prototype.randomUniqueId = function () { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - // eslint-disable-next-line no-bitwise - const r = (Math.random() * 16) | 0, - // eslint-disable-next-line no-bitwise - v = c === 'x' ? r : (r & 0x3) | 0x8; + /\b(?:https?|ftp):\/\/[-A-Z0-9+&@#/%?=~_|$!:,.;]*[A-Z0-9+&@#/%=~_|$]/gi; - return v.toString(16); - }); + return this.match(detectUrls) || []; }; export {}; diff --git a/template/env-config.ts b/template/env-config.ts index e4c736ba..c82668a9 100644 --- a/template/env-config.ts +++ b/template/env-config.ts @@ -4,7 +4,7 @@ import Keys from 'react-native-keys'; -export const APP_BUILD_VERSION = '1.0.0.2024.01.03.22.10'; +export const APP_BUILD_VERSION = '1.0.0.2024.07.16.20.16'; export const { DEFAULT_FALLBACK_LNG_I18n } = Keys; diff --git a/template/eslint.config.mjs b/template/eslint.config.mjs new file mode 100644 index 00000000..97efd5ef --- /dev/null +++ b/template/eslint.config.mjs @@ -0,0 +1,261 @@ +import { fixupPluginRules } from '@eslint/compat'; +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import tsParser from '@typescript-eslint/parser'; +import _import from 'eslint-plugin-import'; +import _sortKeysFix from 'eslint-plugin-sort-keys-fix'; + +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); + +const __dirname = path.dirname(__filename); + +const compat = new FlatCompat({ + allConfig: js.configs.all, + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, +}); + +export default [ + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + '@react-native', + ), + { + languageOptions: { + ecmaVersion: 5, + parser: tsParser, + sourceType: 'module', + }, + + plugins: { + import: fixupPluginRules(_import), + sortKeysFix: fixupPluginRules(_sortKeysFix), + }, + + rules: { + '@typescript-eslint/ban-ts-comment': 2, + '@typescript-eslint/explicit-module-boundary-types': 0, + '@typescript-eslint/indent': 0, + '@typescript-eslint/no-empty-function': 1, + + '@typescript-eslint/no-explicit-any': 1, + camelcase: 0, + 'comma-dangle': 0, + 'for-direction': 2, + 'import/default': 0, + 'import/extensions': [ + 'error', + 'never', + { + svg: 'always', + }, + ], + + 'import/named': 0, + + 'import/namespace': 0, + 'import/no-anonymous-default-export': [ + 'error', + { + allowAnonymousClass: false, + allowAnonymousFunction: false, + allowArray: true, + allowArrowFunction: false, + allowCallExpression: true, + allowLiteral: false, + allowNew: false, + allowObject: false, + }, + ], + 'import/no-deprecated': 0, + 'import/no-duplicates': 2, + 'import/no-extraneous-dependencies': 2, + 'import/no-named-as-default': 0, + + 'import/no-named-as-default-member': 0, + + 'import/no-unused-modules': 0, + 'import/no-useless-path-segments': 2, + 'import/order': [ + 'error', + { + alphabetize: { + caseInsensitive: true, + order: 'asc', + }, + + groups: [ + 'internal', + 'external', + 'builtin', + 'index', + 'sibling', + 'parent', + ], + + 'newlines-between': 'always', + pathGroups: [ + { + group: 'external', + pattern: 'react+(|-native)', + position: 'before', + }, + { + group: 'external', + pattern: 'react+(|-*)', + position: 'before', + }, + ], + + pathGroupsExcludedImportTypes: [], + }, + ], + 'import/prefer-default-export': 0, + 'jest/no-identical-title': 2, + 'jest/valid-expect': 2, + 'max-params': ['error', 3], + 'no-cond-assign': 2, + 'no-constant-condition': 2, + 'no-dupe-args': 2, + 'no-dupe-else-if': 2, + 'no-dupe-keys': 2, + + 'no-duplicate-imports': 2, + + 'no-empty-pattern': 1, + + 'no-ex-assign': 2, + + 'no-fallthrough': 2, + + 'no-import-assign': 2, + 'no-inline-comments': 2, + 'no-nested-ternary': 2, + 'no-promise-executor-return': 2, + 'no-shadow': 0, + 'no-undef': 'off', + 'padding-line-between-statements': [ + 'error', + { + blankLine: 'always', + next: 'return', + prev: '*', + }, + { + blankLine: 'always', + next: 'export', + prev: '*', + }, + { + blankLine: 'always', + next: ['case'], + prev: 'break', + }, + { + blankLine: 'always', + next: 'default', + prev: '*', + }, + { + blankLine: 'always', + next: ['const', 'function', 'iife'], + prev: ['import', 'cjs-import'], + }, + { + blankLine: 'always', + + next: '*', + + prev: [ + 'default', + 'block-like', + 'cjs-import', + 'cjs-export', + 'const', + 'function', + 'iife', + 'expression', + ], + }, + ], + 'prefer-destructuring': 2, + 'prettier/prettier': [ + 'error', + { + endOfLine: 'auto', + }, + ], + quotes: [ + 'error', + 'single', + { + avoidEscape: true, + }, + ], + 'react-hooks/exhaustive-deps': [ + 'warn', + { + additionalHooks: '(useDidMount)', + }, + ], + 'react-hooks/rules-of-hooks': 1, + 'react-native/no-color-literals': 0, + + 'react-native/no-inline-styles': 0, + + 'react-native/no-raw-text': 0, + 'react-native/no-unused-styles': 2, + 'react-native/split-platform-components': 2, + 'react/jsx-filename-extension': [ + 'error', + { + extensions: ['.tsx'], + }, + ], + 'sort-imports': [ + 'error', + { + ignoreCase: true, + ignoreDeclarationSort: true, + }, + ], + 'sort-keys': [ + 'error', + 'asc', + { caseSensitive: true, minKeys: 2, natural: false }, + ], + + 'sortKeysFix/sort-keys-fix': 'warn', + }, + + settings: { + 'import/resolver': { + node: { + extensions: [ + '.js', + '.jsx', + '.ts', + '.tsx', + '.d.ts', + '.android.js', + '.android.jsx', + '.android.ts', + '.android.tsx', + '.ios.js', + '.ios.jsx', + '.ios.ts', + '.ios.tsx', + '.web.js', + '.web.jsx', + '.web.ts', + '.web.tsx', + ], + }, + }, + }, + }, +]; diff --git a/template/index.js b/template/index.js index 3d2236f5..ab4cc87c 100644 --- a/template/index.js +++ b/template/index.js @@ -1,3 +1,4 @@ +import 'expo-dev-client'; import { AppRegistry, Text, TextInput } from 'react-native'; import 'react-native-gesture-handler'; diff --git a/template/ios/Config.xcconfig b/template/ios/Config.xcconfig index e6e6a4be..31a4627d 100644 --- a/template/ios/Config.xcconfig +++ b/template/ios/Config.xcconfig @@ -1,7 +1 @@ -// -// Config.xcconfig -// HelloWorld - -// Configuration settings file format documentation can be found at: -// https://help.apple.com/xcode/#/dev745c5c974 #include? "tmp.xcconfig" diff --git a/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/ios/HelloWorld.xcodeproj/project.pbxproj index 6142817b..7bab12b1 100644 --- a/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -7,34 +7,37 @@ objects = { /* Begin PBXBuildFile section */ + 031A1BC4E57874A2693B9C2A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 18B8A7E54402F6AB72883A32 /* PrivacyInfo.xcprivacy */; }; 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; }; + 12A5C73F2C369BE600F44B7A /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 12A5C73E2C369BE600F44B7A /* Config.xcconfig */; }; + 12A5C7442C369ECC00F44B7A /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 12A5C7432C369ECC00F44B7A /* BootSplash.storyboard */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 6132EF182BDFF13200BBE14D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - 84A0520D284A6BB2006E9CDE /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 84A0520C284A6BB2006E9CDE /* Config.xcconfig */; }; - 84C424AD2A3058D300987B13 /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84C424AC2A3058D300987B13 /* BootSplash.storyboard */; }; - D9755AEC55959846DA126270 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6773465A2BCE2EDCD12D172 /* ExpoModulesProvider.swift */; }; + B07EF647EA29CCD567AE5CE4 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B1C083ADE0C2EBB46E808F6 /* ExpoModulesProvider.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 12A5C73B2C36974400F44B7A /* HelloWorld-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HelloWorld-Bridging-Header.h"; sourceTree = ""; }; + 12A5C73E2C369BE600F44B7A /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + 12A5C7432C369ECC00F44B7A /* BootSplash.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = BootSplash.storyboard; path = HelloWorld/Splash/BootSplash.storyboard; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = HelloWorld/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = HelloWorld/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 18B8A7E54402F6AB72883A32 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = HelloWorld/PrivacyInfo.xcprivacy; sourceTree = ""; }; 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = HelloWorld/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; + 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; + 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B1C083ADE0C2EBB46E808F6 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-HelloWorld/ExpoModulesProvider.swift"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; - 84A05204284A6969006E9CDE /* HelloWorld-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HelloWorld-Bridging-Header.h"; sourceTree = ""; }; - 84A0520C284A6BB2006E9CDE /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; - 84C424AC2A3058D300987B13 /* BootSplash.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = BootSplash.storyboard; sourceTree = ""; }; - 9D402291CF13C92EC5D47545 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; - A9ACCB12B180D08045C86147 /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; - C6773465A2BCE2EDCD12D172 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-HelloWorld/ExpoModulesProvider.swift"; sourceTree = ""; }; + 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -50,28 +53,37 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 12A5C7422C369EBD00F44B7A /* Splash */ = { + isa = PBXGroup; + children = ( + 12A5C7432C369ECC00F44B7A /* BootSplash.storyboard */, + ); + name = Splash; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* HelloWorld */ = { isa = PBXGroup; children = ( - 84C424AB2A3058D300987B13 /* Splash */, - 84A0520C284A6BB2006E9CDE /* Config.xcconfig */, - 84A05204284A6969006E9CDE /* HelloWorld-Bridging-Header.h */, + 12A5C7422C369EBD00F44B7A /* Splash */, + 12A5C73B2C36974400F44B7A /* HelloWorld-Bridging-Header.h */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 13B07FB71A68108700A75B9A /* main.m */, + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, + 18B8A7E54402F6AB72883A32 /* PrivacyInfo.xcprivacy */, ); name = HelloWorld; sourceTree = ""; }; - 253B7F3A1EA4DA634891098D /* ExpoModulesProviders */ = { + 1E1B805D80B0E5FF230555A2 /* HelloWorld */ = { isa = PBXGroup; children = ( - 3D7C7375966A931763719381 /* HelloWorld */, + 6B1C083ADE0C2EBB46E808F6 /* ExpoModulesProvider.swift */, ); - name = ExpoModulesProviders; + name = HelloWorld; sourceTree = ""; }; 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { @@ -84,22 +96,12 @@ name = Frameworks; sourceTree = ""; }; - 3D7C7375966A931763719381 /* HelloWorld */ = { - isa = PBXGroup; - children = ( - C6773465A2BCE2EDCD12D172 /* ExpoModulesProvider.swift */, - ); - name = HelloWorld; - sourceTree = ""; - }; - 634607AE941723316B16E6B5 /* Pods */ = { + 46FF9FD08C480FB88DCF81C2 /* ExpoModulesProviders */ = { isa = PBXGroup; children = ( - A9ACCB12B180D08045C86147 /* Pods-HelloWorld.debug.xcconfig */, - 9D402291CF13C92EC5D47545 /* Pods-HelloWorld.release.xcconfig */, + 1E1B805D80B0E5FF230555A2 /* HelloWorld */, ); - name = Pods; - path = Pods; + name = ExpoModulesProviders; sourceTree = ""; }; 832341AE1AAA6A7D00B99B32 /* Libraries */ = { @@ -112,13 +114,13 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */, + 12A5C73E2C369BE600F44B7A /* Config.xcconfig */, 13B07FAE1A68108700A75B9A /* HelloWorld */, 832341AE1AAA6A7D00B99B32 /* Libraries */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, - 634607AE941723316B16E6B5 /* Pods */, - 253B7F3A1EA4DA634891098D /* ExpoModulesProviders */, + BBD78D7AC51CEA395F1C20DB /* Pods */, + 46FF9FD08C480FB88DCF81C2 /* ExpoModulesProviders */, ); indentWidth = 2; sourceTree = ""; @@ -133,13 +135,15 @@ name = Products; sourceTree = ""; }; - 84C424AB2A3058D300987B13 /* Splash */ = { + BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 84C424AC2A3058D300987B13 /* BootSplash.storyboard */, + 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */, + 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */, + 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */, + 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */, ); - name = Splash; - path = HelloWorld/Splash; + path = Pods; sourceTree = ""; }; /* End PBXGroup section */ @@ -150,10 +154,10 @@ buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */; buildPhases = ( C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, - BC62103B77C54A3F2EDBBCF1 /* [Expo] Configure project */, + C9047ECB0F86AF7888407940 /* [Expo] Configure project */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 84EA935C289439F20031D295 /* Setup Firebase Environment GoogleService-Info.plist */, + 846FA4DC2C47364B005DB347 /* Setup Firebase Environment GoogleService-Info.plist */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, @@ -177,7 +181,7 @@ LastUpgradeCheck = 1210; TargetAttributes = { 13B07F861A680F5B00A75B9A = { - LastSwiftMigration = 1320; + LastSwiftMigration = 1120; }; }; }; @@ -204,10 +208,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 12A5C73F2C369BE600F44B7A /* Config.xcconfig in Resources */, 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 84A0520D284A6BB2006E9CDE /* Config.xcconfig in Resources */, - 84C424AD2A3058D300987B13 /* BootSplash.storyboard in Resources */, + 12A5C7442C369ECC00F44B7A /* BootSplash.storyboard in Resources */, + 031A1BC4E57874A2693B9C2A /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -228,7 +233,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; + shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" \"$PROJECT_ROOT\" ios absolute | tail -n 1)\"\nfi\n\nif [[ -z \"$CLI_PATH\" ]]; then\n # Use Expo CLI\n export CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require.resolve('@expo/cli')\")\"\nfi\nif [[ -z \"$BUNDLE_COMMAND\" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND=\"export:embed\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n"; }; 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -247,7 +252,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 84EA935C289439F20031D295 /* Setup Firebase Environment GoogleService-Info.plist */ = { + 846FA4DC2C47364B005DB347 /* Setup Firebase Environment GoogleService-Info.plist */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -263,48 +268,48 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n#INFO_PLIST_FILE=GoogleService-Info.plist\n#INFO_PLIST_FILE_PATH=${PROJECT_DIR}/GoogleService/${SCHEME_SUFFIX}/${INFO_PLIST_FILE}\n#echo ${PROJECT_DIR}\n#\n## Make sure the release version exists\n#echo \"Looking for ${INFO_PLIST_FILE} in ${INFO_PLIST_FILE_PATH}\"\n#if [ ! -f $INFO_PLIST_FILE_PATH ] ; then\n# echo \"File ${INFO_PLIST_FILE} not found.\"\n# exit 1\n#fi\n#\n#PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\n#echo \"Copying ${INFO_PLIST_FILE} to final destination: ${PLIST_DESTINATION}\"\n#echo \"File ${INFO_PLIST_FILE_PATH} copied\"\n#cp \"${INFO_PLIST_FILE_PATH}\" \"${PLIST_DESTINATION}\"\n#\n"; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n#INFO_PLIST_FILE=GoogleService-Info.plist\n#INFO_PLIST_FILE_PATH=${PROJECT_DIR}/GoogleService/${SCHEME_SUFFIX}/$#{INFO_PLIST_FILE}\n#echo ${PROJECT_DIR}\n#\n### Make sure the release version exists\n#echo \"Looking for ${INFO_PLIST_FILE} in ${INFO_PLIST_FILE_PATH}\"\n#if [ ! -f $INFO_PLIST_FILE_PATH ] ; then\n# echo \"File ${INFO_PLIST_FILE} not found.\"\n# exit 1\n#fi\n#\n#PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\n#echo \"Copying ${INFO_PLIST_FILE} to final destination: #${PLIST_DESTINATION}\"\n#echo \"File ${INFO_PLIST_FILE_PATH} copied\"\n#cp \"${INFO_PLIST_FILE_PATH}\" \"${PLIST_DESTINATION}\"\n\n"; }; - BC62103B77C54A3F2EDBBCF1 /* [Expo] Configure project */ = { + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = "[Expo] Configure project"; + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-HelloWorld/expo-configure-project.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + C9047ECB0F86AF7888407940 /* [Expo] Configure project */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Check Pods Manifest.lock"; + name = "[Expo] Configure project"; outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-HelloWorld/expo-configure-project.sh\"\n"; }; E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; @@ -332,7 +337,7 @@ files = ( 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, - D9755AEC55959846DA126270 /* ExpoModulesProvider.swift in Sources */, + B07EF647EA29CCD567AE5CE4 /* ExpoModulesProvider.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -341,11 +346,11 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A9ACCB12B180D08045C86147 /* Pods-HelloWorld.debug.xcconfig */; + baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSETCATALOG_COMPILER_APPICON_NAME)"; + CODE_SIGN_STYLE = Manual; CLANG_ENABLE_MODULES = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = "$(APPLE_DEVELOPMENT_TEAM)"; ENABLE_BITCODE = NO; @@ -354,6 +359,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -363,28 +369,33 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = HelloWorld; PROVISIONING_PROFILE_SPECIFIER = "$(DEBUG_PROVISIONING_PROFILE)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "HelloWorld-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9D402291CF13C92EC5D47545 /* Pods-HelloWorld.release.xcconfig */; + baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSETCATALOG_COMPILER_APPICON_NAME)"; + CODE_SIGN_STYLE = Manual; CLANG_ENABLE_MODULES = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CURRENT_PROJECT_VERSION = 1; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = "$(APPLE_DEVELOPMENT_TEAM)"; - ENABLE_BITCODE = NO; INFOPLIST_FILE = HelloWorld/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -394,17 +405,23 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = HelloWorld; PROVISIONING_PROFILE_SPECIFIER = "$(RELEASE_PROVISIONING_PROFILE)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "HelloWorld-Bridging-Header.h"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 84A0520C284A6BB2006E9CDE /* Config.xcconfig */; + baseConfigurationReference = 12A5C73E2C369BE600F44B7A /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -432,9 +449,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + CXX = ""; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -442,7 +460,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", - _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -452,6 +469,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -463,18 +482,17 @@ ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-DFOLLY_NO_CONFIG", "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); OTHER_LDFLAGS = ( "$(inherited)", - "-Wl", - "-ld_classic", + " ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -484,9 +502,10 @@ }; 83CBBA211A601CBA00E9B192 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 84A0520C284A6BB2006E9CDE /* Config.xcconfig */; + baseConfigurationReference = 12A5C73E2C369BE600F44B7A /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -514,15 +533,12 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + CXX = ""; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION, - ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -530,6 +546,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -540,18 +558,17 @@ "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-DFOLLY_NO_CONFIG", "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); OTHER_LDFLAGS = ( "$(inherited)", - "-Wl", - "-ld_classic", + " ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; diff --git a/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-Dev.xcscheme b/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-Dev.xcscheme index f533511e..ea571127 100644 --- a/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-Dev.xcscheme +++ b/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-Dev.xcscheme @@ -10,7 +10,7 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + scriptText = "# Type a script or drag a script file from your workspace to insert its path. rm "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}" source ~/.bash_profile ENV_PATH="env/dev.json" export KEYSFILE=$ENV_PATH "${SRCROOT}/../node_modules/react-native-keys/keysIOS.js" "${SRCROOT}/../scripts/prepare.js" "$ENV_PATH" "> - - - - diff --git a/template/ios/HelloWorld/AppDelegate.mm b/template/ios/HelloWorld/AppDelegate.mm index 04b86d09..5064dd91 100644 --- a/template/ios/HelloWorld/AppDelegate.mm +++ b/template/ios/HelloWorld/AppDelegate.mm @@ -2,6 +2,7 @@ #import "RNBootSplash.h" #import "Keys.h" #import +#import @implementation AppDelegate @@ -14,29 +15,54 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return [super application:application didFinishLaunchingWithOptions:launchOptions]; } +- (void)customizeRootView:(RCTRootView *)rootView { + NSString *bootsplash = [Keys publicFor:@"SPLASH_STORYBOARD_NAME"]; + [RNBootSplash initWithStoryboard:bootsplash rootView:rootView]; +} + - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { - return [self getBundleURL]; + return [self bundleURL]; } -- (NSURL *)getBundleURL +- (NSURL *)bundleURL { #if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } -- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge - moduleName:(NSString *)moduleName - initProps:(NSDictionary *)initProps { - UIView *rootView = [super createRootViewWithBridge:bridge - moduleName:moduleName - initProps:initProps]; - NSString *bootsplash = [Keys publicFor:@"SPLASH_STORYBOARD_NAME"]; - [RNBootSplash initWithStoryboard:bootsplash rootView:rootView]; // ⬅️ initialize the splash screen - return rootView; +// Linking API +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { + return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options]; +} + +// Universal Links +- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler { + BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; + return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; +} + +// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken +{ + return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } + +// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries +- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error +{ + return [super application:application didFailToRegisterForRemoteNotificationsWithError:error]; +} + +// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler +{ + return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; +} + + @end diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/1024.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/1024.png index 46bf73ec..b45049ca 100644 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/1024.png and b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/1024.png differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/120.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/120.png deleted file mode 100644 index b78b0791..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/120.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/180.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/180.png deleted file mode 100644 index dd02e480..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/180.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/40.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/40.png deleted file mode 100644 index d227c826..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/40.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/58.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/58.png deleted file mode 100644 index a938141a..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/58.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/60.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/60.png deleted file mode 100644 index 9954bf73..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/60.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/80.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/80.png deleted file mode 100644 index 3e7209e6..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/80.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/87.png b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/87.png deleted file mode 100644 index 0677cc02..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/87.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/Contents.json b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/Contents.json index 937391f0..cff1680b 100644 --- a/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/Contents.json +++ b/template/ios/HelloWorld/Images.xcassets/AppIcon-Dev.appiconset/Contents.json @@ -1 +1,14 @@ -{"images":[{"filename":"40.png","idiom":"iphone","scale":"2x","size":"20x20"},{"filename":"60.png","idiom":"iphone","scale":"3x","size":"20x20"},{"filename":"58.png","idiom":"iphone","scale":"2x","size":"29x29"},{"filename":"87.png","idiom":"iphone","scale":"3x","size":"29x29"},{"filename":"80.png","idiom":"iphone","scale":"2x","size":"40x40"},{"filename":"120.png","idiom":"iphone","scale":"3x","size":"40x40"},{"filename":"120.png","idiom":"iphone","scale":"2x","size":"60x60"},{"filename":"180.png","idiom":"iphone","scale":"3x","size":"60x60"},{"filename":"1024.png","idiom":"ios-marketing","scale":"1x","size":"1024x1024"}],"info":{"author":"xcode","version":1}} +{ + "images" : [ + { + "filename" : "1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/1024.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/1024.png index 56b1241c..8f5844e0 100644 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/1024.png and b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/1024.png differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120-1.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120-1.png deleted file mode 100644 index 431b6bc3..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120-1.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120.png deleted file mode 100644 index 431b6bc3..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/120.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/180.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/180.png deleted file mode 100644 index 72cb96c7..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/180.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/40.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/40.png deleted file mode 100644 index d523f810..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/40.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/58.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/58.png deleted file mode 100644 index 4cefd0a7..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/58.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/60.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/60.png deleted file mode 100644 index 9239d4b9..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/60.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/80.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/80.png deleted file mode 100644 index 821776aa..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/80.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/87.png b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/87.png deleted file mode 100644 index 91951a49..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/87.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json index bb1ad4dd..cff1680b 100644 --- a/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,57 +1,9 @@ { "images" : [ - { - "filename" : "40.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "filename" : "60.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "filename" : "58.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "filename" : "87.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "filename" : "80.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "filename" : "120.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "filename" : "120-1.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "filename" : "180.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, { "filename" : "1024.png", - "idiom" : "ios-marketing", - "scale" : "1x", + "idiom" : "universal", + "platform" : "ios", "size" : "1024x1024" } ], diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/Contents.json b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/Contents.json index 570652df..44e57cb3 100644 --- a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/Contents.json +++ b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/Contents.json @@ -2,22 +2,22 @@ "images": [ { "idiom": "universal", - "filename": "bootsplash_logo.png", + "filename": "bootsplash_logo-4cj1tj.png", "scale": "1x" }, { "idiom": "universal", - "filename": "bootsplash_logo@2x.png", + "filename": "bootsplash_logo-4cj1tj@2x.png", "scale": "2x" }, { "idiom": "universal", - "filename": "bootsplash_logo@3x.png", + "filename": "bootsplash_logo-4cj1tj@3x.png", "scale": "3x" } ], "info": { - "version": 1, - "author": "xcode" + "author": "xcode", + "version": 1 } } diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj.png new file mode 100644 index 00000000..78cc7450 Binary files /dev/null and b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj.png differ diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@2x.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@2x.png new file mode 100644 index 00000000..38bd9396 Binary files /dev/null and b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@2x.png differ diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@3x.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@3x.png new file mode 100644 index 00000000..edd30cd9 Binary files /dev/null and b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo-4cj1tj@3x.png differ diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png deleted file mode 100644 index a398a028..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png deleted file mode 100644 index dae0f3f2..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png b/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png deleted file mode 100644 index 2dbc70c3..00000000 Binary files a/template/ios/HelloWorld/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png and /dev/null differ diff --git a/template/ios/HelloWorld/Images.xcassets/Contents.json b/template/ios/HelloWorld/Images.xcassets/Contents.json index 73c00596..2d92bd53 100644 --- a/template/ios/HelloWorld/Images.xcassets/Contents.json +++ b/template/ios/HelloWorld/Images.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "author" : "xcode", - "version" : 1 + "version" : 1, + "author" : "xcode" } } diff --git a/template/ios/HelloWorld/Info.plist b/template/ios/HelloWorld/Info.plist index 163aa3dd..0f0ca686 100644 --- a/template/ios/HelloWorld/Info.plist +++ b/template/ios/HelloWorld/Info.plist @@ -1,53 +1,51 @@ - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - $(APP_DISPLAY_NAME) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(APP_DISPLAY_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - ${VERSION_NAME} - CFBundleSignature - ???? - CFBundleVersion - ${VERSION_CODE} - ITSAppUsesNonExemptEncryption - - LSRequiresIPhoneOS - - NSAppTransportSecurity - NSAllowsArbitraryLoads - - NSAllowsLocalNetworking + CFBundleDevelopmentRegion + en + CFBundleDisplayName + $(APP_DISPLAY_NAME) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(APP_DISPLAY_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + ${VERSION_NAME} + CFBundleSignature + ???? + CFBundleVersion + ${VERSION_CODE} + LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + + NSLocationWhenInUseUsageDescription + + UILaunchStoryboardName + $(SPLASH_STORYBOARD_NAME).storyboard + UIRequiredDeviceCapabilities + + arm64 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UIViewControllerBasedStatusBarAppearance + - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - $(SPLASH_STORYBOARD_NAME).storyboard - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarStyle - UIStatusBarStyleLightContent - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UIViewControllerBasedStatusBarAppearance - - - + \ No newline at end of file diff --git a/template/ios/HelloWorld/PrivacyInfo.xcprivacy b/template/ios/HelloWorld/PrivacyInfo.xcprivacy index ef1896e7..5bb83c5d 100644 --- a/template/ios/HelloWorld/PrivacyInfo.xcprivacy +++ b/template/ios/HelloWorld/PrivacyInfo.xcprivacy @@ -2,37 +2,47 @@ - NSPrivacyCollectedDataTypes - - - NSPrivacyAccessedAPITypes - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp - NSPrivacyAccessedAPITypeReasons - - C617.1 - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryUserDefaults - NSPrivacyAccessedAPITypeReasons - - CA92.1 - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategorySystemBootTime - NSPrivacyAccessedAPITypeReasons - - 35F9.1 - - - - NSPrivacyTracking - + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + 0A2A.1 + 3B52.1 + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + 85F4.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + diff --git a/template/ios/HelloWorld/Splash/BootSplash.storyboard b/template/ios/HelloWorld/Splash/BootSplash.storyboard index 5b697759..8a302bb9 100644 --- a/template/ios/HelloWorld/Splash/BootSplash.storyboard +++ b/template/ios/HelloWorld/Splash/BootSplash.storyboard @@ -1,9 +1,9 @@ - + - + @@ -11,10 +11,10 @@ - - + + - + @@ -24,10 +24,7 @@ - - - - + diff --git a/template/ios/Podfile b/template/ios/Podfile index d60a7e9d..e0c40b95 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -6,14 +6,15 @@ require Pod::Executable.execute_command('node', ['-p', {paths: [process.argv[1]]}, )', __dir__]).strip -platform :ios, '13.4' -install! 'cocoapods', :deterministic_uuids => false -flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled(["Debug"]) +platform :ios, min_ios_version_supported +prepare_react_native_project! + linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end + target 'HelloWorld' do use_expo_modules! post_integrate do |installer| @@ -22,42 +23,37 @@ target 'HelloWorld' do rescue => e Pod::UI.warn e end + begin + expo_patch_react_imports!(installer) + rescue => e + Pod::UI.warn e + end + begin + expo_patch_react_imports!(installer) + rescue => e + Pod::UI.warn e + end + begin + expo_patch_react_imports!(installer) + rescue => e + Pod::UI.warn e + end end config = use_native_modules! use_react_native!( :path => config[:reactNativePath], - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable the next line. - :flipper_configuration => flipper_config, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) - # Fix for Undefined symbols for architecture arm64: - # "_BIO_f_base64", referenced from - pod 'OpenSSL-Universal', :modular_headers => true, :configurations => ['Release'] post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, config[:reactNativePath], - :mac_catalyst_enabled => false + :mac_catalyst_enabled => false, + # :ccache_enabled => true ) - installer.generated_projects.each do |project| - project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' - end - end - end - # For m1 mac - # installer.pods_project.targets.each do |target| - # target.build_configurations.each do |config| - # config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64" - # end - # end end end diff --git a/template/ios/_xcode.env b/template/ios/_xcode.env index 9d643e97..3d5782c7 100644 --- a/template/ios/_xcode.env +++ b/template/ios/_xcode.env @@ -2,9 +2,10 @@ # used when running script phases inside Xcode. # To customize your local environment, you can create an `.xcode.env.local` # file that is not versioned. + # NODE_BINARY variable contains the PATH to the node executable. # # Customize the NODE_BINARY variable here. # For example, to use nvm with brew, add the following line # . "$(brew --prefix nvm)/nvm.sh" --no-use -export NODE_BINARY=$(command -v node) \ No newline at end of file +export NODE_BINARY=$(command -v node) diff --git a/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm b/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm deleted file mode 100644 index b466f089..00000000 --- a/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +++ /dev/null @@ -1,1992 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleObjCpp - * - * We create an umbrella header (and corresponding implementation) here since - * Cxx compilation in BUCK has a limitation: source-code producing genrule()s - * must have a single output. More files => more genrule()s => slower builds. - */ - -#import "FBReactNativeSpec.h" - - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_isReduceMotionEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "isReduceMotionEnabled", @selector(isReduceMotionEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_isTouchExplorationEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "isTouchExplorationEnabled", @selector(isTouchExplorationEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_isAccessibilityServiceEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "isAccessibilityServiceEnabled", @selector(isAccessibilityServiceEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_setAccessibilityFocus(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAccessibilityFocus", @selector(setAccessibilityFocus:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_announceForAccessibility(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "announceForAccessibility", @selector(announceForAccessibility:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityInfoSpecJSI_getRecommendedTimeoutMillis(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getRecommendedTimeoutMillis", @selector(getRecommendedTimeoutMillis:onSuccess:), args, count); - } - - NativeAccessibilityInfoSpecJSI::NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_isReduceMotionEnabled}; - - - methodMap_["isTouchExplorationEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_isTouchExplorationEnabled}; - - - methodMap_["isAccessibilityServiceEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_isAccessibilityServiceEnabled}; - - - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_setAccessibilityFocus}; - - - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_announceForAccessibility}; - - - methodMap_["getRecommendedTimeoutMillis"] = MethodMetadata {2, __hostFunction_NativeAccessibilityInfoSpecJSI_getRecommendedTimeoutMillis}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers) -+ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeAccessibilityManager_SpecAnnounceForAccessibilityWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecAnnounceForAccessibilityWithOptionsOptions:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentBoldTextState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentBoldTextState", @selector(getCurrentBoldTextState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentGrayscaleState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentGrayscaleState", @selector(getCurrentGrayscaleState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentInvertColorsState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentInvertColorsState", @selector(getCurrentInvertColorsState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentReduceMotionState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentReduceMotionState", @selector(getCurrentReduceMotionState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentPrefersCrossFadeTransitionsState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentPrefersCrossFadeTransitionsState", @selector(getCurrentPrefersCrossFadeTransitionsState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentReduceTransparencyState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentReduceTransparencyState", @selector(getCurrentReduceTransparencyState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentVoiceOverState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentVoiceOverState", @selector(getCurrentVoiceOverState:onError:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_setAccessibilityContentSizeMultipliers(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAccessibilityContentSizeMultipliers", @selector(setAccessibilityContentSizeMultipliers:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_setAccessibilityFocus(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAccessibilityFocus", @selector(setAccessibilityFocus:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_announceForAccessibility(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "announceForAccessibility", @selector(announceForAccessibility:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAccessibilityManagerSpecJSI_announceForAccessibilityWithOptions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "announceForAccessibilityWithOptions", @selector(announceForAccessibilityWithOptions:options:), args, count); - } - - NativeAccessibilityManagerSpecJSI::NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentBoldTextState}; - - - methodMap_["getCurrentGrayscaleState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentGrayscaleState}; - - - methodMap_["getCurrentInvertColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentInvertColorsState}; - - - methodMap_["getCurrentReduceMotionState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentReduceMotionState}; - - - methodMap_["getCurrentPrefersCrossFadeTransitionsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentPrefersCrossFadeTransitionsState}; - - - methodMap_["getCurrentReduceTransparencyState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentReduceTransparencyState}; - - - methodMap_["getCurrentVoiceOverState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentVoiceOverState}; - - - methodMap_["setAccessibilityContentSizeMultipliers"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerSpecJSI_setAccessibilityContentSizeMultipliers}; - setMethodArgConversionSelector(@"setAccessibilityContentSizeMultipliers", 0, @"JS_NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers:"); - - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerSpecJSI_setAccessibilityFocus}; - - - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerSpecJSI_announceForAccessibility}; - - - methodMap_["announceForAccessibilityWithOptions"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_announceForAccessibilityWithOptions}; - setMethodArgConversionSelector(@"announceForAccessibilityWithOptions", 1, @"JS_NativeAccessibilityManager_SpecAnnounceForAccessibilityWithOptionsOptions:"); - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeActionSheetManagerSpecJSI_showActionSheetWithOptions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "showActionSheetWithOptions", @selector(showActionSheetWithOptions:callback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeActionSheetManagerSpecJSI_showShareActionSheetWithOptions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "showShareActionSheetWithOptions", @selector(showShareActionSheetWithOptions:failureCallback:successCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeActionSheetManagerSpecJSI_dismissActionSheet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "dismissActionSheet", @selector(dismissActionSheet), args, count); - } - - NativeActionSheetManagerSpecJSI::NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerSpecJSI_showActionSheetWithOptions}; - setMethodArgConversionSelector(@"showActionSheetWithOptions", 0, @"JS_NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions:"); - - methodMap_["showShareActionSheetWithOptions"] = MethodMetadata {3, __hostFunction_NativeActionSheetManagerSpecJSI_showShareActionSheetWithOptions}; - setMethodArgConversionSelector(@"showShareActionSheetWithOptions", 0, @"JS_NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions:"); - - methodMap_["dismissActionSheet"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerSpecJSI_dismissActionSheet}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeAlertManager_Args) -+ (RCTManagedPointer *)JS_NativeAlertManager_Args:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAlertManagerSpecJSI_alertWithArgs(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "alertWithArgs", @selector(alertWithArgs:callback:), args, count); - } - - NativeAlertManagerSpecJSI::NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerSpecJSI_alertWithArgs}; - setMethodArgConversionSelector(@"alertWithArgs", 0, @"JS_NativeAlertManager_Args:"); - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeAnimatedModule_EventMapping) -+ (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_startOperationBatch(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startOperationBatch", @selector(startOperationBatch), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_finishOperationBatch(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "finishOperationBatch", @selector(finishOperationBatch), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_createAnimatedNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "createAnimatedNode", @selector(createAnimatedNode:config:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_updateAnimatedNodeConfig(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "updateAnimatedNodeConfig", @selector(updateAnimatedNodeConfig:config:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_getValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getValue", @selector(getValue:saveValueCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_startListeningToAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startListeningToAnimatedNodeValue", @selector(startListeningToAnimatedNodeValue:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_stopListeningToAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "stopListeningToAnimatedNodeValue", @selector(stopListeningToAnimatedNodeValue:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_connectAnimatedNodes(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "connectAnimatedNodes", @selector(connectAnimatedNodes:childTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_disconnectAnimatedNodes(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "disconnectAnimatedNodes", @selector(disconnectAnimatedNodes:childTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_startAnimatingNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startAnimatingNode", @selector(startAnimatingNode:nodeTag:config:endCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_stopAnimation(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "stopAnimation", @selector(stopAnimation:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_setAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAnimatedNodeValue", @selector(setAnimatedNodeValue:value:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_setAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAnimatedNodeOffset", @selector(setAnimatedNodeOffset:offset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_flattenAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "flattenAnimatedNodeOffset", @selector(flattenAnimatedNodeOffset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_extractAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "extractAnimatedNodeOffset", @selector(extractAnimatedNodeOffset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_connectAnimatedNodeToView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "connectAnimatedNodeToView", @selector(connectAnimatedNodeToView:viewTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_disconnectAnimatedNodeFromView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "disconnectAnimatedNodeFromView", @selector(disconnectAnimatedNodeFromView:viewTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_restoreDefaultValues(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "restoreDefaultValues", @selector(restoreDefaultValues:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_dropAnimatedNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "dropAnimatedNode", @selector(dropAnimatedNode:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_addAnimatedEventToView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addAnimatedEventToView", @selector(addAnimatedEventToView:eventName:eventMapping:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_removeAnimatedEventFromView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeAnimatedEventFromView", @selector(removeAnimatedEventFromView:eventName:animatedNodeTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedModuleSpecJSI_queueAndExecuteBatchedOperations(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "queueAndExecuteBatchedOperations", @selector(queueAndExecuteBatchedOperations:), args, count); - } - - NativeAnimatedModuleSpecJSI::NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleSpecJSI_startOperationBatch}; - - - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleSpecJSI_finishOperationBatch}; - - - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_createAnimatedNode}; - - - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_updateAnimatedNodeConfig}; - - - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_getValue}; - - - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_startListeningToAnimatedNodeValue}; - - - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_stopListeningToAnimatedNodeValue}; - - - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_connectAnimatedNodes}; - - - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_disconnectAnimatedNodes}; - - - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedModuleSpecJSI_startAnimatingNode}; - - - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_stopAnimation}; - - - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_setAnimatedNodeValue}; - - - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_setAnimatedNodeOffset}; - - - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_flattenAnimatedNodeOffset}; - - - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_extractAnimatedNodeOffset}; - - - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_connectAnimatedNodeToView}; - - - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_disconnectAnimatedNodeFromView}; - - - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_restoreDefaultValues}; - - - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_dropAnimatedNode}; - - - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleSpecJSI_addAnimatedEventToView}; - setMethodArgConversionSelector(@"addAnimatedEventToView", 2, @"JS_NativeAnimatedModule_EventMapping:"); - - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleSpecJSI_removeAnimatedEventFromView}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_removeListeners}; - - - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleSpecJSI_queueAndExecuteBatchedOperations}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeAnimatedTurboModule_EventMapping) -+ (RCTManagedPointer *)JS_NativeAnimatedTurboModule_EventMapping:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_startOperationBatch(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startOperationBatch", @selector(startOperationBatch), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_finishOperationBatch(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "finishOperationBatch", @selector(finishOperationBatch), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_createAnimatedNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "createAnimatedNode", @selector(createAnimatedNode:config:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_updateAnimatedNodeConfig(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "updateAnimatedNodeConfig", @selector(updateAnimatedNodeConfig:config:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_getValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getValue", @selector(getValue:saveValueCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_startListeningToAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startListeningToAnimatedNodeValue", @selector(startListeningToAnimatedNodeValue:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_stopListeningToAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "stopListeningToAnimatedNodeValue", @selector(stopListeningToAnimatedNodeValue:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_connectAnimatedNodes(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "connectAnimatedNodes", @selector(connectAnimatedNodes:childTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_disconnectAnimatedNodes(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "disconnectAnimatedNodes", @selector(disconnectAnimatedNodes:childTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_startAnimatingNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startAnimatingNode", @selector(startAnimatingNode:nodeTag:config:endCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_stopAnimation(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "stopAnimation", @selector(stopAnimation:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_setAnimatedNodeValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAnimatedNodeValue", @selector(setAnimatedNodeValue:value:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_setAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setAnimatedNodeOffset", @selector(setAnimatedNodeOffset:offset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_flattenAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "flattenAnimatedNodeOffset", @selector(flattenAnimatedNodeOffset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_extractAnimatedNodeOffset(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "extractAnimatedNodeOffset", @selector(extractAnimatedNodeOffset:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_connectAnimatedNodeToView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "connectAnimatedNodeToView", @selector(connectAnimatedNodeToView:viewTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_disconnectAnimatedNodeFromView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "disconnectAnimatedNodeFromView", @selector(disconnectAnimatedNodeFromView:viewTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_restoreDefaultValues(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "restoreDefaultValues", @selector(restoreDefaultValues:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_dropAnimatedNode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "dropAnimatedNode", @selector(dropAnimatedNode:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_addAnimatedEventToView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addAnimatedEventToView", @selector(addAnimatedEventToView:eventName:eventMapping:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_removeAnimatedEventFromView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeAnimatedEventFromView", @selector(removeAnimatedEventFromView:eventName:animatedNodeTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimatedTurboModuleSpecJSI_queueAndExecuteBatchedOperations(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "queueAndExecuteBatchedOperations", @selector(queueAndExecuteBatchedOperations:), args, count); - } - - NativeAnimatedTurboModuleSpecJSI::NativeAnimatedTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleSpecJSI_startOperationBatch}; - - - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleSpecJSI_finishOperationBatch}; - - - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_createAnimatedNode}; - - - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_updateAnimatedNodeConfig}; - - - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_getValue}; - - - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_startListeningToAnimatedNodeValue}; - - - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_stopListeningToAnimatedNodeValue}; - - - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_connectAnimatedNodes}; - - - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_disconnectAnimatedNodes}; - - - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedTurboModuleSpecJSI_startAnimatingNode}; - - - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_stopAnimation}; - - - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_setAnimatedNodeValue}; - - - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_setAnimatedNodeOffset}; - - - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_flattenAnimatedNodeOffset}; - - - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_extractAnimatedNodeOffset}; - - - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_connectAnimatedNodeToView}; - - - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleSpecJSI_disconnectAnimatedNodeFromView}; - - - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_restoreDefaultValues}; - - - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_dropAnimatedNode}; - - - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleSpecJSI_addAnimatedEventToView}; - setMethodArgConversionSelector(@"addAnimatedEventToView", 2, @"JS_NativeAnimatedTurboModule_EventMapping:"); - - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleSpecJSI_removeAnimatedEventFromView}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_removeListeners}; - - - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleSpecJSI_queueAndExecuteBatchedOperations}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAnimationsDebugModuleSpecJSI_startRecordingFps(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startRecordingFps", @selector(startRecordingFps), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAnimationsDebugModuleSpecJSI_stopRecordingFps(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "stopRecordingFps", @selector(stopRecordingFps:), args, count); - } - - NativeAnimationsDebugModuleSpecJSI::NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["startRecordingFps"] = MethodMetadata {0, __hostFunction_NativeAnimationsDebugModuleSpecJSI_startRecordingFps}; - - - methodMap_["stopRecordingFps"] = MethodMetadata {1, __hostFunction_NativeAnimationsDebugModuleSpecJSI_stopRecordingFps}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAppStateSpecJSI_getCurrentAppState(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getCurrentAppState", @selector(getCurrentAppState:error:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppStateSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppStateSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppStateSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeAppStateSpecJSI::NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateSpecJSI_getCurrentAppState}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppStateSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppStateSpecJSI_removeListeners}; - - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppStateSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeAppearanceSpecJSI_getColorScheme(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, StringKind, "getColorScheme", @selector(getColorScheme), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppearanceSpecJSI_setColorScheme(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setColorScheme", @selector(setColorScheme:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppearanceSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeAppearanceSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeAppearanceSpecJSI::NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceSpecJSI_getColorScheme}; - - - methodMap_["setColorScheme"] = MethodMetadata {1, __hostFunction_NativeAppearanceSpecJSI_setColorScheme}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppearanceSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppearanceSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_addNetworkingHandler(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addNetworkingHandler", @selector(addNetworkingHandler), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_addWebSocketHandler(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addWebSocketHandler", @selector(addWebSocketHandler:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_removeWebSocketHandler(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeWebSocketHandler", @selector(removeWebSocketHandler:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_sendOverSocket(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "sendOverSocket", @selector(sendOverSocket:socketID:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_createFromParts(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "createFromParts", @selector(createFromParts:withId:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_release(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "release", @selector(release:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBlobModuleSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeBlobModuleSpecJSI::NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleSpecJSI_addNetworkingHandler}; - - - methodMap_["addWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleSpecJSI_addWebSocketHandler}; - - - methodMap_["removeWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleSpecJSI_removeWebSocketHandler}; - - - methodMap_["sendOverSocket"] = MethodMetadata {2, __hostFunction_NativeBlobModuleSpecJSI_sendOverSocket}; - - - methodMap_["createFromParts"] = MethodMetadata {2, __hostFunction_NativeBlobModuleSpecJSI_createFromParts}; - - - methodMap_["release"] = MethodMetadata {1, __hostFunction_NativeBlobModuleSpecJSI_release}; - - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeBlobModuleSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeBugReportingSpecJSI_startReportAProblemFlow(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "startReportAProblemFlow", @selector(startReportAProblemFlow), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBugReportingSpecJSI_setExtraData(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setExtraData", @selector(setExtraData:extraFiles:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeBugReportingSpecJSI_setCategoryID(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setCategoryID", @selector(setCategoryID:), args, count); - } - - NativeBugReportingSpecJSI::NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["startReportAProblemFlow"] = MethodMetadata {0, __hostFunction_NativeBugReportingSpecJSI_startReportAProblemFlow}; - - - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeBugReportingSpecJSI_setExtraData}; - - - methodMap_["setCategoryID"] = MethodMetadata {1, __hostFunction_NativeBugReportingSpecJSI_setCategoryID}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeClipboardSpecJSI_getString(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "getString", @selector(getString:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeClipboardSpecJSI_setString(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setString", @selector(setString:), args, count); - } - - NativeClipboardSpecJSI::NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardSpecJSI_getString}; - - - methodMap_["setString"] = MethodMetadata {1, __hostFunction_NativeClipboardSpecJSI_setString}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDevLoadingViewSpecJSI_showMessage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "showMessage", @selector(showMessage:withColor:withBackgroundColor:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevLoadingViewSpecJSI_hide(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "hide", @selector(hide), args, count); - } - - NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewSpecJSI_showMessage}; - - - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeDevLoadingViewSpecJSI_hide}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDevMenuSpecJSI_show(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "show", @selector(show), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevMenuSpecJSI_reload(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reload", @selector(reload), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevMenuSpecJSI_debugRemotely(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "debugRemotely", @selector(debugRemotely:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevMenuSpecJSI_setProfilingEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setProfilingEnabled", @selector(setProfilingEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevMenuSpecJSI_setHotLoadingEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setHotLoadingEnabled", @selector(setHotLoadingEnabled:), args, count); - } - - NativeDevMenuSpecJSI::NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuSpecJSI_show}; - - - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevMenuSpecJSI_reload}; - - - methodMap_["debugRemotely"] = MethodMetadata {1, __hostFunction_NativeDevMenuSpecJSI_debugRemotely}; - - - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuSpecJSI_setProfilingEnabled}; - - - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuSpecJSI_setHotLoadingEnabled}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_reload(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reload", @selector(reload), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_reloadWithReason(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reloadWithReason", @selector(reloadWithReason:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_onFastRefresh(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "onFastRefresh", @selector(onFastRefresh), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_setHotLoadingEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setHotLoadingEnabled", @selector(setHotLoadingEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_setIsDebuggingRemotely(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setIsDebuggingRemotely", @selector(setIsDebuggingRemotely:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_setProfilingEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setProfilingEnabled", @selector(setProfilingEnabled:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_toggleElementInspector(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "toggleElementInspector", @selector(toggleElementInspector), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_addMenuItem(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addMenuItem", @selector(addMenuItem:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevSettingsSpecJSI_setIsShakeToShowDevMenuEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setIsShakeToShowDevMenuEnabled", @selector(setIsShakeToShowDevMenuEnabled:), args, count); - } - - NativeDevSettingsSpecJSI::NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsSpecJSI_reload}; - - - methodMap_["reloadWithReason"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_reloadWithReason}; - - - methodMap_["onFastRefresh"] = MethodMetadata {0, __hostFunction_NativeDevSettingsSpecJSI_onFastRefresh}; - - - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_setHotLoadingEnabled}; - - - methodMap_["setIsDebuggingRemotely"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_setIsDebuggingRemotely}; - - - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_setProfilingEnabled}; - - - methodMap_["toggleElementInspector"] = MethodMetadata {0, __hostFunction_NativeDevSettingsSpecJSI_toggleElementInspector}; - - - methodMap_["addMenuItem"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_addMenuItem}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_removeListeners}; - - - methodMap_["setIsShakeToShowDevMenuEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsSpecJSI_setIsShakeToShowDevMenuEnabled}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDevToolsSettingsManagerSpecJSI_setConsolePatchSettings(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setConsolePatchSettings", @selector(setConsolePatchSettings:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevToolsSettingsManagerSpecJSI_getConsolePatchSettings(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, StringKind, "getConsolePatchSettings", @selector(getConsolePatchSettings), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevToolsSettingsManagerSpecJSI_setProfilingSettings(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setProfilingSettings", @selector(setProfilingSettings:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeDevToolsSettingsManagerSpecJSI_getProfilingSettings(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, StringKind, "getProfilingSettings", @selector(getProfilingSettings), args, count); - } - - NativeDevToolsSettingsManagerSpecJSI::NativeDevToolsSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["setConsolePatchSettings"] = MethodMetadata {1, __hostFunction_NativeDevToolsSettingsManagerSpecJSI_setConsolePatchSettings}; - - - methodMap_["getConsolePatchSettings"] = MethodMetadata {0, __hostFunction_NativeDevToolsSettingsManagerSpecJSI_getConsolePatchSettings}; - - - methodMap_["setProfilingSettings"] = MethodMetadata {1, __hostFunction_NativeDevToolsSettingsManagerSpecJSI_setProfilingSettings}; - - - methodMap_["getProfilingSettings"] = MethodMetadata {0, __hostFunction_NativeDevToolsSettingsManagerSpecJSI_getProfilingSettings}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDeviceEventManagerSpecJSI_invokeDefaultBackPressHandler(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "invokeDefaultBackPressHandler", @selector(invokeDefaultBackPressHandler), args, count); - } - - NativeDeviceEventManagerSpecJSI::NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerSpecJSI_invokeDefaultBackPressHandler}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeDeviceInfoSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeDeviceInfoSpecJSI::NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeExceptionsManager_StackFrame) -+ (RCTManagedPointer *)JS_NativeExceptionsManager_StackFrame:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeExceptionsManager_ExceptionData) -+ (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeExceptionsManagerSpecJSI_reportFatalException(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reportFatalException", @selector(reportFatalException:stack:exceptionId:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeExceptionsManagerSpecJSI_reportSoftException(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reportSoftException", @selector(reportSoftException:stack:exceptionId:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeExceptionsManagerSpecJSI_reportException(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "reportException", @selector(reportException:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeExceptionsManagerSpecJSI_updateExceptionMessage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "updateExceptionMessage", @selector(updateExceptionMessage:stack:exceptionId:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeExceptionsManagerSpecJSI_dismissRedbox(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "dismissRedbox", @selector(dismissRedbox), args, count); - } - - NativeExceptionsManagerSpecJSI::NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerSpecJSI_reportFatalException}; - - - methodMap_["reportSoftException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerSpecJSI_reportSoftException}; - - - methodMap_["reportException"] = MethodMetadata {1, __hostFunction_NativeExceptionsManagerSpecJSI_reportException}; - setMethodArgConversionSelector(@"reportException", 0, @"JS_NativeExceptionsManager_ExceptionData:"); - - methodMap_["updateExceptionMessage"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerSpecJSI_updateExceptionMessage}; - - - methodMap_["dismissRedbox"] = MethodMetadata {0, __hostFunction_NativeExceptionsManagerSpecJSI_dismissRedbox}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeFileReaderModuleSpecJSI_readAsDataURL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "readAsDataURL", @selector(readAsDataURL:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeFileReaderModuleSpecJSI_readAsText(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "readAsText", @selector(readAsText:encoding:resolve:reject:), args, count); - } - - NativeFileReaderModuleSpecJSI::NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleSpecJSI_readAsDataURL}; - - - methodMap_["readAsText"] = MethodMetadata {2, __hostFunction_NativeFileReaderModuleSpecJSI_readAsText}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeFrameRateLogger_SpecSetGlobalOptionsOptions) -+ (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeFrameRateLoggerSpecJSI_setGlobalOptions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setGlobalOptions", @selector(setGlobalOptions:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeFrameRateLoggerSpecJSI_setContext(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setContext", @selector(setContext:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeFrameRateLoggerSpecJSI_beginScroll(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "beginScroll", @selector(beginScroll), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeFrameRateLoggerSpecJSI_endScroll(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "endScroll", @selector(endScroll), args, count); - } - - NativeFrameRateLoggerSpecJSI::NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerSpecJSI_setGlobalOptions}; - setMethodArgConversionSelector(@"setGlobalOptions", 0, @"JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:"); - - methodMap_["setContext"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerSpecJSI_setContext}; - - - methodMap_["beginScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerSpecJSI_beginScroll}; - - - methodMap_["endScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerSpecJSI_endScroll}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskFinished(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "notifyTaskFinished", @selector(notifyTaskFinished:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskRetry(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "notifyTaskRetry", @selector(notifyTaskRetry:resolve:reject:), args, count); - } - - NativeHeadlessJsTaskSupportSpecJSI::NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskFinished}; - - - methodMap_["notifyTaskRetry"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskRetry}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeI18nManagerSpecJSI_allowRTL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "allowRTL", @selector(allowRTL:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeI18nManagerSpecJSI_forceRTL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "forceRTL", @selector(forceRTL:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeI18nManagerSpecJSI_swapLeftAndRightInRTL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "swapLeftAndRightInRTL", @selector(swapLeftAndRightInRTL:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeI18nManagerSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeI18nManagerSpecJSI::NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerSpecJSI_allowRTL}; - - - methodMap_["forceRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerSpecJSI_forceRTL}; - - - methodMap_["swapLeftAndRightInRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerSpecJSI_swapLeftAndRightInRTL}; - - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeI18nManagerSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeImageEditor_OptionsOffset) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsOffset:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeImageEditor_OptionsSize) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsSize:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeImageEditor_OptionsDisplaySize) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsDisplaySize:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativeImageEditor_Options) -+ (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeImageEditorSpecJSI_cropImage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "cropImage", @selector(cropImage:cropData:successCallback:errorCallback:), args, count); - } - - NativeImageEditorSpecJSI::NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorSpecJSI_cropImage}; - setMethodArgConversionSelector(@"cropImage", 1, @"JS_NativeImageEditor_Options:"); - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeImageLoaderIOSSpecJSI_getSize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "getSize", @selector(getSize:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageLoaderIOSSpecJSI_getSizeWithHeaders(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "getSizeWithHeaders", @selector(getSizeWithHeaders:headers:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageLoaderIOSSpecJSI_prefetchImage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "prefetchImage", @selector(prefetchImage:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageLoaderIOSSpecJSI_prefetchImageWithMetadata(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "prefetchImageWithMetadata", @selector(prefetchImageWithMetadata:queryRootName:rootTag:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageLoaderIOSSpecJSI_queryCache(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "queryCache", @selector(queryCache:resolve:reject:), args, count); - } - - NativeImageLoaderIOSSpecJSI::NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSSpecJSI_getSize}; - - - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderIOSSpecJSI_getSizeWithHeaders}; - - - methodMap_["prefetchImage"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSSpecJSI_prefetchImage}; - - - methodMap_["prefetchImageWithMetadata"] = MethodMetadata {3, __hostFunction_NativeImageLoaderIOSSpecJSI_prefetchImageWithMetadata}; - - - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSSpecJSI_queryCache}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeImageStoreIOSSpecJSI_getBase64ForTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getBase64ForTag", @selector(getBase64ForTag:successCallback:errorCallback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageStoreIOSSpecJSI_hasImageForTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "hasImageForTag", @selector(hasImageForTag:callback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageStoreIOSSpecJSI_removeImageForTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeImageForTag", @selector(removeImageForTag:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeImageStoreIOSSpecJSI_addImageFromBase64(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addImageFromBase64", @selector(addImageFromBase64:successCallback:errorCallback:), args, count); - } - - NativeImageStoreIOSSpecJSI::NativeImageStoreIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSSpecJSI_getBase64ForTag}; - - - methodMap_["hasImageForTag"] = MethodMetadata {2, __hostFunction_NativeImageStoreIOSSpecJSI_hasImageForTag}; - - - methodMap_["removeImageForTag"] = MethodMetadata {1, __hostFunction_NativeImageStoreIOSSpecJSI_removeImageForTag}; - - - methodMap_["addImageFromBase64"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSSpecJSI_addImageFromBase64}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeJSCHeapCaptureSpecJSI_captureComplete(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "captureComplete", @selector(captureComplete:error:), args, count); - } - - NativeJSCHeapCaptureSpecJSI::NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureSpecJSI_captureComplete}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeJSCSamplingProfilerSpecJSI_operationComplete(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "operationComplete", @selector(operationComplete:result:error:), args, count); - } - - NativeJSCSamplingProfilerSpecJSI::NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["operationComplete"] = MethodMetadata {3, __hostFunction_NativeJSCSamplingProfilerSpecJSI_operationComplete}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeKeyboardObserverSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeKeyboardObserverSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeKeyboardObserverSpecJSI::NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_getInitialURL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "getInitialURL", @selector(getInitialURL:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_canOpenURL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "canOpenURL", @selector(canOpenURL:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_openURL(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "openURL", @selector(openURL:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_openSettings(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "openSettings", @selector(openSettings:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLinkingManagerSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeLinkingManagerSpecJSI::NativeLinkingManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerSpecJSI_getInitialURL}; - - - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerSpecJSI_canOpenURL}; - - - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerSpecJSI_openURL}; - - - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerSpecJSI_openSettings}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeLogBoxSpecJSI_show(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "show", @selector(show), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeLogBoxSpecJSI_hide(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "hide", @selector(hide), args, count); - } - - NativeLogBoxSpecJSI::NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxSpecJSI_show}; - - - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeLogBoxSpecJSI_hide}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeModalManagerSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeModalManagerSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeModalManagerSpecJSI::NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeModalManagerSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeNetworkingIOS_SpecSendRequestQuery) -+ (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeNetworkingIOSSpecJSI_sendRequest(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "sendRequest", @selector(sendRequest:callback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeNetworkingIOSSpecJSI_abortRequest(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "abortRequest", @selector(abortRequest:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeNetworkingIOSSpecJSI_clearCookies(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "clearCookies", @selector(clearCookies:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeNetworkingIOSSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeNetworkingIOSSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeNetworkingIOSSpecJSI::NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSSpecJSI_sendRequest}; - setMethodArgConversionSelector(@"sendRequest", 0, @"JS_NativeNetworkingIOS_SpecSendRequestQuery:"); - - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSSpecJSI_abortRequest}; - - - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSSpecJSI_clearCookies}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativePlatformConstantsIOSSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativePlatformConstantsIOSSpecJSI::NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativePushNotificationManagerIOS_SpecRequestPermissionsPermission) -+ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_SpecRequestPermissionsPermission:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -@implementation RCTCxxConvert (NativePushNotificationManagerIOS_Notification) -+ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_onFinishRemoteNotification(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "onFinishRemoteNotification", @selector(onFinishRemoteNotification:fetchResult:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_setApplicationIconBadgeNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setApplicationIconBadgeNumber", @selector(setApplicationIconBadgeNumber:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_getApplicationIconBadgeNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getApplicationIconBadgeNumber", @selector(getApplicationIconBadgeNumber:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_requestPermissions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "requestPermissions", @selector(requestPermissions:resolve:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_abandonPermissions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "abandonPermissions", @selector(abandonPermissions), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_checkPermissions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "checkPermissions", @selector(checkPermissions:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_presentLocalNotification(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "presentLocalNotification", @selector(presentLocalNotification:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_scheduleLocalNotification(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "scheduleLocalNotification", @selector(scheduleLocalNotification:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_cancelAllLocalNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "cancelAllLocalNotifications", @selector(cancelAllLocalNotifications), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_cancelLocalNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "cancelLocalNotifications", @selector(cancelLocalNotifications:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_getInitialNotification(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "getInitialNotification", @selector(getInitialNotification:reject:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_getScheduledLocalNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getScheduledLocalNotifications", @selector(getScheduledLocalNotifications:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeAllDeliveredNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeAllDeliveredNotifications", @selector(removeAllDeliveredNotifications), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeDeliveredNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeDeliveredNotifications", @selector(removeDeliveredNotifications:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_getDeliveredNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getDeliveredNotifications", @selector(getDeliveredNotifications:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_getAuthorizationStatus(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getAuthorizationStatus", @selector(getAuthorizationStatus:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativePushNotificationManagerIOSSpecJSI::NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSSpecJSI_onFinishRemoteNotification}; - - - methodMap_["setApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_setApplicationIconBadgeNumber}; - - - methodMap_["getApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_getApplicationIconBadgeNumber}; - - - methodMap_["requestPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_requestPermissions}; - setMethodArgConversionSelector(@"requestPermissions", 0, @"JS_NativePushNotificationManagerIOS_SpecRequestPermissionsPermission:"); - - methodMap_["abandonPermissions"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSSpecJSI_abandonPermissions}; - - - methodMap_["checkPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_checkPermissions}; - - - methodMap_["presentLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_presentLocalNotification}; - setMethodArgConversionSelector(@"presentLocalNotification", 0, @"JS_NativePushNotificationManagerIOS_Notification:"); - - methodMap_["scheduleLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_scheduleLocalNotification}; - setMethodArgConversionSelector(@"scheduleLocalNotification", 0, @"JS_NativePushNotificationManagerIOS_Notification:"); - - methodMap_["cancelAllLocalNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSSpecJSI_cancelAllLocalNotifications}; - - - methodMap_["cancelLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_cancelLocalNotifications}; - - - methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSSpecJSI_getInitialNotification}; - - - methodMap_["getScheduledLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_getScheduledLocalNotifications}; - - - methodMap_["removeAllDeliveredNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeAllDeliveredNotifications}; - - - methodMap_["removeDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeDeliveredNotifications}; - - - methodMap_["getDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_getDeliveredNotifications}; - - - methodMap_["getAuthorizationStatus"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_getAuthorizationStatus}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeRedBoxSpecJSI_setExtraData(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setExtraData", @selector(setExtraData:forIdentifier:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeRedBoxSpecJSI_dismiss(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "dismiss", @selector(dismiss), args, count); - } - - NativeRedBoxSpecJSI::NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxSpecJSI_setExtraData}; - - - methodMap_["dismiss"] = MethodMetadata {0, __hostFunction_NativeRedBoxSpecJSI_dismiss}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeSegmentFetcherSpecJSI_fetchSegment(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "fetchSegment", @selector(fetchSegment:options:callback:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeSegmentFetcherSpecJSI_getSegment(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getSegment", @selector(getSegment:options:callback:), args, count); - } - - NativeSegmentFetcherSpecJSI::NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherSpecJSI_fetchSegment}; - - - methodMap_["getSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherSpecJSI_getSegment}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeSettingsManagerSpecJSI_setValues(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setValues", @selector(setValues:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeSettingsManagerSpecJSI_deleteValues(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "deleteValues", @selector(deleteValues:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeSettingsManagerSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeSettingsManagerSpecJSI::NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerSpecJSI_setValues}; - - - methodMap_["deleteValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerSpecJSI_deleteValues}; - - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSettingsManagerSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeShareModule_SpecShareContent) -+ (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeShareModuleSpecJSI_share(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, PromiseKind, "share", @selector(share:dialogTitle:resolve:reject:), args, count); - } - - NativeShareModuleSpecJSI::NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleSpecJSI_share}; - setMethodArgConversionSelector(@"share", 0, @"JS_NativeShareModule_SpecShareContent:"); - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeSoundManagerSpecJSI_playTouchSound(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "playTouchSound", @selector(playTouchSound), args, count); - } - - NativeSoundManagerSpecJSI::NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerSpecJSI_playTouchSound}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeSourceCodeSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeSourceCodeSpecJSI::NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_getHeight(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "getHeight", @selector(getHeight:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_setNetworkActivityIndicatorVisible(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setNetworkActivityIndicatorVisible", @selector(setNetworkActivityIndicatorVisible:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_setStyle(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setStyle", @selector(setStyle:animated:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_setHidden(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setHidden", @selector(setHidden:withAnimation:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeStatusBarManagerIOSSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); - } - - NativeStatusBarManagerIOSSpecJSI::NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_getHeight}; - - - methodMap_["setNetworkActivityIndicatorVisible"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_setNetworkActivityIndicatorVisible}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_removeListeners}; - - - methodMap_["setStyle"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSSpecJSI_setStyle}; - - - methodMap_["setHidden"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSSpecJSI_setHidden}; - - - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerIOSSpecJSI_getConstants}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeTimingSpecJSI_createTimer(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "createTimer", @selector(createTimer:duration:jsSchedulingTime:repeats:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeTimingSpecJSI_deleteTimer(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "deleteTimer", @selector(deleteTimer:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeTimingSpecJSI_setSendIdleEvents(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "setSendIdleEvents", @selector(setSendIdleEvents:), args, count); - } - - NativeTimingSpecJSI::NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingSpecJSI_createTimer}; - - - methodMap_["deleteTimer"] = MethodMetadata {1, __hostFunction_NativeTimingSpecJSI_deleteTimer}; - - - methodMap_["setSendIdleEvents"] = MethodMetadata {1, __hostFunction_NativeTimingSpecJSI_setSendIdleEvents}; - - } - } // namespace react -} // namespace facebook - -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeVibrationSpecJSI_vibrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "vibrate", @selector(vibrate:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeVibrationSpecJSI_vibrateByPattern(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "vibrateByPattern", @selector(vibrateByPattern:repeat:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeVibrationSpecJSI_cancel(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "cancel", @selector(cancel), args, count); - } - - NativeVibrationSpecJSI::NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationSpecJSI_vibrate}; - - - methodMap_["vibrateByPattern"] = MethodMetadata {2, __hostFunction_NativeVibrationSpecJSI_vibrateByPattern}; - - - methodMap_["cancel"] = MethodMetadata {0, __hostFunction_NativeVibrationSpecJSI_cancel}; - - } - } // namespace react -} // namespace facebook -@implementation RCTCxxConvert (NativeWebSocketModule_SpecConnectOptions) -+ (RCTManagedPointer *)JS_NativeWebSocketModule_SpecConnectOptions:(id)json -{ - return facebook::react::managedPointer(json); -} -@end -namespace facebook { - namespace react { - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_connect(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "connect", @selector(connect:protocols:options:socketID:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_send(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "send", @selector(send:forSocketID:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_sendBinary(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "sendBinary", @selector(sendBinary:forSocketID:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_ping(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "ping", @selector(ping:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_close(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "close", @selector(close:reason:socketID:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count); - } - - static facebook::jsi::Value __hostFunction_NativeWebSocketModuleSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count); - } - - NativeWebSocketModuleSpecJSI::NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleSpecJSI_connect}; - setMethodArgConversionSelector(@"connect", 2, @"JS_NativeWebSocketModule_SpecConnectOptions:"); - - methodMap_["send"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleSpecJSI_send}; - - - methodMap_["sendBinary"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleSpecJSI_sendBinary}; - - - methodMap_["ping"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleSpecJSI_ping}; - - - methodMap_["close"] = MethodMetadata {3, __hostFunction_NativeWebSocketModuleSpecJSI_close}; - - - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleSpecJSI_addListener}; - - - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleSpecJSI_removeListeners}; - - } - } // namespace react -} // namespace facebook diff --git a/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h b/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h deleted file mode 100644 index 551b0a77..00000000 --- a/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +++ /dev/null @@ -1,2431 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleObjCpp - * - * We create an umbrella header (and corresponding implementation) here since - * Cxx compilation in BUCK has a limitation: source-code producing genrule()s - * must have a single output. More files => more genrule()s => slower builds. - */ - -#ifndef __cplusplus -#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. -#endif -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - - -@protocol NativeAccessibilityInfoSpec - -- (void)isReduceMotionEnabled:(RCTResponseSenderBlock)onSuccess; -- (void)isTouchExplorationEnabled:(RCTResponseSenderBlock)onSuccess; -- (void)isAccessibilityServiceEnabled:(RCTResponseSenderBlock)onSuccess; -- (void)setAccessibilityFocus:(double)reactTag; -- (void)announceForAccessibility:(NSString *)announcement; -- (void)getRecommendedTimeoutMillis:(double)mSec - onSuccess:(RCTResponseSenderBlock)onSuccess; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAccessibilityInfo' - */ - class JSI_EXPORT NativeAccessibilityInfoSpecJSI : public ObjCTurboModule { - public: - NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeAccessibilityManager { - struct SpecSetAccessibilityContentSizeMultipliersJSMultipliers { - std::optional extraSmall() const; - std::optional small() const; - std::optional medium() const; - std::optional large() const; - std::optional extraLarge() const; - std::optional extraExtraLarge() const; - std::optional extraExtraExtraLarge() const; - std::optional accessibilityMedium() const; - std::optional accessibilityLarge() const; - std::optional accessibilityExtraLarge() const; - std::optional accessibilityExtraExtraLarge() const; - std::optional accessibilityExtraExtraExtraLarge() const; - - SpecSetAccessibilityContentSizeMultipliersJSMultipliers(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers) -+ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers:(id)json; -@end -namespace JS { - namespace NativeAccessibilityManager { - struct SpecAnnounceForAccessibilityWithOptionsOptions { - std::optional queue() const; - - SpecAnnounceForAccessibilityWithOptionsOptions(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeAccessibilityManager_SpecAnnounceForAccessibilityWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecAnnounceForAccessibilityWithOptionsOptions:(id)json; -@end -@protocol NativeAccessibilityManagerSpec - -- (void)getCurrentBoldTextState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentGrayscaleState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentInvertColorsState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentReduceMotionState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentPrefersCrossFadeTransitionsState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentReduceTransparencyState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)getCurrentVoiceOverState:(RCTResponseSenderBlock)onSuccess - onError:(RCTResponseSenderBlock)onError; -- (void)setAccessibilityContentSizeMultipliers:(JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers &)JSMultipliers; -- (void)setAccessibilityFocus:(double)reactTag; -- (void)announceForAccessibility:(NSString *)announcement; -- (void)announceForAccessibilityWithOptions:(NSString *)announcement - options:(JS::NativeAccessibilityManager::SpecAnnounceForAccessibilityWithOptionsOptions &)options; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAccessibilityManager' - */ - class JSI_EXPORT NativeAccessibilityManagerSpecJSI : public ObjCTurboModule { - public: - NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeActionSheetManager { - struct SpecShowActionSheetWithOptionsOptions { - NSString *title() const; - NSString *message() const; - std::optional> options() const; - std::optional> destructiveButtonIndices() const; - std::optional cancelButtonIndex() const; - std::optional anchor() const; - std::optional tintColor() const; - std::optional cancelButtonTintColor() const; - NSString *userInterfaceStyle() const; - std::optional> disabledButtonIndices() const; - - SpecShowActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions:(id)json; -@end -namespace JS { - namespace NativeActionSheetManager { - struct SpecShowShareActionSheetWithOptionsOptions { - NSString *message() const; - NSString *url() const; - NSString *subject() const; - std::optional anchor() const; - std::optional tintColor() const; - std::optional cancelButtonTintColor() const; - std::optional> excludedActivityTypes() const; - NSString *userInterfaceStyle() const; - - SpecShowShareActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions) -+ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions:(id)json; -@end -@protocol NativeActionSheetManagerSpec - -- (void)showActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)options - callback:(RCTResponseSenderBlock)callback; -- (void)showShareActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options - failureCallback:(RCTResponseSenderBlock)failureCallback - successCallback:(RCTResponseSenderBlock)successCallback; -- (void)dismissActionSheet; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeActionSheetManager' - */ - class JSI_EXPORT NativeActionSheetManagerSpecJSI : public ObjCTurboModule { - public: - NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeAlertManager { - struct Args { - NSString *title() const; - NSString *message() const; - std::optional >> buttons() const; - NSString *type() const; - NSString *defaultValue() const; - NSString *cancelButtonKey() const; - NSString *destructiveButtonKey() const; - NSString *preferredButtonKey() const; - NSString *keyboardType() const; - NSString *userInterfaceStyle() const; - - Args(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeAlertManager_Args) -+ (RCTManagedPointer *)JS_NativeAlertManager_Args:(id)json; -@end -@protocol NativeAlertManagerSpec - -- (void)alertWithArgs:(JS::NativeAlertManager::Args &)args - callback:(RCTResponseSenderBlock)callback; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAlertManager' - */ - class JSI_EXPORT NativeAlertManagerSpecJSI : public ObjCTurboModule { - public: - NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeAnimatedModule { - struct EventMapping { - facebook::react::LazyVector nativeEventPath() const; - std::optional animatedValueTag() const; - - EventMapping(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeAnimatedModule_EventMapping) -+ (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json; -@end -@protocol NativeAnimatedModuleSpec - -- (void)startOperationBatch; -- (void)finishOperationBatch; -- (void)createAnimatedNode:(double)tag - config:(NSDictionary *)config; -- (void)updateAnimatedNodeConfig:(double)tag - config:(NSDictionary *)config; -- (void)getValue:(double)tag -saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; -- (void)startListeningToAnimatedNodeValue:(double)tag; -- (void)stopListeningToAnimatedNodeValue:(double)tag; -- (void)connectAnimatedNodes:(double)parentTag - childTag:(double)childTag; -- (void)disconnectAnimatedNodes:(double)parentTag - childTag:(double)childTag; -- (void)startAnimatingNode:(double)animationId - nodeTag:(double)nodeTag - config:(NSDictionary *)config - endCallback:(RCTResponseSenderBlock)endCallback; -- (void)stopAnimation:(double)animationId; -- (void)setAnimatedNodeValue:(double)nodeTag - value:(double)value; -- (void)setAnimatedNodeOffset:(double)nodeTag - offset:(double)offset; -- (void)flattenAnimatedNodeOffset:(double)nodeTag; -- (void)extractAnimatedNodeOffset:(double)nodeTag; -- (void)connectAnimatedNodeToView:(double)nodeTag - viewTag:(double)viewTag; -- (void)disconnectAnimatedNodeFromView:(double)nodeTag - viewTag:(double)viewTag; -- (void)restoreDefaultValues:(double)nodeTag; -- (void)dropAnimatedNode:(double)tag; -- (void)addAnimatedEventToView:(double)viewTag - eventName:(NSString *)eventName - eventMapping:(JS::NativeAnimatedModule::EventMapping &)eventMapping; -- (void)removeAnimatedEventFromView:(double)viewTag - eventName:(NSString *)eventName - animatedNodeTag:(double)animatedNodeTag; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; -- (void)queueAndExecuteBatchedOperations:(NSArray *)operationsAndArgs; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAnimatedModule' - */ - class JSI_EXPORT NativeAnimatedModuleSpecJSI : public ObjCTurboModule { - public: - NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeAnimatedTurboModule { - struct EventMapping { - facebook::react::LazyVector nativeEventPath() const; - std::optional animatedValueTag() const; - - EventMapping(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeAnimatedTurboModule_EventMapping) -+ (RCTManagedPointer *)JS_NativeAnimatedTurboModule_EventMapping:(id)json; -@end -@protocol NativeAnimatedTurboModuleSpec - -- (void)startOperationBatch; -- (void)finishOperationBatch; -- (void)createAnimatedNode:(double)tag - config:(NSDictionary *)config; -- (void)updateAnimatedNodeConfig:(double)tag - config:(NSDictionary *)config; -- (void)getValue:(double)tag -saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; -- (void)startListeningToAnimatedNodeValue:(double)tag; -- (void)stopListeningToAnimatedNodeValue:(double)tag; -- (void)connectAnimatedNodes:(double)parentTag - childTag:(double)childTag; -- (void)disconnectAnimatedNodes:(double)parentTag - childTag:(double)childTag; -- (void)startAnimatingNode:(double)animationId - nodeTag:(double)nodeTag - config:(NSDictionary *)config - endCallback:(RCTResponseSenderBlock)endCallback; -- (void)stopAnimation:(double)animationId; -- (void)setAnimatedNodeValue:(double)nodeTag - value:(double)value; -- (void)setAnimatedNodeOffset:(double)nodeTag - offset:(double)offset; -- (void)flattenAnimatedNodeOffset:(double)nodeTag; -- (void)extractAnimatedNodeOffset:(double)nodeTag; -- (void)connectAnimatedNodeToView:(double)nodeTag - viewTag:(double)viewTag; -- (void)disconnectAnimatedNodeFromView:(double)nodeTag - viewTag:(double)viewTag; -- (void)restoreDefaultValues:(double)nodeTag; -- (void)dropAnimatedNode:(double)tag; -- (void)addAnimatedEventToView:(double)viewTag - eventName:(NSString *)eventName - eventMapping:(JS::NativeAnimatedTurboModule::EventMapping &)eventMapping; -- (void)removeAnimatedEventFromView:(double)viewTag - eventName:(NSString *)eventName - animatedNodeTag:(double)animatedNodeTag; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; -- (void)queueAndExecuteBatchedOperations:(NSArray *)operationsAndArgs; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAnimatedTurboModule' - */ - class JSI_EXPORT NativeAnimatedTurboModuleSpecJSI : public ObjCTurboModule { - public: - NativeAnimatedTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeAnimationsDebugModuleSpec - -- (void)startRecordingFps; -- (void)stopRecordingFps:(double)animationStopTimeMs; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAnimationsDebugModule' - */ - class JSI_EXPORT NativeAnimationsDebugModuleSpecJSI : public ObjCTurboModule { - public: - NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeAppState { - struct Constants { - - struct Builder { - struct Input { - RCTRequired initialAppState; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeAppStateSpec - -- (void)getCurrentAppState:(RCTResponseSenderBlock)success - error:(RCTResponseSenderBlock)error; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAppState' - */ - class JSI_EXPORT NativeAppStateSpecJSI : public ObjCTurboModule { - public: - NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeAppearanceSpec - -- (NSString * _Nullable)getColorScheme; -- (void)setColorScheme:(NSString *)colorScheme; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeAppearance' - */ - class JSI_EXPORT NativeAppearanceSpecJSI : public ObjCTurboModule { - public: - NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeBlobModule { - struct Constants { - - struct Builder { - struct Input { - RCTRequired BLOB_URI_SCHEME; - RCTRequired BLOB_URI_HOST; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeBlobModuleSpec - -- (void)addNetworkingHandler; -- (void)addWebSocketHandler:(double)id; -- (void)removeWebSocketHandler:(double)id; -- (void)sendOverSocket:(NSDictionary *)blob - socketID:(double)socketID; -- (void)createFromParts:(NSArray *)parts - withId:(NSString *)withId; -- (void)release:(NSString *)blobId; -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeBlobModule' - */ - class JSI_EXPORT NativeBlobModuleSpecJSI : public ObjCTurboModule { - public: - NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeBugReportingSpec - -- (void)startReportAProblemFlow; -- (void)setExtraData:(NSDictionary *)extraData - extraFiles:(NSDictionary *)extraFiles; -- (void)setCategoryID:(NSString *)categoryID; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeBugReporting' - */ - class JSI_EXPORT NativeBugReportingSpecJSI : public ObjCTurboModule { - public: - NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeClipboardSpec - -- (void)getString:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)setString:(NSString *)content; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeClipboard' - */ - class JSI_EXPORT NativeClipboardSpecJSI : public ObjCTurboModule { - public: - NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeDevLoadingViewSpec - -- (void)showMessage:(NSString *)message - withColor:(NSNumber *)withColor -withBackgroundColor:(NSNumber *)withBackgroundColor; -- (void)hide; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDevLoadingView' - */ - class JSI_EXPORT NativeDevLoadingViewSpecJSI : public ObjCTurboModule { - public: - NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeDevMenuSpec - -- (void)show; -- (void)reload; -- (void)debugRemotely:(BOOL)enableDebug; -- (void)setProfilingEnabled:(BOOL)enabled; -- (void)setHotLoadingEnabled:(BOOL)enabled; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDevMenu' - */ - class JSI_EXPORT NativeDevMenuSpecJSI : public ObjCTurboModule { - public: - NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeDevSettingsSpec - -- (void)reload; -- (void)reloadWithReason:(NSString *)reason; -- (void)onFastRefresh; -- (void)setHotLoadingEnabled:(BOOL)isHotLoadingEnabled; -- (void)setIsDebuggingRemotely:(BOOL)isDebuggingRemotelyEnabled; -- (void)setProfilingEnabled:(BOOL)isProfilingEnabled; -- (void)toggleElementInspector; -- (void)addMenuItem:(NSString *)title; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; -- (void)setIsShakeToShowDevMenuEnabled:(BOOL)enabled; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDevSettings' - */ - class JSI_EXPORT NativeDevSettingsSpecJSI : public ObjCTurboModule { - public: - NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeDevToolsSettingsManagerSpec - -- (void)setConsolePatchSettings:(NSString *)newConsolePatchSettings; -- (NSString * _Nullable)getConsolePatchSettings; -- (void)setProfilingSettings:(NSString *)newProfilingSettings; -- (NSString * _Nullable)getProfilingSettings; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDevToolsSettingsManager' - */ - class JSI_EXPORT NativeDevToolsSettingsManagerSpecJSI : public ObjCTurboModule { - public: - NativeDevToolsSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeDeviceEventManagerSpec - -- (void)invokeDefaultBackPressHandler; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDeviceEventManager' - */ - class JSI_EXPORT NativeDeviceEventManagerSpecJSI : public ObjCTurboModule { - public: - NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeDeviceInfo { - struct DisplayMetrics { - - struct Builder { - struct Input { - RCTRequired width; - RCTRequired height; - RCTRequired scale; - RCTRequired fontScale; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing DisplayMetrics */ - Builder(DisplayMetrics i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static DisplayMetrics fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - DisplayMetrics(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -namespace JS { - namespace NativeDeviceInfo { - struct DisplayMetricsAndroid { - - struct Builder { - struct Input { - RCTRequired width; - RCTRequired height; - RCTRequired scale; - RCTRequired fontScale; - RCTRequired densityDpi; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing DisplayMetricsAndroid */ - Builder(DisplayMetricsAndroid i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static DisplayMetricsAndroid fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - DisplayMetricsAndroid(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -namespace JS { - namespace NativeDeviceInfo { - struct DimensionsPayload { - - struct Builder { - struct Input { - std::optional window; - std::optional screen; - std::optional windowPhysicalPixels; - std::optional screenPhysicalPixels; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing DimensionsPayload */ - Builder(DimensionsPayload i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static DimensionsPayload fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - DimensionsPayload(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -namespace JS { - namespace NativeDeviceInfo { - struct Constants { - - struct Builder { - struct Input { - RCTRequired Dimensions; - std::optional isIPhoneX_deprecated; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeDeviceInfoSpec - -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeDeviceInfo' - */ - class JSI_EXPORT NativeDeviceInfoSpecJSI : public ObjCTurboModule { - public: - NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeExceptionsManager { - struct StackFrame { - std::optional column() const; - NSString *file() const; - std::optional lineNumber() const; - NSString *methodName() const; - std::optional collapse() const; - - StackFrame(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeExceptionsManager_StackFrame) -+ (RCTManagedPointer *)JS_NativeExceptionsManager_StackFrame:(id)json; -@end -namespace JS { - namespace NativeExceptionsManager { - struct ExceptionData { - NSString *message() const; - NSString *originalMessage() const; - NSString *name() const; - NSString *componentStack() const; - facebook::react::LazyVector stack() const; - double id_() const; - bool isFatal() const; - id _Nullable extraData() const; - - ExceptionData(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeExceptionsManager_ExceptionData) -+ (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json; -@end -@protocol NativeExceptionsManagerSpec - -- (void)reportFatalException:(NSString *)message - stack:(NSArray *)stack - exceptionId:(double)exceptionId; -- (void)reportSoftException:(NSString *)message - stack:(NSArray *)stack - exceptionId:(double)exceptionId; -- (void)reportException:(JS::NativeExceptionsManager::ExceptionData &)data; -- (void)updateExceptionMessage:(NSString *)message - stack:(NSArray *)stack - exceptionId:(double)exceptionId; -- (void)dismissRedbox; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeExceptionsManager' - */ - class JSI_EXPORT NativeExceptionsManagerSpecJSI : public ObjCTurboModule { - public: - NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeFileReaderModuleSpec - -- (void)readAsDataURL:(NSDictionary *)data - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)readAsText:(NSDictionary *)data - encoding:(NSString *)encoding - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeFileReaderModule' - */ - class JSI_EXPORT NativeFileReaderModuleSpecJSI : public ObjCTurboModule { - public: - NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeFrameRateLogger { - struct SpecSetGlobalOptionsOptions { - std::optional debug() const; - std::optional reportStackTraces() const; - - SpecSetGlobalOptionsOptions(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeFrameRateLogger_SpecSetGlobalOptionsOptions) -+ (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id)json; -@end -@protocol NativeFrameRateLoggerSpec - -- (void)setGlobalOptions:(JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions &)options; -- (void)setContext:(NSString *)context; -- (void)beginScroll; -- (void)endScroll; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeFrameRateLogger' - */ - class JSI_EXPORT NativeFrameRateLoggerSpecJSI : public ObjCTurboModule { - public: - NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeHeadlessJsTaskSupportSpec - -- (void)notifyTaskFinished:(double)taskId; -- (void)notifyTaskRetry:(double)taskId - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeHeadlessJsTaskSupport' - */ - class JSI_EXPORT NativeHeadlessJsTaskSupportSpecJSI : public ObjCTurboModule { - public: - NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeI18nManager { - struct Constants { - - struct Builder { - struct Input { - RCTRequired doLeftAndRightSwapInRTL; - RCTRequired isRTL; - NSString *localeIdentifier; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeI18nManagerSpec - -- (void)allowRTL:(BOOL)allowRTL; -- (void)forceRTL:(BOOL)forceRTL; -- (void)swapLeftAndRightInRTL:(BOOL)flipStyles; -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeI18nManager' - */ - class JSI_EXPORT NativeI18nManagerSpecJSI : public ObjCTurboModule { - public: - NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeImageEditor { - struct OptionsOffset { - double x() const; - double y() const; - - OptionsOffset(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeImageEditor_OptionsOffset) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsOffset:(id)json; -@end -namespace JS { - namespace NativeImageEditor { - struct OptionsSize { - double width() const; - double height() const; - - OptionsSize(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeImageEditor_OptionsSize) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsSize:(id)json; -@end -namespace JS { - namespace NativeImageEditor { - struct OptionsDisplaySize { - double width() const; - double height() const; - - OptionsDisplaySize(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeImageEditor_OptionsDisplaySize) -+ (RCTManagedPointer *)JS_NativeImageEditor_OptionsDisplaySize:(id)json; -@end -namespace JS { - namespace NativeImageEditor { - struct Options { - JS::NativeImageEditor::OptionsOffset offset() const; - JS::NativeImageEditor::OptionsSize size() const; - std::optional displaySize() const; - NSString *resizeMode() const; - std::optional allowExternalStorage() const; - - Options(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeImageEditor_Options) -+ (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json; -@end -@protocol NativeImageEditorSpec - -- (void)cropImage:(NSString *)uri - cropData:(JS::NativeImageEditor::Options &)cropData - successCallback:(RCTResponseSenderBlock)successCallback - errorCallback:(RCTResponseSenderBlock)errorCallback; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeImageEditor' - */ - class JSI_EXPORT NativeImageEditorSpecJSI : public ObjCTurboModule { - public: - NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeImageLoaderIOSSpec - -- (void)getSize:(NSString *)uri - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)getSizeWithHeaders:(NSString *)uri - headers:(NSDictionary *)headers - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)prefetchImage:(NSString *)uri - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)prefetchImageWithMetadata:(NSString *)uri - queryRootName:(NSString *)queryRootName - rootTag:(double)rootTag - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)queryCache:(NSArray *)uris - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeImageLoaderIOS' - */ - class JSI_EXPORT NativeImageLoaderIOSSpecJSI : public ObjCTurboModule { - public: - NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeImageStoreIOSSpec - -- (void)getBase64ForTag:(NSString *)uri - successCallback:(RCTResponseSenderBlock)successCallback - errorCallback:(RCTResponseSenderBlock)errorCallback; -- (void)hasImageForTag:(NSString *)uri - callback:(RCTResponseSenderBlock)callback; -- (void)removeImageForTag:(NSString *)uri; -- (void)addImageFromBase64:(NSString *)base64ImageData - successCallback:(RCTResponseSenderBlock)successCallback - errorCallback:(RCTResponseSenderBlock)errorCallback; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeImageStoreIOS' - */ - class JSI_EXPORT NativeImageStoreIOSSpecJSI : public ObjCTurboModule { - public: - NativeImageStoreIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeJSCHeapCaptureSpec - -- (void)captureComplete:(NSString *)path - error:(NSString * _Nullable)error; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeJSCHeapCapture' - */ - class JSI_EXPORT NativeJSCHeapCaptureSpecJSI : public ObjCTurboModule { - public: - NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeJSCSamplingProfilerSpec - -- (void)operationComplete:(double)token - result:(NSString * _Nullable)result - error:(NSString * _Nullable)error; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeJSCSamplingProfiler' - */ - class JSI_EXPORT NativeJSCSamplingProfilerSpecJSI : public ObjCTurboModule { - public: - NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeKeyboardObserverSpec - -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeKeyboardObserver' - */ - class JSI_EXPORT NativeKeyboardObserverSpecJSI : public ObjCTurboModule { - public: - NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeLinkingManagerSpec - -- (void)getInitialURL:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)canOpenURL:(NSString *)url - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)openURL:(NSString *)url - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)openSettings:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeLinkingManager' - */ - class JSI_EXPORT NativeLinkingManagerSpecJSI : public ObjCTurboModule { - public: - NativeLinkingManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeLogBoxSpec - -- (void)show; -- (void)hide; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeLogBox' - */ - class JSI_EXPORT NativeLogBoxSpecJSI : public ObjCTurboModule { - public: - NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeModalManagerSpec - -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeModalManager' - */ - class JSI_EXPORT NativeModalManagerSpecJSI : public ObjCTurboModule { - public: - NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeNetworkingIOS { - struct SpecSendRequestQuery { - NSString *method() const; - NSString *url() const; - id data() const; - id headers() const; - NSString *responseType() const; - bool incrementalUpdates() const; - double timeout() const; - bool withCredentials() const; - - SpecSendRequestQuery(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeNetworkingIOS_SpecSendRequestQuery) -+ (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json; -@end -@protocol NativeNetworkingIOSSpec - -- (void)sendRequest:(JS::NativeNetworkingIOS::SpecSendRequestQuery &)query - callback:(RCTResponseSenderBlock)callback; -- (void)abortRequest:(double)requestId; -- (void)clearCookies:(RCTResponseSenderBlock)callback; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeNetworkingIOS' - */ - class JSI_EXPORT NativeNetworkingIOSSpecJSI : public ObjCTurboModule { - public: - NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativePlatformConstantsIOS { - struct ConstantsReactNativeVersion { - - struct Builder { - struct Input { - RCTRequired major; - RCTRequired minor; - RCTRequired patch; - RCTRequired> prerelease; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing ConstantsReactNativeVersion */ - Builder(ConstantsReactNativeVersion i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static ConstantsReactNativeVersion fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - ConstantsReactNativeVersion(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -namespace JS { - namespace NativePlatformConstantsIOS { - struct Constants { - - struct Builder { - struct Input { - RCTRequired isTesting; - std::optional isDisableAnimations; - RCTRequired reactNativeVersion; - RCTRequired forceTouchAvailable; - RCTRequired osVersion; - RCTRequired systemName; - RCTRequired interfaceIdiom; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativePlatformConstantsIOSSpec - -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativePlatformConstantsIOS' - */ - class JSI_EXPORT NativePlatformConstantsIOSSpecJSI : public ObjCTurboModule { - public: - NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativePushNotificationManagerIOS { - struct SpecRequestPermissionsPermission { - bool alert() const; - bool badge() const; - bool sound() const; - - SpecRequestPermissionsPermission(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativePushNotificationManagerIOS_SpecRequestPermissionsPermission) -+ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_SpecRequestPermissionsPermission:(id)json; -@end -namespace JS { - namespace NativePushNotificationManagerIOS { - struct Notification { - NSString *alertTitle() const; - std::optional fireDate() const; - NSString *alertBody() const; - NSString *alertAction() const; - id _Nullable userInfo() const; - NSString *category() const; - NSString *repeatInterval() const; - std::optional applicationIconBadgeNumber() const; - std::optional isSilent() const; - NSString *soundName() const; - - Notification(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativePushNotificationManagerIOS_Notification) -+ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json; -@end -@protocol NativePushNotificationManagerIOSSpec - -- (void)onFinishRemoteNotification:(NSString *)notificationId - fetchResult:(NSString *)fetchResult; -- (void)setApplicationIconBadgeNumber:(double)num; -- (void)getApplicationIconBadgeNumber:(RCTResponseSenderBlock)callback; -- (void)requestPermissions:(JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission &)permission - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)abandonPermissions; -- (void)checkPermissions:(RCTResponseSenderBlock)callback; -- (void)presentLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; -- (void)scheduleLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; -- (void)cancelAllLocalNotifications; -- (void)cancelLocalNotifications:(NSDictionary *)userInfo; -- (void)getInitialNotification:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; -- (void)getScheduledLocalNotifications:(RCTResponseSenderBlock)callback; -- (void)removeAllDeliveredNotifications; -- (void)removeDeliveredNotifications:(NSArray *)identifiers; -- (void)getDeliveredNotifications:(RCTResponseSenderBlock)callback; -- (void)getAuthorizationStatus:(RCTResponseSenderBlock)callback; -- (void)addListener:(NSString *)eventType; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativePushNotificationManagerIOS' - */ - class JSI_EXPORT NativePushNotificationManagerIOSSpecJSI : public ObjCTurboModule { - public: - NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeRedBoxSpec - -- (void)setExtraData:(NSDictionary *)extraData - forIdentifier:(NSString *)forIdentifier; -- (void)dismiss; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeRedBox' - */ - class JSI_EXPORT NativeRedBoxSpecJSI : public ObjCTurboModule { - public: - NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeSegmentFetcherSpec - -- (void)fetchSegment:(double)segmentId - options:(NSDictionary *)options - callback:(RCTResponseSenderBlock)callback; -- (void)getSegment:(double)segmentId - options:(NSDictionary *)options - callback:(RCTResponseSenderBlock)callback; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeSegmentFetcher' - */ - class JSI_EXPORT NativeSegmentFetcherSpecJSI : public ObjCTurboModule { - public: - NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeSettingsManager { - struct Constants { - - struct Builder { - struct Input { - RCTRequired > settings; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeSettingsManagerSpec - -- (void)setValues:(NSDictionary *)values; -- (void)deleteValues:(NSArray *)values; -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeSettingsManager' - */ - class JSI_EXPORT NativeSettingsManagerSpecJSI : public ObjCTurboModule { - public: - NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeShareModule { - struct SpecShareContent { - NSString *title() const; - NSString *message() const; - - SpecShareContent(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeShareModule_SpecShareContent) -+ (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json; -@end -@protocol NativeShareModuleSpec - -- (void)share:(JS::NativeShareModule::SpecShareContent &)content - dialogTitle:(NSString *)dialogTitle - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeShareModule' - */ - class JSI_EXPORT NativeShareModuleSpecJSI : public ObjCTurboModule { - public: - NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeSoundManagerSpec - -- (void)playTouchSound; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeSoundManager' - */ - class JSI_EXPORT NativeSoundManagerSpecJSI : public ObjCTurboModule { - public: - NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeSourceCode { - struct Constants { - - struct Builder { - struct Input { - RCTRequired scriptURL; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeSourceCodeSpec - -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeSourceCode' - */ - class JSI_EXPORT NativeSourceCodeSpecJSI : public ObjCTurboModule { - public: - NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeStatusBarManagerIOS { - struct Constants { - - struct Builder { - struct Input { - RCTRequired HEIGHT; - std::optional DEFAULT_BACKGROUND_COLOR; - }; - - /** Initialize with a set of values */ - Builder(const Input i); - /** Initialize with an existing Constants */ - Builder(Constants i); - /** Builds the object. Generally used only by the infrastructure. */ - NSDictionary *buildUnsafeRawValue() const { return _factory(); }; - private: - NSDictionary *(^_factory)(void); - }; - - static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } - NSDictionary *unsafeRawValue() const { return _v; } - private: - Constants(NSDictionary *const v) : _v(v) {} - NSDictionary *_v; - }; - } -} -@protocol NativeStatusBarManagerIOSSpec - -- (void)getHeight:(RCTResponseSenderBlock)callback; -- (void)setNetworkActivityIndicatorVisible:(BOOL)visible; -- (void)addListener:(NSString *)eventType; -- (void)removeListeners:(double)count; -- (void)setStyle:(NSString * _Nullable)statusBarStyle - animated:(BOOL)animated; -- (void)setHidden:(BOOL)hidden - withAnimation:(NSString *)withAnimation; -- (facebook::react::ModuleConstants)constantsToExport; -- (facebook::react::ModuleConstants)getConstants; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeStatusBarManagerIOS' - */ - class JSI_EXPORT NativeStatusBarManagerIOSSpecJSI : public ObjCTurboModule { - public: - NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeTimingSpec - -- (void)createTimer:(double)callbackID - duration:(double)duration - jsSchedulingTime:(double)jsSchedulingTime - repeats:(BOOL)repeats; -- (void)deleteTimer:(double)timerID; -- (void)setSendIdleEvents:(BOOL)sendIdleEvents; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeTiming' - */ - class JSI_EXPORT NativeTimingSpecJSI : public ObjCTurboModule { - public: - NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -@protocol NativeVibrationSpec - -- (void)vibrate:(double)pattern; -- (void)vibrateByPattern:(NSArray *)pattern - repeat:(double)repeat; -- (void)cancel; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeVibration' - */ - class JSI_EXPORT NativeVibrationSpecJSI : public ObjCTurboModule { - public: - NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook -namespace JS { - namespace NativeWebSocketModule { - struct SpecConnectOptions { - id _Nullable headers() const; - - SpecConnectOptions(NSDictionary *const v) : _v(v) {} - private: - NSDictionary *_v; - }; - } -} - -@interface RCTCxxConvert (NativeWebSocketModule_SpecConnectOptions) -+ (RCTManagedPointer *)JS_NativeWebSocketModule_SpecConnectOptions:(id)json; -@end -@protocol NativeWebSocketModuleSpec - -- (void)connect:(NSString *)url - protocols:(NSArray * _Nullable)protocols - options:(JS::NativeWebSocketModule::SpecConnectOptions &)options - socketID:(double)socketID; -- (void)send:(NSString *)message - forSocketID:(double)forSocketID; -- (void)sendBinary:(NSString *)base64String - forSocketID:(double)forSocketID; -- (void)ping:(double)socketID; -- (void)close:(double)code - reason:(NSString *)reason - socketID:(double)socketID; -- (void)addListener:(NSString *)eventName; -- (void)removeListeners:(double)count; - -@end -namespace facebook { - namespace react { - /** - * ObjC++ class for module 'NativeWebSocketModule' - */ - class JSI_EXPORT NativeWebSocketModuleSpecJSI : public ObjCTurboModule { - public: - NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; - } // namespace react -} // namespace facebook - -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraSmall() const -{ - id const p = _v[@"extraSmall"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::small() const -{ - id const p = _v[@"small"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::medium() const -{ - id const p = _v[@"medium"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::large() const -{ - id const p = _v[@"large"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraLarge() const -{ - id const p = _v[@"extraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraLarge() const -{ - id const p = _v[@"extraExtraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraExtraLarge() const -{ - id const p = _v[@"extraExtraExtraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityMedium() const -{ - id const p = _v[@"accessibilityMedium"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityLarge() const -{ - id const p = _v[@"accessibilityLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraLarge() const -{ - id const p = _v[@"accessibilityExtraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraLarge() const -{ - id const p = _v[@"accessibilityExtraExtraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraExtraLarge() const -{ - id const p = _v[@"accessibilityExtraExtraExtraLarge"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeAccessibilityManager::SpecAnnounceForAccessibilityWithOptionsOptions::queue() const -{ - id const p = _v[@"queue"]; - return RCTBridgingToOptionalBool(p); -} -inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::title() const -{ - id const p = _v[@"title"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::message() const -{ - id const p = _v[@"message"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::options() const -{ - id const p = _v[@"options"]; - return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); -} -inline std::optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::destructiveButtonIndices() const -{ - id const p = _v[@"destructiveButtonIndices"]; - return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); -} -inline std::optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonIndex() const -{ - id const p = _v[@"cancelButtonIndex"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::anchor() const -{ - id const p = _v[@"anchor"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::tintColor() const -{ - id const p = _v[@"tintColor"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonTintColor() const -{ - id const p = _v[@"cancelButtonTintColor"]; - return RCTBridgingToOptionalDouble(p); -} -inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::userInterfaceStyle() const -{ - id const p = _v[@"userInterfaceStyle"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::disabledButtonIndices() const -{ - id const p = _v[@"disabledButtonIndices"]; - return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); -} -inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::message() const -{ - id const p = _v[@"message"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::url() const -{ - id const p = _v[@"url"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::subject() const -{ - id const p = _v[@"subject"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::anchor() const -{ - id const p = _v[@"anchor"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::tintColor() const -{ - id const p = _v[@"tintColor"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::cancelButtonTintColor() const -{ - id const p = _v[@"cancelButtonTintColor"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional> JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::excludedActivityTypes() const -{ - id const p = _v[@"excludedActivityTypes"]; - return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); -} -inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::userInterfaceStyle() const -{ - id const p = _v[@"userInterfaceStyle"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::title() const -{ - id const p = _v[@"title"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::message() const -{ - id const p = _v[@"message"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional >> JS::NativeAlertManager::Args::buttons() const -{ - id const p = _v[@"buttons"]; - return RCTBridgingToOptionalVec(p, ^id (id itemValue_0) { return itemValue_0; }); -} -inline NSString *JS::NativeAlertManager::Args::type() const -{ - id const p = _v[@"type"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::defaultValue() const -{ - id const p = _v[@"defaultValue"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::cancelButtonKey() const -{ - id const p = _v[@"cancelButtonKey"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::destructiveButtonKey() const -{ - id const p = _v[@"destructiveButtonKey"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::preferredButtonKey() const -{ - id const p = _v[@"preferredButtonKey"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::keyboardType() const -{ - id const p = _v[@"keyboardType"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeAlertManager::Args::userInterfaceStyle() const -{ - id const p = _v[@"userInterfaceStyle"]; - return RCTBridgingToOptionalString(p); -} -inline facebook::react::LazyVector JS::NativeAnimatedModule::EventMapping::nativeEventPath() const -{ - id const p = _v[@"nativeEventPath"]; - return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); -} -inline std::optional JS::NativeAnimatedModule::EventMapping::animatedValueTag() const -{ - id const p = _v[@"animatedValueTag"]; - return RCTBridgingToOptionalDouble(p); -} -inline facebook::react::LazyVector JS::NativeAnimatedTurboModule::EventMapping::nativeEventPath() const -{ - id const p = _v[@"nativeEventPath"]; - return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); -} -inline std::optional JS::NativeAnimatedTurboModule::EventMapping::animatedValueTag() const -{ - id const p = _v[@"animatedValueTag"]; - return RCTBridgingToOptionalDouble(p); -} - -inline JS::NativeAppState::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto initialAppState = i.initialAppState.get(); - d[@"initialAppState"] = initialAppState; - return d; -}) {} -inline JS::NativeAppState::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} - -inline JS::NativeBlobModule::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto BLOB_URI_SCHEME = i.BLOB_URI_SCHEME.get(); - d[@"BLOB_URI_SCHEME"] = BLOB_URI_SCHEME; - auto BLOB_URI_HOST = i.BLOB_URI_HOST.get(); - d[@"BLOB_URI_HOST"] = BLOB_URI_HOST; - return d; -}) {} -inline JS::NativeBlobModule::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} - - - - - - - -inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto width = i.width.get(); - d[@"width"] = @(width); - auto height = i.height.get(); - d[@"height"] = @(height); - auto scale = i.scale.get(); - d[@"scale"] = @(scale); - auto fontScale = i.fontScale.get(); - d[@"fontScale"] = @(fontScale); - return d; -}) {} -inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(DisplayMetrics i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto width = i.width.get(); - d[@"width"] = @(width); - auto height = i.height.get(); - d[@"height"] = @(height); - auto scale = i.scale.get(); - d[@"scale"] = @(scale); - auto fontScale = i.fontScale.get(); - d[@"fontScale"] = @(fontScale); - auto densityDpi = i.densityDpi.get(); - d[@"densityDpi"] = @(densityDpi); - return d; -}) {} -inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(DisplayMetricsAndroid i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto window = i.window; - d[@"window"] = window.has_value() ? window.value().buildUnsafeRawValue() : nil; - auto screen = i.screen; - d[@"screen"] = screen.has_value() ? screen.value().buildUnsafeRawValue() : nil; - auto windowPhysicalPixels = i.windowPhysicalPixels; - d[@"windowPhysicalPixels"] = windowPhysicalPixels.has_value() ? windowPhysicalPixels.value().buildUnsafeRawValue() : nil; - auto screenPhysicalPixels = i.screenPhysicalPixels; - d[@"screenPhysicalPixels"] = screenPhysicalPixels.has_value() ? screenPhysicalPixels.value().buildUnsafeRawValue() : nil; - return d; -}) {} -inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(DimensionsPayload i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline JS::NativeDeviceInfo::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto Dimensions = i.Dimensions.get(); - d[@"Dimensions"] = Dimensions.buildUnsafeRawValue(); - auto isIPhoneX_deprecated = i.isIPhoneX_deprecated; - d[@"isIPhoneX_deprecated"] = isIPhoneX_deprecated.has_value() ? @((BOOL)isIPhoneX_deprecated.value()) : nil; - return d; -}) {} -inline JS::NativeDeviceInfo::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline std::optional JS::NativeExceptionsManager::StackFrame::column() const -{ - id const p = _v[@"column"]; - return RCTBridgingToOptionalDouble(p); -} -inline NSString *JS::NativeExceptionsManager::StackFrame::file() const -{ - id const p = _v[@"file"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional JS::NativeExceptionsManager::StackFrame::lineNumber() const -{ - id const p = _v[@"lineNumber"]; - return RCTBridgingToOptionalDouble(p); -} -inline NSString *JS::NativeExceptionsManager::StackFrame::methodName() const -{ - id const p = _v[@"methodName"]; - return RCTBridgingToString(p); -} -inline std::optional JS::NativeExceptionsManager::StackFrame::collapse() const -{ - id const p = _v[@"collapse"]; - return RCTBridgingToOptionalBool(p); -} -inline NSString *JS::NativeExceptionsManager::ExceptionData::message() const -{ - id const p = _v[@"message"]; - return RCTBridgingToString(p); -} -inline NSString *JS::NativeExceptionsManager::ExceptionData::originalMessage() const -{ - id const p = _v[@"originalMessage"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeExceptionsManager::ExceptionData::name() const -{ - id const p = _v[@"name"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeExceptionsManager::ExceptionData::componentStack() const -{ - id const p = _v[@"componentStack"]; - return RCTBridgingToOptionalString(p); -} -inline facebook::react::LazyVector JS::NativeExceptionsManager::ExceptionData::stack() const -{ - id const p = _v[@"stack"]; - return RCTBridgingToVec(p, ^JS::NativeExceptionsManager::StackFrame(id itemValue_0) { return JS::NativeExceptionsManager::StackFrame(itemValue_0); }); -} -inline double JS::NativeExceptionsManager::ExceptionData::id_() const -{ - id const p = _v[@"id"]; - return RCTBridgingToDouble(p); -} -inline bool JS::NativeExceptionsManager::ExceptionData::isFatal() const -{ - id const p = _v[@"isFatal"]; - return RCTBridgingToBool(p); -} -inline id _Nullable JS::NativeExceptionsManager::ExceptionData::extraData() const -{ - id const p = _v[@"extraData"]; - return p; -} - -inline std::optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::debug() const -{ - id const p = _v[@"debug"]; - return RCTBridgingToOptionalBool(p); -} -inline std::optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::reportStackTraces() const -{ - id const p = _v[@"reportStackTraces"]; - return RCTBridgingToOptionalBool(p); -} - -inline JS::NativeI18nManager::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto doLeftAndRightSwapInRTL = i.doLeftAndRightSwapInRTL.get(); - d[@"doLeftAndRightSwapInRTL"] = @(doLeftAndRightSwapInRTL); - auto isRTL = i.isRTL.get(); - d[@"isRTL"] = @(isRTL); - auto localeIdentifier = i.localeIdentifier; - d[@"localeIdentifier"] = localeIdentifier; - return d; -}) {} -inline JS::NativeI18nManager::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline double JS::NativeImageEditor::OptionsOffset::x() const -{ - id const p = _v[@"x"]; - return RCTBridgingToDouble(p); -} -inline double JS::NativeImageEditor::OptionsOffset::y() const -{ - id const p = _v[@"y"]; - return RCTBridgingToDouble(p); -} -inline double JS::NativeImageEditor::OptionsSize::width() const -{ - id const p = _v[@"width"]; - return RCTBridgingToDouble(p); -} -inline double JS::NativeImageEditor::OptionsSize::height() const -{ - id const p = _v[@"height"]; - return RCTBridgingToDouble(p); -} -inline double JS::NativeImageEditor::OptionsDisplaySize::width() const -{ - id const p = _v[@"width"]; - return RCTBridgingToDouble(p); -} -inline double JS::NativeImageEditor::OptionsDisplaySize::height() const -{ - id const p = _v[@"height"]; - return RCTBridgingToDouble(p); -} -inline JS::NativeImageEditor::OptionsOffset JS::NativeImageEditor::Options::offset() const -{ - id const p = _v[@"offset"]; - return JS::NativeImageEditor::OptionsOffset(p); -} -inline JS::NativeImageEditor::OptionsSize JS::NativeImageEditor::Options::size() const -{ - id const p = _v[@"size"]; - return JS::NativeImageEditor::OptionsSize(p); -} -inline std::optional JS::NativeImageEditor::Options::displaySize() const -{ - id const p = _v[@"displaySize"]; - return (p == nil ? std::nullopt : std::make_optional(JS::NativeImageEditor::OptionsDisplaySize(p))); -} -inline NSString *JS::NativeImageEditor::Options::resizeMode() const -{ - id const p = _v[@"resizeMode"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional JS::NativeImageEditor::Options::allowExternalStorage() const -{ - id const p = _v[@"allowExternalStorage"]; - return RCTBridgingToOptionalBool(p); -} - - - - - - - - -inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::method() const -{ - id const p = _v[@"method"]; - return RCTBridgingToString(p); -} -inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::url() const -{ - id const p = _v[@"url"]; - return RCTBridgingToString(p); -} -inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::data() const -{ - id const p = _v[@"data"]; - return p; -} -inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::headers() const -{ - id const p = _v[@"headers"]; - return p; -} -inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::responseType() const -{ - id const p = _v[@"responseType"]; - return RCTBridgingToString(p); -} -inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::incrementalUpdates() const -{ - id const p = _v[@"incrementalUpdates"]; - return RCTBridgingToBool(p); -} -inline double JS::NativeNetworkingIOS::SpecSendRequestQuery::timeout() const -{ - id const p = _v[@"timeout"]; - return RCTBridgingToDouble(p); -} -inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::withCredentials() const -{ - id const p = _v[@"withCredentials"]; - return RCTBridgingToBool(p); -} -inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto major = i.major.get(); - d[@"major"] = @(major); - auto minor = i.minor.get(); - d[@"minor"] = @(minor); - auto patch = i.patch.get(); - d[@"patch"] = @(patch); - auto prerelease = i.prerelease.get(); - d[@"prerelease"] = prerelease.has_value() ? @((double)prerelease.value()) : nil; - return d; -}) {} -inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(ConstantsReactNativeVersion i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto isTesting = i.isTesting.get(); - d[@"isTesting"] = @(isTesting); - auto isDisableAnimations = i.isDisableAnimations; - d[@"isDisableAnimations"] = isDisableAnimations.has_value() ? @((BOOL)isDisableAnimations.value()) : nil; - auto reactNativeVersion = i.reactNativeVersion.get(); - d[@"reactNativeVersion"] = reactNativeVersion.buildUnsafeRawValue(); - auto forceTouchAvailable = i.forceTouchAvailable.get(); - d[@"forceTouchAvailable"] = @(forceTouchAvailable); - auto osVersion = i.osVersion.get(); - d[@"osVersion"] = osVersion; - auto systemName = i.systemName.get(); - d[@"systemName"] = systemName; - auto interfaceIdiom = i.interfaceIdiom.get(); - d[@"interfaceIdiom"] = interfaceIdiom; - return d; -}) {} -inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::alert() const -{ - id const p = _v[@"alert"]; - return RCTBridgingToBool(p); -} -inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::badge() const -{ - id const p = _v[@"badge"]; - return RCTBridgingToBool(p); -} -inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::sound() const -{ - id const p = _v[@"sound"]; - return RCTBridgingToBool(p); -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertTitle() const -{ - id const p = _v[@"alertTitle"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional JS::NativePushNotificationManagerIOS::Notification::fireDate() const -{ - id const p = _v[@"fireDate"]; - return RCTBridgingToOptionalDouble(p); -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertBody() const -{ - id const p = _v[@"alertBody"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertAction() const -{ - id const p = _v[@"alertAction"]; - return RCTBridgingToOptionalString(p); -} -inline id _Nullable JS::NativePushNotificationManagerIOS::Notification::userInfo() const -{ - id const p = _v[@"userInfo"]; - return p; -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::category() const -{ - id const p = _v[@"category"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::repeatInterval() const -{ - id const p = _v[@"repeatInterval"]; - return RCTBridgingToOptionalString(p); -} -inline std::optional JS::NativePushNotificationManagerIOS::Notification::applicationIconBadgeNumber() const -{ - id const p = _v[@"applicationIconBadgeNumber"]; - return RCTBridgingToOptionalDouble(p); -} -inline std::optional JS::NativePushNotificationManagerIOS::Notification::isSilent() const -{ - id const p = _v[@"isSilent"]; - return RCTBridgingToOptionalBool(p); -} -inline NSString *JS::NativePushNotificationManagerIOS::Notification::soundName() const -{ - id const p = _v[@"soundName"]; - return RCTBridgingToOptionalString(p); -} - - -inline JS::NativeSettingsManager::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto settings = i.settings.get(); - d[@"settings"] = settings; - return d; -}) {} -inline JS::NativeSettingsManager::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline NSString *JS::NativeShareModule::SpecShareContent::title() const -{ - id const p = _v[@"title"]; - return RCTBridgingToOptionalString(p); -} -inline NSString *JS::NativeShareModule::SpecShareContent::message() const -{ - id const p = _v[@"message"]; - return RCTBridgingToOptionalString(p); -} - -inline JS::NativeSourceCode::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto scriptURL = i.scriptURL.get(); - d[@"scriptURL"] = scriptURL; - return d; -}) {} -inline JS::NativeSourceCode::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} -inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(const Input i) : _factory(^{ - NSMutableDictionary *d = [NSMutableDictionary new]; - auto HEIGHT = i.HEIGHT.get(); - d[@"HEIGHT"] = @(HEIGHT); - auto DEFAULT_BACKGROUND_COLOR = i.DEFAULT_BACKGROUND_COLOR; - d[@"DEFAULT_BACKGROUND_COLOR"] = DEFAULT_BACKGROUND_COLOR.has_value() ? @((double)DEFAULT_BACKGROUND_COLOR.value()) : nil; - return d; -}) {} -inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(Constants i) : _factory(^{ - return i.unsafeRawValue(); -}) {} - - -inline id _Nullable JS::NativeWebSocketModule::SpecConnectOptions::headers() const -{ - id const p = _v[@"headers"]; - return p; -} diff --git a/template/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp b/template/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp deleted file mode 100644 index d2da4454..00000000 --- a/template/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +++ /dev/null @@ -1,2470 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "FBReactNativeSpecJSI.h" - -namespace facebook { -namespace react { - -static jsi::Value __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_setConsolePatchSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setConsolePatchSettings( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_getConsolePatchSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getConsolePatchSettings( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_setProfilingSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingSettings( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_getProfilingSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getProfilingSettings( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} - -NativeDevToolsSettingsManagerCxxSpecJSI::NativeDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevToolsSettingsManager", jsInvoker) { - methodMap_["setConsolePatchSettings"] = MethodMetadata {1, __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_setConsolePatchSettings}; - methodMap_["getConsolePatchSettings"] = MethodMetadata {0, __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_getConsolePatchSettings}; - methodMap_["setProfilingSettings"] = MethodMetadata {1, __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_setProfilingSettings}; - methodMap_["getProfilingSettings"] = MethodMetadata {0, __hostFunction_NativeDevToolsSettingsManagerCxxSpecJSI_getProfilingSettings}; -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrate( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrateByPattern( - rt, - args[0].asObject(rt).asArray(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_cancel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancel( - rt - ); - return jsi::Value::undefined(); -} - -NativeVibrationCxxSpecJSI::NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Vibration", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_getConstants}; - methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationCxxSpecJSI_vibrate}; - methodMap_["vibrateByPattern"] = MethodMetadata {2, __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern}; - methodMap_["cancel"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_cancel}; -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setValues( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteValues( - rt, - args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeSettingsManagerCxxSpecJSI::NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SettingsManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants}; - methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues}; - methodMap_["deleteValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues}; -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - args[0].asString(rt), - args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)), - args[2].asObject(rt), - args[3].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_send(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->send( - rt, - args[0].asString(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendBinary( - rt, - args[0].asString(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->ping( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_close(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->close( - rt, - args[0].asNumber(), - args[1].asString(rt), - args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeWebSocketModuleCxxSpecJSI::NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("WebSocketModule", jsInvoker) { - methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect}; - methodMap_["send"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_send}; - methodMap_["sendBinary"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary}; - methodMap_["ping"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping}; - methodMap_["close"] = MethodMetadata {3, __hostFunction_NativeWebSocketModuleCxxSpecJSI_close}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners}; -} -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() - ); - 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() - ); - 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) - ); - 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() - ); - 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 - ); - return jsi::Value::undefined(); -} - -NativeExceptionsManagerCxxSpecJSI::NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ExceptionsManager", jsInvoker) { - methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException}; - methodMap_["reportSoftException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException}; - methodMap_["reportException"] = MethodMetadata {1, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException}; - methodMap_["updateExceptionMessage"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_updateExceptionMessage}; - methodMap_["dismissRedbox"] = MethodMetadata {0, __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox}; -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_createTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createTimer( - rt, - args[0].asNumber(), - args[1].asNumber(), - args[2].asNumber(), - args[3].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_deleteTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteTimer( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setSendIdleEvents( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeTimingCxxSpecJSI::NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Timing", jsInvoker) { - methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingCxxSpecJSI_createTimer}; - methodMap_["deleteTimer"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_deleteTimer}; - methodMap_["setSendIdleEvents"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents}; -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->fetchSegment( - rt, - args[0].asNumber(), - args[1].asObject(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getSegment( - rt, - args[0].asNumber(), - args[1].asObject(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeSegmentFetcherCxxSpecJSI::NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SegmentFetcher", jsInvoker) { - methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment}; - methodMap_["getSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment}; -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->checkPermission( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermission( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->shouldShowRequestPermissionRationale( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestMultiplePermissions( - rt, - args[0].asObject(rt).asArray(rt) - ); -} - -NativePermissionsAndroidCxxSpecJSI::NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PermissionsAndroid", jsInvoker) { - methodMap_["checkPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission}; - methodMap_["requestPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission}; - methodMap_["shouldShowRequestPermissionRationale"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale}; - methodMap_["requestMultiplePermissions"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions}; -} -static jsi::Value __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->alertWithArgs( - rt, - args[0].asObject(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAlertManagerCxxSpecJSI::NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AlertManager", jsInvoker) { - methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs}; -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showActionSheetWithOptions( - rt, - args[0].asObject(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showShareActionSheetWithOptions( - rt, - args[0].asObject(rt), - args[1].asObject(rt).asFunction(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissActionSheet( - rt - ); - return jsi::Value::undefined(); -} - -NativeActionSheetManagerCxxSpecJSI::NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ActionSheetManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants}; - methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions}; - methodMap_["showShareActionSheetWithOptions"] = MethodMetadata {3, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions}; - methodMap_["dismissActionSheet"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet}; -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showAlert( - rt, - args[0].asObject(rt), - args[1].asObject(rt).asFunction(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeDialogManagerAndroidCxxSpecJSI::NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DialogManagerAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert}; -} -static jsi::Value __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeSourceCodeCxxSpecJSI::NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SourceCode", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_debugRemotely(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->debugRemotely( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevMenuCxxSpecJSI::NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevMenu", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_show}; - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_reload}; - methodMap_["debugRemotely"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_debugRemotely}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled}; -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setExtraData( - rt, - args[0].asObject(rt), - args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_dismiss(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismiss( - rt - ); - return jsi::Value::undefined(); -} - -NativeRedBoxCxxSpecJSI::NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("RedBox", jsInvoker) { - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData}; - methodMap_["dismiss"] = MethodMetadata {0, __hostFunction_NativeRedBoxCxxSpecJSI_dismiss}; -} -static jsi::Value __hostFunction_NativeAnimationsDebugModuleCxxSpecJSI_startRecordingFps(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startRecordingFps( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimationsDebugModuleCxxSpecJSI_stopRecordingFps(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopRecordingFps( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAnimationsDebugModuleCxxSpecJSI::NativeAnimationsDebugModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AnimationsDebugModule", jsInvoker) { - methodMap_["startRecordingFps"] = MethodMetadata {0, __hostFunction_NativeAnimationsDebugModuleCxxSpecJSI_startRecordingFps}; - methodMap_["stopRecordingFps"] = MethodMetadata {1, __hostFunction_NativeAnimationsDebugModuleCxxSpecJSI_stopRecordingFps}; -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeLogBoxCxxSpecJSI::NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LogBox", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_show}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->invokeDefaultBackPressHandler( - rt - ); - return jsi::Value::undefined(); -} - -NativeDeviceEventManagerCxxSpecJSI::NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceEventManager", jsInvoker) { - methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler}; -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reloadWithReason( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFastRefresh( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setIsDebuggingRemotely(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setIsDebuggingRemotely( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->toggleElementInspector( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addMenuItem( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setIsShakeToShowDevMenuEnabled( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevSettingsCxxSpecJSI::NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevSettings", jsInvoker) { - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_reload}; - methodMap_["reloadWithReason"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason}; - methodMap_["onFastRefresh"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled}; - methodMap_["setIsDebuggingRemotely"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setIsDebuggingRemotely}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled}; - methodMap_["toggleElementInspector"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector}; - methodMap_["addMenuItem"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners}; - methodMap_["setIsShakeToShowDevMenuEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled}; -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - args[0].asString(rt), - args[1].asString(rt), - args[2].asNumber(), - args[3].asObject(rt).asArray(rt), - args[4].asObject(rt), - args[5].asString(rt), - args[6].asBool(), - args[7].asNumber(), - args[8].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingAndroidCxxSpecJSI::NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {9, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - args[0].asObject(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingIOSCxxSpecJSI::NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - args[0].asString(rt), - args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImageWithMetadata( - rt, - args[0].asString(rt), - args[1].asString(rt), - args[2].getNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderIOSCxxSpecJSI::NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage}; - methodMap_["prefetchImageWithMetadata"] = MethodMetadata {3, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_cropImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cropImage( - rt, - args[0].asString(rt), - args[1].asObject(rt), - args[2].asObject(rt).asFunction(rt), - args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageEditorCxxSpecJSI::NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageEditingManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageEditorCxxSpecJSI_getConstants}; - methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorCxxSpecJSI_cropImage}; -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - args[0].asString(rt), - args[1].asObject(rt).asFunction(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hasImageForTag( - rt, - args[0].asString(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeImageForTag( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addImageFromBase64( - rt, - args[0].asString(rt), - args[1].asObject(rt).asFunction(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreIOSCxxSpecJSI::NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag}; - methodMap_["hasImageForTag"] = MethodMetadata {2, __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag}; - methodMap_["removeImageForTag"] = MethodMetadata {1, __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag}; - methodMap_["addImageFromBase64"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64}; -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - args[0].asString(rt), - args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - args[0].asString(rt), - args[1].asNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderAndroidCxxSpecJSI::NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest}; - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - args[0].asString(rt), - args[1].asObject(rt).asFunction(rt), - args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreAndroidCxxSpecJSI::NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag}; -} -static jsi::Value __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeDeviceInfoCxxSpecJSI::NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceInfo", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativePlatformConstantsIOSCxxSpecJSI::NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showMessage( - rt, - args[0].asString(rt), - args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()), - args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asNumber()) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeDevLoadingViewCxxSpecJSI::NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevLoadingView", jsInvoker) { - methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getColorScheme( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColorScheme( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppearanceCxxSpecJSI::NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Appearance", jsInvoker) { - methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme}; - methodMap_["setColorScheme"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAndroidID( - rt - ); -} - -NativePlatformConstantsAndroidCxxSpecJSI::NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants}; - methodMap_["getAndroidID"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getHeight( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setNetworkActivityIndicatorVisible( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)), - args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - args[0].asBool(), - args[1].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerIOSCxxSpecJSI::NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants}; - methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight}; - methodMap_["setNetworkActivityIndicatorVisible"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners}; - methodMap_["setStyle"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColor( - rt, - args[0].asNumber(), - args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setTranslucent( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerAndroidCxxSpecJSI::NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["setColor"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor}; - methodMap_["setTranslucent"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent}; - methodMap_["setStyle"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentBoldTextState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentGrayscaleState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentInvertColorsState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceMotionState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentPrefersCrossFadeTransitionsState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceTransparencyState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentVoiceOverState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityContentSizeMultipliers( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibilityWithOptions( - rt, - args[0].asString(rt), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityManagerCxxSpecJSI::NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityManager", jsInvoker) { - methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState}; - methodMap_["getCurrentGrayscaleState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState}; - methodMap_["getCurrentInvertColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState}; - methodMap_["getCurrentReduceMotionState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState}; - methodMap_["getCurrentPrefersCrossFadeTransitionsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState}; - methodMap_["getCurrentReduceTransparencyState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState}; - methodMap_["getCurrentVoiceOverState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState}; - methodMap_["setAccessibilityContentSizeMultipliers"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility}; - methodMap_["announceForAccessibilityWithOptions"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions}; -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isReduceMotionEnabled( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isTouchExplorationEnabled( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isAccessibilityServiceEnabled( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getRecommendedTimeoutMillis( - rt, - args[0].asNumber(), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityInfoCxxSpecJSI::NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityInfo", jsInvoker) { - methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled}; - methodMap_["isTouchExplorationEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled}; - methodMap_["isAccessibilityServiceEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility}; - methodMap_["getRecommendedTimeoutMillis"] = MethodMetadata {2, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis}; -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt, - args[0].asString(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravity( - rt, - args[0].asString(rt), - args[1].asNumber(), - args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravityAndOffset( - rt, - args[0].asString(rt), - args[1].asNumber(), - args[2].asNumber(), - args[3].asNumber(), - args[4].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeToastAndroidCxxSpecJSI::NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ToastAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants}; - methodMap_["show"] = MethodMetadata {2, __hostFunction_NativeToastAndroidCxxSpecJSI_show}; - methodMap_["showWithGravity"] = MethodMetadata {3, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity}; - methodMap_["showWithGravityAndOffset"] = MethodMetadata {5, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset}; -} -static jsi::Value __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->playTouchSound( - rt - ); - return jsi::Value::undefined(); -} - -NativeSoundManagerCxxSpecJSI::NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SoundManager", jsInvoker) { - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound}; -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeKeyboardObserverCxxSpecJSI::NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("KeyboardObserver", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_setString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setString( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeClipboardCxxSpecJSI::NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Clipboard", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getConstants}; - methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getString}; - methodMap_["setString"] = MethodMetadata {1, __hostFunction_NativeClipboardCxxSpecJSI_setString}; -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserve( - rt, - args[0].asNumber(), - jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeIntersectionObserverCxxSpecJSI::NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeIntersectionObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe}; - methodMap_["unobserve"] = MethodMetadata {2, __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve}; - methodMap_["connect"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_unobserve(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserve( - rt, - args[0].asNumber(), - jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeMutationObserverCxxSpecJSI::NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeMutationObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_observe}; - methodMap_["unobserve"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_unobserve}; - methodMap_["connect"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentAppState( - rt, - args[0].asObject(rt).asFunction(rt), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppStateCxxSpecJSI::NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AppState", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppStateCxxSpecJSI_getConstants}; - methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_startReporting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startReporting( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_stopReporting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopReporting( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_setIsBuffered(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setIsBuffered( - rt, - args[0].asObject(rt).asArray(rt), - args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_popPendingEntries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->popPendingEntries( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_setOnPerformanceEntryCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setOnPerformanceEntryCallback( - 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_NativePerformanceObserverCxxSpecJSI_logRawEntry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->logRawEntry( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_getEventCounts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEventCounts( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_setDurationThreshold(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setDurationThreshold( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_clearEntries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearEntries( - rt, - args[0].asNumber(), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceObserverCxxSpecJSI_getEntries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntries( - 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)) - ); -} - -NativePerformanceObserverCxxSpecJSI::NativePerformanceObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativePerformanceObserverCxx", jsInvoker) { - methodMap_["startReporting"] = MethodMetadata {1, __hostFunction_NativePerformanceObserverCxxSpecJSI_startReporting}; - methodMap_["stopReporting"] = MethodMetadata {1, __hostFunction_NativePerformanceObserverCxxSpecJSI_stopReporting}; - methodMap_["setIsBuffered"] = MethodMetadata {2, __hostFunction_NativePerformanceObserverCxxSpecJSI_setIsBuffered}; - methodMap_["popPendingEntries"] = MethodMetadata {0, __hostFunction_NativePerformanceObserverCxxSpecJSI_popPendingEntries}; - methodMap_["setOnPerformanceEntryCallback"] = MethodMetadata {1, __hostFunction_NativePerformanceObserverCxxSpecJSI_setOnPerformanceEntryCallback}; - methodMap_["logRawEntry"] = MethodMetadata {1, __hostFunction_NativePerformanceObserverCxxSpecJSI_logRawEntry}; - methodMap_["getEventCounts"] = MethodMetadata {0, __hostFunction_NativePerformanceObserverCxxSpecJSI_getEventCounts}; - methodMap_["setDurationThreshold"] = MethodMetadata {2, __hostFunction_NativePerformanceObserverCxxSpecJSI_setDurationThreshold}; - methodMap_["clearEntries"] = MethodMetadata {2, __hostFunction_NativePerformanceObserverCxxSpecJSI_clearEntries}; - methodMap_["getEntries"] = MethodMetadata {2, __hostFunction_NativePerformanceObserverCxxSpecJSI_getEntries}; -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_mark(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->mark( - rt, - args[0].asString(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measure( - rt, - args[0].asString(rt), - args[1].asNumber(), - args[2].asNumber(), - count <= 3 || args[3].isNull() || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asNumber()), - count <= 4 || args[4].isNull() || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asString(rt)), - count <= 5 || args[5].isNull() || args[5].isUndefined() ? std::nullopt : std::make_optional(args[5].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSimpleMemoryInfo( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReactNativeStartupTiming( - rt - ); -} - -NativePerformanceCxxSpecJSI::NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativePerformanceCxx", jsInvoker) { - methodMap_["mark"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_mark}; - methodMap_["measure"] = MethodMetadata {6, __hostFunction_NativePerformanceCxxSpecJSI_measure}; - methodMap_["getSimpleMemoryInfo"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo}; - methodMap_["getReactNativeStartupTiming"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming}; -} -static jsi::Value __hostFunction_NativeBugReportingCxxSpecJSI_startReportAProblemFlow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startReportAProblemFlow( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBugReportingCxxSpecJSI_setExtraData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setExtraData( - rt, - args[0].asObject(rt), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBugReportingCxxSpecJSI_setCategoryID(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setCategoryID( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeBugReportingCxxSpecJSI::NativeBugReportingCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("BugReporting", jsInvoker) { - methodMap_["startReportAProblemFlow"] = MethodMetadata {0, __hostFunction_NativeBugReportingCxxSpecJSI_startReportAProblemFlow}; - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeBugReportingCxxSpecJSI_setExtraData}; - methodMap_["setCategoryID"] = MethodMetadata {1, __hostFunction_NativeBugReportingCxxSpecJSI_setCategoryID}; -} -static jsi::Value __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->captureComplete( - rt, - args[0].asString(rt), - args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); - return jsi::Value::undefined(); -} - -NativeJSCHeapCaptureCxxSpecJSI::NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("JSCHeapCapture", jsInvoker) { - methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete}; -} -static jsi::Value __hostFunction_NativeJSCSamplingProfilerCxxSpecJSI_operationComplete(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->operationComplete( - rt, - 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].asString(rt)) - ); - return jsi::Value::undefined(); -} - -NativeJSCSamplingProfilerCxxSpecJSI::NativeJSCSamplingProfilerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("JSCSamplingProfiler", jsInvoker) { - methodMap_["operationComplete"] = MethodMetadata {3, __hostFunction_NativeJSCSamplingProfilerCxxSpecJSI_operationComplete}; -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeModalManagerCxxSpecJSI::NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ModalManager", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsDataURL( - rt, - args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsText( - rt, - args[0].asObject(rt), - args[1].asString(rt) - ); -} - -NativeFileReaderModuleCxxSpecJSI::NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FileReaderModule", jsInvoker) { - methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL}; - methodMap_["readAsText"] = MethodMetadata {2, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText}; -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addNetworkingHandler( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addWebSocketHandler( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeWebSocketHandler( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendOverSocket( - rt, - args[0].asObject(rt), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createFromParts( - rt, - args[0].asObject(rt).asArray(rt), - args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_release(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->release( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeBlobModuleCxxSpecJSI::NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("BlobModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants}; - methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler}; - methodMap_["addWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler}; - methodMap_["removeWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler}; - methodMap_["sendOverSocket"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket}; - methodMap_["createFromParts"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts}; - methodMap_["release"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_release}; -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setGlobalOptions( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setContext( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->beginScroll( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->endScroll( - rt - ); - return jsi::Value::undefined(); -} - -NativeFrameRateLoggerCxxSpecJSI::NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FrameRateLogger", jsInvoker) { - methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions}; - methodMap_["setContext"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext}; - methodMap_["beginScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll}; - methodMap_["endScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll}; -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->allowRTL( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->forceRTL( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->swapLeftAndRightInRTL( - rt, - args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeI18nManagerCxxSpecJSI::NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("I18nManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants}; - methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL}; - methodMap_["forceRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL}; - methodMap_["swapLeftAndRightInRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL}; -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->notifyTaskFinished( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->notifyTaskRetry( - rt, - args[0].asNumber() - ); -} - -NativeHeadlessJsTaskSupportCxxSpecJSI::NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("HeadlessJsTaskSupport", jsInvoker) { - methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished}; - methodMap_["notifyTaskRetry"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry}; -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - args[0].asNumber(), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - args[0].asNumber(), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - args[0].asNumber(), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - args[0].asNumber(), - args[1].asNumber(), - args[2].asObject(rt), - args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - args[0].asNumber(), - args[1].asString(rt), - args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - args[0].asNumber(), - args[1].asString(rt), - args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedTurboModuleCxxSpecJSI::NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedTurboModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - args[0].asNumber(), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - args[0].asNumber(), - args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - args[0].asNumber(), - args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - args[0].asNumber(), - args[1].asNumber(), - args[2].asObject(rt), - args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - args[0].asNumber(), - args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - args[0].asNumber(), - args[1].asString(rt), - args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - args[0].asNumber(), - args[1].asString(rt), - args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedModuleCxxSpecJSI::NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFinishRemoteNotification( - rt, - args[0].asString(rt), - args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setApplicationIconBadgeNumber( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getApplicationIconBadgeNumber( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermissions( - rt, - args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abandonPermissions( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->checkPermissions( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->presentLocalNotification( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->scheduleLocalNotification( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelAllLocalNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelLocalNotifications( - rt, - args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialNotification( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getScheduledLocalNotifications( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAllDeliveredNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeDeliveredNotifications( - rt, - args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getDeliveredNotifications( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getAuthorizationStatus( - rt, - args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativePushNotificationManagerIOSCxxSpecJSI::NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PushNotificationManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants}; - methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification}; - methodMap_["setApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber}; - methodMap_["getApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber}; - methodMap_["requestPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions}; - methodMap_["abandonPermissions"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions}; - methodMap_["checkPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions}; - methodMap_["presentLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification}; - methodMap_["scheduleLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification}; - methodMap_["cancelAllLocalNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications}; - methodMap_["cancelLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications}; - methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification}; - methodMap_["getScheduledLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications}; - methodMap_["removeAllDeliveredNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications}; - methodMap_["removeDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications}; - methodMap_["getDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications}; - methodMap_["getAuthorizationStatus"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeLinkingManagerCxxSpecJSI::NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LinkingManager", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->sendIntent( - rt, - args[0].asString(rt), - args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)) - ); -} - -NativeIntentAndroidCxxSpecJSI::NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("IntentAndroid", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings}; - methodMap_["sendIntent"] = MethodMetadata {2, __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent}; -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_share(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->share( - rt, - args[0].asObject(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); -} - -NativeShareModuleCxxSpecJSI::NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ShareModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeShareModuleCxxSpecJSI_getConstants}; - methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleCxxSpecJSI_share}; -} - - -} // namespace react -} // namespace facebook diff --git a/template/ios/build/generated/ios/FBReactNativeSpecJSI.h b/template/ios/build/generated/ios/FBReactNativeSpecJSI.h deleted file mode 100644 index 38b4b80b..00000000 --- a/template/ios/build/generated/ios/FBReactNativeSpecJSI.h +++ /dev/null @@ -1,6512 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleH.js - */ - -#pragma once - -#include -#include - -namespace facebook { -namespace react { - - - class JSI_EXPORT NativeDevToolsSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setConsolePatchSettings(jsi::Runtime &rt, jsi::String newConsolePatchSettings) = 0; - virtual std::optional getConsolePatchSettings(jsi::Runtime &rt) = 0; - virtual void setProfilingSettings(jsi::Runtime &rt, jsi::String newProfilingSettings) = 0; - virtual std::optional getProfilingSettings(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDevToolsSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DevToolsSettingsManager"; - -protected: - NativeDevToolsSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevToolsSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDevToolsSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevToolsSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void setConsolePatchSettings(jsi::Runtime &rt, jsi::String newConsolePatchSettings) override { - static_assert( - bridging::getParameterCount(&T::setConsolePatchSettings) == 2, - "Expected setConsolePatchSettings(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setConsolePatchSettings, jsInvoker_, instance_, std::move(newConsolePatchSettings)); - } - std::optional getConsolePatchSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConsolePatchSettings) == 1, - "Expected getConsolePatchSettings(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getConsolePatchSettings, jsInvoker_, instance_); - } - void setProfilingSettings(jsi::Runtime &rt, jsi::String newProfilingSettings) override { - static_assert( - bridging::getParameterCount(&T::setProfilingSettings) == 2, - "Expected setProfilingSettings(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingSettings, jsInvoker_, instance_, std::move(newProfilingSettings)); - } - std::optional getProfilingSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getProfilingSettings) == 1, - "Expected getProfilingSettings(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getProfilingSettings, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeVibrationCxxSpecJSI : public TurboModule { -protected: - NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void vibrate(jsi::Runtime &rt, double pattern) = 0; - virtual void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) = 0; - virtual void cancel(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeVibrationCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Vibration"; - -protected: - NativeVibrationCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeVibrationCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeVibrationCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeVibrationCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void vibrate(jsi::Runtime &rt, double pattern) override { - static_assert( - bridging::getParameterCount(&T::vibrate) == 2, - "Expected vibrate(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::vibrate, jsInvoker_, instance_, std::move(pattern)); - } - void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) override { - static_assert( - bridging::getParameterCount(&T::vibrateByPattern) == 3, - "Expected vibrateByPattern(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::vibrateByPattern, jsInvoker_, instance_, std::move(pattern), std::move(repeat)); - } - void cancel(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancel) == 1, - "Expected cancel(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancel, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setValues(jsi::Runtime &rt, jsi::Object values) = 0; - virtual void deleteValues(jsi::Runtime &rt, jsi::Array values) = 0; - -}; - -template -class JSI_EXPORT NativeSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "SettingsManager"; - -protected: - NativeSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setValues(jsi::Runtime &rt, jsi::Object values) override { - static_assert( - bridging::getParameterCount(&T::setValues) == 2, - "Expected setValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setValues, jsInvoker_, instance_, std::move(values)); - } - void deleteValues(jsi::Runtime &rt, jsi::Array values) override { - static_assert( - bridging::getParameterCount(&T::deleteValues) == 2, - "Expected deleteValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteValues, jsInvoker_, instance_, std::move(values)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeWebSocketModuleCxxSpecJSI : public TurboModule { -protected: - NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) = 0; - virtual void send(jsi::Runtime &rt, jsi::String message, double forSocketID) = 0; - virtual void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) = 0; - virtual void ping(jsi::Runtime &rt, double socketID) = 0; - virtual void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeWebSocketModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "WebSocketModule"; - -protected: - NativeWebSocketModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeWebSocketModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeWebSocketModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeWebSocketModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) override { - static_assert( - bridging::getParameterCount(&T::connect) == 5, - "Expected connect(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(url), std::move(protocols), std::move(options), std::move(socketID)); - } - void send(jsi::Runtime &rt, jsi::String message, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::send) == 3, - "Expected send(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::send, jsInvoker_, instance_, std::move(message), std::move(forSocketID)); - } - void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::sendBinary) == 3, - "Expected sendBinary(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendBinary, jsInvoker_, instance_, std::move(base64String), std::move(forSocketID)); - } - void ping(jsi::Runtime &rt, double socketID) override { - static_assert( - bridging::getParameterCount(&T::ping) == 2, - "Expected ping(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::ping, jsInvoker_, instance_, std::move(socketID)); - } - void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) override { - static_assert( - bridging::getParameterCount(&T::close) == 4, - "Expected close(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::close, jsInvoker_, instance_, std::move(code), std::move(reason), std::move(socketID)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - ExceptionsManagerBaseStackFrame - -template -struct ExceptionsManagerBaseStackFrame { - P0 column; - P1 file; - P2 lineNumber; - P3 methodName; - P4 collapse; - bool operator==(const ExceptionsManagerBaseStackFrame &other) const { - return column == other.column && file == other.file && lineNumber == other.lineNumber && methodName == other.methodName && collapse == other.collapse; - } -}; - -template -struct ExceptionsManagerBaseStackFrameBridging { - static ExceptionsManagerBaseStackFrame fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - ExceptionsManagerBaseStackFrame result{ - bridging::fromJs(rt, value.getProperty(rt, "column"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "file"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "lineNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "methodName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "collapse"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional columnToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static std::optional fileToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static std::optional lineNumberToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::String methodNameToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static bool collapseToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const ExceptionsManagerBaseStackFrame &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "column", bridging::toJs(rt, value.column, jsInvoker)); - result.setProperty(rt, "file", bridging::toJs(rt, value.file, jsInvoker)); - result.setProperty(rt, "lineNumber", bridging::toJs(rt, value.lineNumber, jsInvoker)); - result.setProperty(rt, "methodName", bridging::toJs(rt, value.methodName, jsInvoker)); - if (value.collapse) { - result.setProperty(rt, "collapse", bridging::toJs(rt, value.collapse.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - ExceptionsManagerBaseExceptionData - -template -struct ExceptionsManagerBaseExceptionData { - P0 message; - P1 originalMessage; - P2 name; - P3 componentStack; - P4 stack; - P5 id; - P6 isFatal; - P7 extraData; - bool operator==(const ExceptionsManagerBaseExceptionData &other) const { - return message == other.message && originalMessage == other.originalMessage && name == other.name && componentStack == other.componentStack && stack == other.stack && id == other.id && isFatal == other.isFatal && extraData == other.extraData; - } -}; - -template -struct ExceptionsManagerBaseExceptionDataBridging { - static ExceptionsManagerBaseExceptionData fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - ExceptionsManagerBaseExceptionData result{ - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "originalMessage"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "componentStack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "stack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "id"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isFatal"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "extraData"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String messageToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static std::optional originalMessageToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static std::optional nameToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static std::optional componentStackToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array stackToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static double idToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static bool isFatalToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object extraDataToJs(jsi::Runtime &rt, P7 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const ExceptionsManagerBaseExceptionData &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "message", bridging::toJs(rt, value.message, jsInvoker)); - result.setProperty(rt, "originalMessage", bridging::toJs(rt, value.originalMessage, jsInvoker)); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "componentStack", bridging::toJs(rt, value.componentStack, jsInvoker)); - result.setProperty(rt, "stack", bridging::toJs(rt, value.stack, jsInvoker)); - result.setProperty(rt, "id", bridging::toJs(rt, value.id, jsInvoker)); - result.setProperty(rt, "isFatal", bridging::toJs(rt, value.isFatal, jsInvoker)); - if (value.extraData) { - result.setProperty(rt, "extraData", bridging::toJs(rt, value.extraData.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeExceptionsManagerCxxSpecJSI : public TurboModule { -protected: - NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportException(jsi::Runtime &rt, jsi::Object data) = 0; - virtual void updateExceptionMessage(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void dismissRedbox(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeExceptionsManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ExceptionsManager"; - -protected: - NativeExceptionsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeExceptionsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeExceptionsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeExceptionsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportFatalException) == 4, - "Expected reportFatalException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportFatalException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportSoftException) == 4, - "Expected reportSoftException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportSoftException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportException(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::reportException) == 2, - "Expected reportException(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reportException, jsInvoker_, instance_, std::move(data)); - } - void updateExceptionMessage(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::updateExceptionMessage) == 4, - "Expected updateExceptionMessage(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::updateExceptionMessage, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void dismissRedbox(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissRedbox) == 1, - "Expected dismissRedbox(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissRedbox, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeTimingCxxSpecJSI : public TurboModule { -protected: - NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) = 0; - virtual void deleteTimer(jsi::Runtime &rt, double timerID) = 0; - virtual void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) = 0; - -}; - -template -class JSI_EXPORT NativeTimingCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Timing"; - -protected: - NativeTimingCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeTimingCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeTimingCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeTimingCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) override { - static_assert( - bridging::getParameterCount(&T::createTimer) == 5, - "Expected createTimer(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::createTimer, jsInvoker_, instance_, std::move(callbackID), std::move(duration), std::move(jsSchedulingTime), std::move(repeats)); - } - void deleteTimer(jsi::Runtime &rt, double timerID) override { - static_assert( - bridging::getParameterCount(&T::deleteTimer) == 2, - "Expected deleteTimer(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteTimer, jsInvoker_, instance_, std::move(timerID)); - } - void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) override { - static_assert( - bridging::getParameterCount(&T::setSendIdleEvents) == 2, - "Expected setSendIdleEvents(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setSendIdleEvents, jsInvoker_, instance_, std::move(sendIdleEvents)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSegmentFetcherCxxSpecJSI : public TurboModule { -protected: - NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - virtual void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeSegmentFetcherCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "SegmentFetcher"; - -protected: - NativeSegmentFetcherCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSegmentFetcherCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeSegmentFetcherCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSegmentFetcherCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::fetchSegment) == 4, - "Expected fetchSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::fetchSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getSegment) == 4, - "Expected getSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativePermissionsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) = 0; - -}; - -template -class JSI_EXPORT NativePermissionsAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "PermissionsAndroid"; - -protected: - NativePermissionsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePermissionsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePermissionsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePermissionsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::checkPermission) == 2, - "Expected checkPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermission) == 2, - "Expected requestPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::shouldShowRequestPermissionRationale) == 2, - "Expected shouldShowRequestPermissionRationale(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::shouldShowRequestPermissionRationale, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) override { - static_assert( - bridging::getParameterCount(&T::requestMultiplePermissions) == 2, - "Expected requestMultiplePermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestMultiplePermissions, jsInvoker_, instance_, std::move(permissions)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - AlertManagerBaseArgs - -template -struct AlertManagerBaseArgs { - P0 title; - P1 message; - P2 buttons; - P3 type; - P4 defaultValue; - P5 cancelButtonKey; - P6 destructiveButtonKey; - P7 preferredButtonKey; - P8 keyboardType; - P9 userInterfaceStyle; - bool operator==(const AlertManagerBaseArgs &other) const { - return title == other.title && message == other.message && buttons == other.buttons && type == other.type && defaultValue == other.defaultValue && cancelButtonKey == other.cancelButtonKey && destructiveButtonKey == other.destructiveButtonKey && preferredButtonKey == other.preferredButtonKey && keyboardType == other.keyboardType && userInterfaceStyle == other.userInterfaceStyle; - } -}; - -template -struct AlertManagerBaseArgsBridging { - static AlertManagerBaseArgs fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - AlertManagerBaseArgs result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttons"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "type"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "defaultValue"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "destructiveButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "preferredButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "keyboardType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInterfaceStyle"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array buttonsToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::String typeToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static jsi::String defaultValueToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static jsi::String cancelButtonKeyToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static jsi::String destructiveButtonKeyToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } - - static jsi::String preferredButtonKeyToJs(jsi::Runtime &rt, P7 value) { - return bridging::toJs(rt, value); - } - - static jsi::String keyboardTypeToJs(jsi::Runtime &rt, P8 value) { - return bridging::toJs(rt, value); - } - - static jsi::String userInterfaceStyleToJs(jsi::Runtime &rt, P9 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const AlertManagerBaseArgs &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttons) { - result.setProperty(rt, "buttons", bridging::toJs(rt, value.buttons.value(), jsInvoker)); - } - if (value.type) { - result.setProperty(rt, "type", bridging::toJs(rt, value.type.value(), jsInvoker)); - } - if (value.defaultValue) { - result.setProperty(rt, "defaultValue", bridging::toJs(rt, value.defaultValue.value(), jsInvoker)); - } - if (value.cancelButtonKey) { - result.setProperty(rt, "cancelButtonKey", bridging::toJs(rt, value.cancelButtonKey.value(), jsInvoker)); - } - if (value.destructiveButtonKey) { - result.setProperty(rt, "destructiveButtonKey", bridging::toJs(rt, value.destructiveButtonKey.value(), jsInvoker)); - } - if (value.preferredButtonKey) { - result.setProperty(rt, "preferredButtonKey", bridging::toJs(rt, value.preferredButtonKey.value(), jsInvoker)); - } - if (value.keyboardType) { - result.setProperty(rt, "keyboardType", bridging::toJs(rt, value.keyboardType.value(), jsInvoker)); - } - if (value.userInterfaceStyle) { - result.setProperty(rt, "userInterfaceStyle", bridging::toJs(rt, value.userInterfaceStyle.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeAlertManagerCxxSpecJSI : public TurboModule { -protected: - NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeAlertManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "AlertManager"; - -protected: - NativeAlertManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAlertManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAlertManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAlertManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::alertWithArgs) == 3, - "Expected alertWithArgs(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::alertWithArgs, jsInvoker_, instance_, std::move(args), std::move(callback)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeActionSheetManagerCxxSpecJSI : public TurboModule { -protected: - NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) = 0; - virtual void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) = 0; - virtual void dismissActionSheet(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeActionSheetManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ActionSheetManager"; - -protected: - NativeActionSheetManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeActionSheetManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeActionSheetManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeActionSheetManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::showActionSheetWithOptions) == 3, - "Expected showActionSheetWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::showActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(callback)); - } - void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) override { - static_assert( - bridging::getParameterCount(&T::showShareActionSheetWithOptions) == 4, - "Expected showShareActionSheetWithOptions(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showShareActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(failureCallback), std::move(successCallback)); - } - void dismissActionSheet(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissActionSheet) == 1, - "Expected dismissActionSheet(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissActionSheet, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - DialogManagerAndroidBaseDialogOptions - -template -struct DialogManagerAndroidBaseDialogOptions { - P0 title; - P1 message; - P2 buttonPositive; - P3 buttonNegative; - P4 buttonNeutral; - P5 items; - P6 cancelable; - bool operator==(const DialogManagerAndroidBaseDialogOptions &other) const { - return title == other.title && message == other.message && buttonPositive == other.buttonPositive && buttonNegative == other.buttonNegative && buttonNeutral == other.buttonNeutral && items == other.items && cancelable == other.cancelable; - } -}; - -template -struct DialogManagerAndroidBaseDialogOptionsBridging { - static DialogManagerAndroidBaseDialogOptions fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - DialogManagerAndroidBaseDialogOptions result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonPositive"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNegative"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNeutral"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "items"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelable"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonPositiveToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNegativeToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNeutralToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array itemsToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static bool cancelableToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const DialogManagerAndroidBaseDialogOptions &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttonPositive) { - result.setProperty(rt, "buttonPositive", bridging::toJs(rt, value.buttonPositive.value(), jsInvoker)); - } - if (value.buttonNegative) { - result.setProperty(rt, "buttonNegative", bridging::toJs(rt, value.buttonNegative.value(), jsInvoker)); - } - if (value.buttonNeutral) { - result.setProperty(rt, "buttonNeutral", bridging::toJs(rt, value.buttonNeutral.value(), jsInvoker)); - } - if (value.items) { - result.setProperty(rt, "items", bridging::toJs(rt, value.items.value(), jsInvoker)); - } - if (value.cancelable) { - result.setProperty(rt, "cancelable", bridging::toJs(rt, value.cancelable.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDialogManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) = 0; - -}; - -template -class JSI_EXPORT NativeDialogManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DialogManagerAndroid"; - -protected: - NativeDialogManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDialogManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDialogManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDialogManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) override { - static_assert( - bridging::getParameterCount(&T::showAlert) == 4, - "Expected showAlert(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showAlert, jsInvoker_, instance_, std::move(config), std::move(onError), std::move(onAction)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - SourceCodeBaseSourceCodeConstants - -template -struct SourceCodeBaseSourceCodeConstants { - P0 scriptURL; - bool operator==(const SourceCodeBaseSourceCodeConstants &other) const { - return scriptURL == other.scriptURL; - } -}; - -template -struct SourceCodeBaseSourceCodeConstantsBridging { - static SourceCodeBaseSourceCodeConstants fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - SourceCodeBaseSourceCodeConstants result{ - bridging::fromJs(rt, value.getProperty(rt, "scriptURL"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String scriptURLToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const SourceCodeBaseSourceCodeConstants &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "scriptURL", bridging::toJs(rt, value.scriptURL, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeSourceCodeCxxSpecJSI : public TurboModule { -protected: - NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSourceCodeCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "SourceCode"; - -protected: - NativeSourceCodeCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSourceCodeCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeSourceCodeCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSourceCodeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevMenuCxxSpecJSI : public TurboModule { -protected: - NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void reload(jsi::Runtime &rt) = 0; - virtual void debugRemotely(jsi::Runtime &rt, bool enableDebug) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool enabled) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevMenuCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DevMenu"; - -protected: - NativeDevMenuCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevMenuCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDevMenuCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevMenuCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void debugRemotely(jsi::Runtime &rt, bool enableDebug) override { - static_assert( - bridging::getParameterCount(&T::debugRemotely) == 2, - "Expected debugRemotely(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::debugRemotely, jsInvoker_, instance_, std::move(enableDebug)); - } - void setProfilingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeRedBoxCxxSpecJSI : public TurboModule { -protected: - NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) = 0; - virtual void dismiss(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeRedBoxCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "RedBox"; - -protected: - NativeRedBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeRedBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeRedBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeRedBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) override { - static_assert( - bridging::getParameterCount(&T::setExtraData) == 3, - "Expected setExtraData(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setExtraData, jsInvoker_, instance_, std::move(extraData), std::move(forIdentifier)); - } - void dismiss(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismiss) == 1, - "Expected dismiss(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismiss, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAnimationsDebugModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimationsDebugModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startRecordingFps(jsi::Runtime &rt) = 0; - virtual void stopRecordingFps(jsi::Runtime &rt, double animationStopTimeMs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimationsDebugModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "AnimationsDebugModule"; - -protected: - NativeAnimationsDebugModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimationsDebugModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAnimationsDebugModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimationsDebugModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void startRecordingFps(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startRecordingFps) == 1, - "Expected startRecordingFps(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startRecordingFps, jsInvoker_, instance_); - } - void stopRecordingFps(jsi::Runtime &rt, double animationStopTimeMs) override { - static_assert( - bridging::getParameterCount(&T::stopRecordingFps) == 2, - "Expected stopRecordingFps(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopRecordingFps, jsInvoker_, instance_, std::move(animationStopTimeMs)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLogBoxCxxSpecJSI : public TurboModule { -protected: - NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeLogBoxCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "LogBox"; - -protected: - NativeLogBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLogBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeLogBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLogBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDeviceEventManagerCxxSpecJSI : public TurboModule { -protected: - NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void invokeDefaultBackPressHandler(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceEventManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DeviceEventManager"; - -protected: - NativeDeviceEventManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceEventManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDeviceEventManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceEventManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void invokeDefaultBackPressHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::invokeDefaultBackPressHandler) == 1, - "Expected invokeDefaultBackPressHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::invokeDefaultBackPressHandler, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevSettingsCxxSpecJSI : public TurboModule { -protected: - NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reload(jsi::Runtime &rt) = 0; - virtual void reloadWithReason(jsi::Runtime &rt, jsi::String reason) = 0; - virtual void onFastRefresh(jsi::Runtime &rt) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) = 0; - virtual void setIsDebuggingRemotely(jsi::Runtime &rt, bool isDebuggingRemotelyEnabled) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) = 0; - virtual void toggleElementInspector(jsi::Runtime &rt) = 0; - virtual void addMenuItem(jsi::Runtime &rt, jsi::String title) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevSettingsCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DevSettings"; - -protected: - NativeDevSettingsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevSettingsCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDevSettingsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevSettingsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void reloadWithReason(jsi::Runtime &rt, jsi::String reason) override { - static_assert( - bridging::getParameterCount(&T::reloadWithReason) == 2, - "Expected reloadWithReason(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reloadWithReason, jsInvoker_, instance_, std::move(reason)); - } - void onFastRefresh(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::onFastRefresh) == 1, - "Expected onFastRefresh(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::onFastRefresh, jsInvoker_, instance_); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(isHotLoadingEnabled)); - } - void setIsDebuggingRemotely(jsi::Runtime &rt, bool isDebuggingRemotelyEnabled) override { - static_assert( - bridging::getParameterCount(&T::setIsDebuggingRemotely) == 2, - "Expected setIsDebuggingRemotely(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setIsDebuggingRemotely, jsInvoker_, instance_, std::move(isDebuggingRemotelyEnabled)); - } - void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(isProfilingEnabled)); - } - void toggleElementInspector(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::toggleElementInspector) == 1, - "Expected toggleElementInspector(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::toggleElementInspector, jsInvoker_, instance_); - } - void addMenuItem(jsi::Runtime &rt, jsi::String title) override { - static_assert( - bridging::getParameterCount(&T::addMenuItem) == 2, - "Expected addMenuItem(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addMenuItem, jsInvoker_, instance_, std::move(title)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setIsShakeToShowDevMenuEnabled) == 2, - "Expected setIsShakeToShowDevMenuEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setIsShakeToShowDevMenuEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingAndroidCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeNetworkingAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 10, - "Expected sendRequest(...) to have 10 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(method), std::move(url), std::move(requestId), std::move(headers), std::move(data), std::move(responseType), std::move(useIncrementalUpdates), std::move(timeout), std::move(withCredentials)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingIOSCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeNetworkingIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 3, - "Expected sendRequest(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(query), std::move(callback)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageLoaderIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeImageLoaderIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 2, - "Expected prefetchImage(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) override { - static_assert( - bridging::getParameterCount(&T::prefetchImageWithMetadata) == 4, - "Expected prefetchImageWithMetadata(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImageWithMetadata, jsInvoker_, instance_, std::move(uri), std::move(queryRootName), std::move(rootTag)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - ImageEditingManagerBaseOptions - -template -struct ImageEditingManagerBaseOptions { - P0 offset; - P1 size; - P2 displaySize; - P3 resizeMode; - P4 allowExternalStorage; - bool operator==(const ImageEditingManagerBaseOptions &other) const { - return offset == other.offset && size == other.size && displaySize == other.displaySize && resizeMode == other.resizeMode && allowExternalStorage == other.allowExternalStorage; - } -}; - -template -struct ImageEditingManagerBaseOptionsBridging { - static ImageEditingManagerBaseOptions fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - ImageEditingManagerBaseOptions result{ - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "size"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "displaySize"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "resizeMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "allowExternalStorage"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object offsetToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object sizeToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static std::optional displaySizeToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static std::optional resizeModeToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static bool allowExternalStorageToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const ImageEditingManagerBaseOptions &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset, jsInvoker)); - result.setProperty(rt, "size", bridging::toJs(rt, value.size, jsInvoker)); - if (value.displaySize) { - result.setProperty(rt, "displaySize", bridging::toJs(rt, value.displaySize.value(), jsInvoker)); - } - if (value.resizeMode) { - result.setProperty(rt, "resizeMode", bridging::toJs(rt, value.resizeMode.value(), jsInvoker)); - } - if (value.allowExternalStorage) { - result.setProperty(rt, "allowExternalStorage", bridging::toJs(rt, value.allowExternalStorage.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeImageEditorCxxSpecJSI : public TurboModule { -protected: - NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageEditorCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ImageEditingManager"; - -protected: - NativeImageEditorCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageEditorCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeImageEditorCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageEditorCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::cropImage) == 5, - "Expected cropImage(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::cropImage, jsInvoker_, instance_, std::move(uri), std::move(cropData), std::move(successCallback), std::move(errorCallback)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - virtual void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) = 0; - virtual void removeImageForTag(jsi::Runtime &rt, jsi::String uri) = 0; - virtual void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeImageStoreIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::hasImageForTag) == 3, - "Expected hasImageForTag(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::hasImageForTag, jsInvoker_, instance_, std::move(uri), std::move(callback)); - } - void removeImageForTag(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::removeImageForTag) == 2, - "Expected removeImageForTag(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeImageForTag, jsInvoker_, instance_, std::move(uri)); - } - void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::addImageFromBase64) == 4, - "Expected addImageFromBase64(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addImageFromBase64, jsInvoker_, instance_, std::move(base64ImageData), std::move(successCallback), std::move(errorCallback)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageLoaderAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeImageLoaderAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 3, - "Expected prefetchImage(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri), std::move(requestId)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeImageStoreAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - DeviceInfoBaseDisplayMetrics - -template -struct DeviceInfoBaseDisplayMetrics { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - bool operator==(const DeviceInfoBaseDisplayMetrics &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale; - } -}; - -template -struct DeviceInfoBaseDisplayMetricsBridging { - static DeviceInfoBaseDisplayMetrics fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - DeviceInfoBaseDisplayMetrics result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const DeviceInfoBaseDisplayMetrics &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - return result; - } -}; - - - -#pragma mark - DeviceInfoBaseDisplayMetricsAndroid - -template -struct DeviceInfoBaseDisplayMetricsAndroid { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - P4 densityDpi; - bool operator==(const DeviceInfoBaseDisplayMetricsAndroid &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale && densityDpi == other.densityDpi; - } -}; - -template -struct DeviceInfoBaseDisplayMetricsAndroidBridging { - static DeviceInfoBaseDisplayMetricsAndroid fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - DeviceInfoBaseDisplayMetricsAndroid result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "densityDpi"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static double densityDpiToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const DeviceInfoBaseDisplayMetricsAndroid &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - result.setProperty(rt, "densityDpi", bridging::toJs(rt, value.densityDpi, jsInvoker)); - return result; - } -}; - - - -#pragma mark - DeviceInfoBaseDimensionsPayload - -template -struct DeviceInfoBaseDimensionsPayload { - P0 window; - P1 screen; - P2 windowPhysicalPixels; - P3 screenPhysicalPixels; - bool operator==(const DeviceInfoBaseDimensionsPayload &other) const { - return window == other.window && screen == other.screen && windowPhysicalPixels == other.windowPhysicalPixels && screenPhysicalPixels == other.screenPhysicalPixels; - } -}; - -template -struct DeviceInfoBaseDimensionsPayloadBridging { - static DeviceInfoBaseDimensionsPayload fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - DeviceInfoBaseDimensionsPayload result{ - bridging::fromJs(rt, value.getProperty(rt, "window"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screen"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "windowPhysicalPixels"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screenPhysicalPixels"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object windowToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object windowPhysicalPixelsToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenPhysicalPixelsToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const DeviceInfoBaseDimensionsPayload &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.window) { - result.setProperty(rt, "window", bridging::toJs(rt, value.window.value(), jsInvoker)); - } - if (value.screen) { - result.setProperty(rt, "screen", bridging::toJs(rt, value.screen.value(), jsInvoker)); - } - if (value.windowPhysicalPixels) { - result.setProperty(rt, "windowPhysicalPixels", bridging::toJs(rt, value.windowPhysicalPixels.value(), jsInvoker)); - } - if (value.screenPhysicalPixels) { - result.setProperty(rt, "screenPhysicalPixels", bridging::toJs(rt, value.screenPhysicalPixels.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - DeviceInfoBaseDeviceInfoConstants - -template -struct DeviceInfoBaseDeviceInfoConstants { - P0 Dimensions; - P1 isIPhoneX_deprecated; - bool operator==(const DeviceInfoBaseDeviceInfoConstants &other) const { - return Dimensions == other.Dimensions && isIPhoneX_deprecated == other.isIPhoneX_deprecated; - } -}; - -template -struct DeviceInfoBaseDeviceInfoConstantsBridging { - static DeviceInfoBaseDeviceInfoConstants fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - DeviceInfoBaseDeviceInfoConstants result{ - bridging::fromJs(rt, value.getProperty(rt, "Dimensions"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIPhoneX_deprecated"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object DimensionsToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static bool isIPhoneX_deprecatedToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const DeviceInfoBaseDeviceInfoConstants &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "Dimensions", bridging::toJs(rt, value.Dimensions, jsInvoker)); - if (value.isIPhoneX_deprecated) { - result.setProperty(rt, "isIPhoneX_deprecated", bridging::toJs(rt, value.isIPhoneX_deprecated.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDeviceInfoCxxSpecJSI : public TurboModule { -protected: - NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceInfoCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DeviceInfo"; - -protected: - NativeDeviceInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDeviceInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - PlatformConstantsBasePlatformConstantsIOS - -template -struct PlatformConstantsBasePlatformConstantsIOS { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 forceTouchAvailable; - P4 osVersion; - P5 systemName; - P6 interfaceIdiom; - bool operator==(const PlatformConstantsBasePlatformConstantsIOS &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && forceTouchAvailable == other.forceTouchAvailable && osVersion == other.osVersion && systemName == other.systemName && interfaceIdiom == other.interfaceIdiom; - } -}; - -template -struct PlatformConstantsBasePlatformConstantsIOSBridging { - static PlatformConstantsBasePlatformConstantsIOS fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - PlatformConstantsBasePlatformConstantsIOS result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "forceTouchAvailable"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "osVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "systemName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interfaceIdiom"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static bool forceTouchAvailableToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static jsi::String osVersionToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static jsi::String systemNameToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static jsi::String interfaceIdiomToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const PlatformConstantsBasePlatformConstantsIOS &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "forceTouchAvailable", bridging::toJs(rt, value.forceTouchAvailable, jsInvoker)); - result.setProperty(rt, "osVersion", bridging::toJs(rt, value.osVersion, jsInvoker)); - result.setProperty(rt, "systemName", bridging::toJs(rt, value.systemName, jsInvoker)); - result.setProperty(rt, "interfaceIdiom", bridging::toJs(rt, value.interfaceIdiom, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsIOSCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePlatformConstantsIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevLoadingViewCxxSpecJSI : public TurboModule { -protected: - NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDevLoadingViewCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "DevLoadingView"; - -protected: - NativeDevLoadingViewCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevLoadingViewCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeDevLoadingViewCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevLoadingViewCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) override { - static_assert( - bridging::getParameterCount(&T::showMessage) == 4, - "Expected showMessage(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showMessage, jsInvoker_, instance_, std::move(message), std::move(withColor), std::move(withBackgroundColor)); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAppearanceCxxSpecJSI : public TurboModule { -protected: - NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual std::optional getColorScheme(jsi::Runtime &rt) = 0; - virtual void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppearanceCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Appearance"; - -protected: - NativeAppearanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppearanceCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAppearanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppearanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - std::optional getColorScheme(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getColorScheme) == 1, - "Expected getColorScheme(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getColorScheme, jsInvoker_, instance_); - } - void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) override { - static_assert( - bridging::getParameterCount(&T::setColorScheme) == 2, - "Expected setColorScheme(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setColorScheme, jsInvoker_, instance_, std::move(colorScheme)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - PlatformConstantsBaseReactNativeVersionAndroid - -template -struct PlatformConstantsBaseReactNativeVersionAndroid { - P0 major; - P1 minor; - P2 patch; - P3 prerelease; - bool operator==(const PlatformConstantsBaseReactNativeVersionAndroid &other) const { - return major == other.major && minor == other.minor && patch == other.patch && prerelease == other.prerelease; - } -}; - -template -struct PlatformConstantsBaseReactNativeVersionAndroidBridging { - static PlatformConstantsBaseReactNativeVersionAndroid fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - PlatformConstantsBaseReactNativeVersionAndroid result{ - bridging::fromJs(rt, value.getProperty(rt, "major"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "minor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "patch"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "prerelease"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double majorToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double minorToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static double patchToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static std::optional prereleaseToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const PlatformConstantsBaseReactNativeVersionAndroid &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "major", bridging::toJs(rt, value.major, jsInvoker)); - result.setProperty(rt, "minor", bridging::toJs(rt, value.minor, jsInvoker)); - result.setProperty(rt, "patch", bridging::toJs(rt, value.patch, jsInvoker)); - result.setProperty(rt, "prerelease", bridging::toJs(rt, value.prerelease, jsInvoker)); - return result; - } -}; - - - -#pragma mark - PlatformConstantsBasePlatformConstantsAndroid - -template -struct PlatformConstantsBasePlatformConstantsAndroid { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 Version; - P4 Release; - P5 Serial; - P6 Fingerprint; - P7 Model; - P8 ServerHost; - P9 uiMode; - P10 Brand; - P11 Manufacturer; - bool operator==(const PlatformConstantsBasePlatformConstantsAndroid &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && Version == other.Version && Release == other.Release && Serial == other.Serial && Fingerprint == other.Fingerprint && Model == other.Model && ServerHost == other.ServerHost && uiMode == other.uiMode && Brand == other.Brand && Manufacturer == other.Manufacturer; - } -}; - -template -struct PlatformConstantsBasePlatformConstantsAndroidBridging { - static PlatformConstantsBasePlatformConstantsAndroid fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - PlatformConstantsBasePlatformConstantsAndroid result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Version"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Release"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Serial"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Fingerprint"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Model"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "ServerHost"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "uiMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Brand"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Manufacturer"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static double VersionToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static jsi::String ReleaseToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static jsi::String SerialToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static jsi::String FingerprintToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } - - static jsi::String ModelToJs(jsi::Runtime &rt, P7 value) { - return bridging::toJs(rt, value); - } - - static jsi::String ServerHostToJs(jsi::Runtime &rt, P8 value) { - return bridging::toJs(rt, value); - } - - static jsi::String uiModeToJs(jsi::Runtime &rt, P9 value) { - return bridging::toJs(rt, value); - } - - static jsi::String BrandToJs(jsi::Runtime &rt, P10 value) { - return bridging::toJs(rt, value); - } - - static jsi::String ManufacturerToJs(jsi::Runtime &rt, P11 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const PlatformConstantsBasePlatformConstantsAndroid &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "Version", bridging::toJs(rt, value.Version, jsInvoker)); - result.setProperty(rt, "Release", bridging::toJs(rt, value.Release, jsInvoker)); - result.setProperty(rt, "Serial", bridging::toJs(rt, value.Serial, jsInvoker)); - result.setProperty(rt, "Fingerprint", bridging::toJs(rt, value.Fingerprint, jsInvoker)); - result.setProperty(rt, "Model", bridging::toJs(rt, value.Model, jsInvoker)); - if (value.ServerHost) { - result.setProperty(rt, "ServerHost", bridging::toJs(rt, value.ServerHost.value(), jsInvoker)); - } - result.setProperty(rt, "uiMode", bridging::toJs(rt, value.uiMode, jsInvoker)); - result.setProperty(rt, "Brand", bridging::toJs(rt, value.Brand, jsInvoker)); - result.setProperty(rt, "Manufacturer", bridging::toJs(rt, value.Manufacturer, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::String getAndroidID(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePlatformConstantsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::String getAndroidID(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getAndroidID) == 1, - "Expected getAndroidID(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getAndroidID, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getHeight(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeStatusBarManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getHeight(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getHeight) == 2, - "Expected getHeight(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getHeight, jsInvoker_, instance_, std::move(callback)); - } - void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) override { - static_assert( - bridging::getParameterCount(&T::setNetworkActivityIndicatorVisible) == 2, - "Expected setNetworkActivityIndicatorVisible(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setNetworkActivityIndicatorVisible, jsInvoker_, instance_, std::move(visible)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 3, - "Expected setStyle(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle), std::move(animated)); - } - void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 3, - "Expected setHidden(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden), std::move(withAnimation)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setColor(jsi::Runtime &rt, double color, bool animated) = 0; - virtual void setTranslucent(jsi::Runtime &rt, bool translucent) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeStatusBarManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setColor(jsi::Runtime &rt, double color, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setColor) == 3, - "Expected setColor(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setColor, jsInvoker_, instance_, std::move(color), std::move(animated)); - } - void setTranslucent(jsi::Runtime &rt, bool translucent) override { - static_assert( - bridging::getParameterCount(&T::setTranslucent) == 2, - "Expected setTranslucent(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setTranslucent, jsInvoker_, instance_, std::move(translucent)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 2, - "Expected setStyle(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle)); - } - void setHidden(jsi::Runtime &rt, bool hidden) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 2, - "Expected setHidden(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityManagerCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "AccessibilityManager"; - -protected: - NativeAccessibilityManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAccessibilityManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentBoldTextState) == 3, - "Expected getCurrentBoldTextState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentBoldTextState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentGrayscaleState) == 3, - "Expected getCurrentGrayscaleState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentGrayscaleState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentInvertColorsState) == 3, - "Expected getCurrentInvertColorsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentInvertColorsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceMotionState) == 3, - "Expected getCurrentReduceMotionState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceMotionState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentPrefersCrossFadeTransitionsState) == 3, - "Expected getCurrentPrefersCrossFadeTransitionsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentPrefersCrossFadeTransitionsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceTransparencyState) == 3, - "Expected getCurrentReduceTransparencyState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceTransparencyState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentVoiceOverState) == 3, - "Expected getCurrentVoiceOverState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentVoiceOverState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityContentSizeMultipliers) == 2, - "Expected setAccessibilityContentSizeMultipliers(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityContentSizeMultipliers, jsInvoker_, instance_, std::move(JSMultipliers)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibilityWithOptions) == 3, - "Expected announceForAccessibilityWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibilityWithOptions, jsInvoker_, instance_, std::move(announcement), std::move(options)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityInfoCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityInfoCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "AccessibilityInfo"; - -protected: - NativeAccessibilityInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAccessibilityInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isReduceMotionEnabled) == 2, - "Expected isReduceMotionEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isReduceMotionEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isTouchExplorationEnabled) == 2, - "Expected isTouchExplorationEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isTouchExplorationEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isAccessibilityServiceEnabled) == 2, - "Expected isAccessibilityServiceEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isAccessibilityServiceEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::getRecommendedTimeoutMillis) == 3, - "Expected getRecommendedTimeoutMillis(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getRecommendedTimeoutMillis, jsInvoker_, instance_, std::move(mSec), std::move(onSuccess)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeToastAndroidCxxSpecJSI : public TurboModule { -protected: - NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void show(jsi::Runtime &rt, jsi::String message, double duration) = 0; - virtual void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) = 0; - virtual void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) = 0; - -}; - -template -class JSI_EXPORT NativeToastAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ToastAndroid"; - -protected: - NativeToastAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeToastAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeToastAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeToastAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void show(jsi::Runtime &rt, jsi::String message, double duration) override { - static_assert( - bridging::getParameterCount(&T::show) == 3, - "Expected show(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_, std::move(message), std::move(duration)); - } - void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) override { - static_assert( - bridging::getParameterCount(&T::showWithGravity) == 4, - "Expected showWithGravity(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravity, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity)); - } - void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) override { - static_assert( - bridging::getParameterCount(&T::showWithGravityAndOffset) == 6, - "Expected showWithGravityAndOffset(...) to have 6 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravityAndOffset, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity), std::move(xOffset), std::move(yOffset)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSoundManagerCxxSpecJSI : public TurboModule { -protected: - NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void playTouchSound(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSoundManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "SoundManager"; - -protected: - NativeSoundManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSoundManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeSoundManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSoundManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void playTouchSound(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::playTouchSound) == 1, - "Expected playTouchSound(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::playTouchSound, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeKeyboardObserverCxxSpecJSI : public TurboModule { -protected: - NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeKeyboardObserverCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "KeyboardObserver"; - -protected: - NativeKeyboardObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeKeyboardObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeKeyboardObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeKeyboardObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeClipboardCxxSpecJSI : public TurboModule { -protected: - NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getString(jsi::Runtime &rt) = 0; - virtual void setString(jsi::Runtime &rt, jsi::String content) = 0; - -}; - -template -class JSI_EXPORT NativeClipboardCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "Clipboard"; - -protected: - NativeClipboardCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeClipboardCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeClipboardCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeClipboardCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getString(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getString) == 1, - "Expected getString(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_); - } - void setString(jsi::Runtime &rt, jsi::String content) override { - static_assert( - bridging::getParameterCount(&T::setString) == 2, - "Expected setString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setString, jsInvoker_, instance_, std::move(content)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions - -template -struct NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions { - P0 intersectionObserverId; - P1 targetShadowNode; - P2 thresholds; - bool operator==(const NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions &other) const { - return intersectionObserverId == other.intersectionObserverId && targetShadowNode == other.targetShadowNode && thresholds == other.thresholds; - } -}; - -template -struct NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptionsBridging { - static NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "thresholds"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array thresholdsToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "thresholds", bridging::toJs(rt, value.thresholds, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry - -template -struct NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry { - P0 intersectionObserverId; - P1 targetInstanceHandle; - P2 targetRect; - P3 rootRect; - P4 intersectionRect; - P5 isIntersectingAboveThresholds; - P6 time; - bool operator==(const NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry &other) const { - return intersectionObserverId == other.intersectionObserverId && targetInstanceHandle == other.targetInstanceHandle && targetRect == other.targetRect && rootRect == other.rootRect && intersectionRect == other.intersectionRect && isIntersectingAboveThresholds == other.isIntersectingAboveThresholds && time == other.time; - } -}; - -template -struct NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntryBridging { - static NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetInstanceHandle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "intersectionRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIntersectingAboveThresholds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "time"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetInstanceHandleToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array targetRectToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array rootRectToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static std::optional intersectionRectToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static bool isIntersectingAboveThresholdsToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static double timeToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - result.setProperty(rt, "targetInstanceHandle", bridging::toJs(rt, value.targetInstanceHandle, jsInvoker)); - result.setProperty(rt, "targetRect", bridging::toJs(rt, value.targetRect, jsInvoker)); - result.setProperty(rt, "rootRect", bridging::toJs(rt, value.rootRect, jsInvoker)); - result.setProperty(rt, "intersectionRect", bridging::toJs(rt, value.intersectionRect, jsInvoker)); - result.setProperty(rt, "isIntersectingAboveThresholds", bridging::toJs(rt, value.isIntersectingAboveThresholds, jsInvoker)); - result.setProperty(rt, "time", bridging::toJs(rt, value.time, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeIntersectionObserverCxxSpecJSI : public TurboModule { -protected: - NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeIntersectionObserverCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeIntersectionObserverCxx"; - -protected: - NativeIntersectionObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntersectionObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeIntersectionObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntersectionObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) override { - static_assert( - bridging::getParameterCount(&T::unobserve) == 3, - "Expected unobserve(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserve, jsInvoker_, instance_, std::move(intersectionObserverId), std::move(targetShadowNode)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) override { - static_assert( - bridging::getParameterCount(&T::connect) == 2, - "Expected connect(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyIntersectionObserversCallback)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions - -template -struct NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions { - P0 mutationObserverId; - P1 targetShadowNode; - P2 subtree; - bool operator==(const NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions &other) const { - return mutationObserverId == other.mutationObserverId && targetShadowNode == other.targetShadowNode && subtree == other.subtree; - } -}; - -template -struct NativeMutationObserverCxxBaseNativeMutationObserverObserveOptionsBridging { - static NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "subtree"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static bool subtreeToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeMutationObserverCxxBaseNativeMutationObserverObserveOptions &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "subtree", bridging::toJs(rt, value.subtree, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeMutationObserverCxxBaseNativeMutationRecord - -template -struct NativeMutationObserverCxxBaseNativeMutationRecord { - P0 mutationObserverId; - P1 target; - P2 addedNodes; - P3 removedNodes; - bool operator==(const NativeMutationObserverCxxBaseNativeMutationRecord &other) const { - return mutationObserverId == other.mutationObserverId && target == other.target && addedNodes == other.addedNodes && removedNodes == other.removedNodes; - } -}; - -template -struct NativeMutationObserverCxxBaseNativeMutationRecordBridging { - static NativeMutationObserverCxxBaseNativeMutationRecord fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeMutationObserverCxxBaseNativeMutationRecord result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "target"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "addedNodes"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "removedNodes"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array addedNodesToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static jsi::Array removedNodesToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeMutationObserverCxxBaseNativeMutationRecord &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "target", bridging::toJs(rt, value.target, jsInvoker)); - result.setProperty(rt, "addedNodes", bridging::toJs(rt, value.addedNodes, jsInvoker)); - result.setProperty(rt, "removedNodes", bridging::toJs(rt, value.removedNodes, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeMutationObserverCxxSpecJSI : public TurboModule { -protected: - NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserve(jsi::Runtime &rt, double mutationObserverId, jsi::Value targetShadowNode) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeMutationObserverCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeMutationObserverCxx"; - -protected: - NativeMutationObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMutationObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeMutationObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMutationObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserve(jsi::Runtime &rt, double mutationObserverId, jsi::Value targetShadowNode) override { - static_assert( - bridging::getParameterCount(&T::unobserve) == 3, - "Expected unobserve(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserve, jsInvoker_, instance_, std::move(mutationObserverId), std::move(targetShadowNode)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) override { - static_assert( - bridging::getParameterCount(&T::connect) == 3, - "Expected connect(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyMutationObservers), std::move(getPublicInstanceFromInstanceHandle)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - AppStateBaseAppStateConstants - -template -struct AppStateBaseAppStateConstants { - P0 initialAppState; - bool operator==(const AppStateBaseAppStateConstants &other) const { - return initialAppState == other.initialAppState; - } -}; - -template -struct AppStateBaseAppStateConstantsBridging { - static AppStateBaseAppStateConstants fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - AppStateBaseAppStateConstants result{ - bridging::fromJs(rt, value.getProperty(rt, "initialAppState"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String initialAppStateToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const AppStateBaseAppStateConstants &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "initialAppState", bridging::toJs(rt, value.initialAppState, jsInvoker)); - return result; - } -}; - - - -#pragma mark - AppStateBaseAppState - -template -struct AppStateBaseAppState { - P0 app_state; - bool operator==(const AppStateBaseAppState &other) const { - return app_state == other.app_state; - } -}; - -template -struct AppStateBaseAppStateBridging { - static AppStateBaseAppState fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - AppStateBaseAppState result{ - bridging::fromJs(rt, value.getProperty(rt, "app_state"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String app_stateToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const AppStateBaseAppState &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "app_state", bridging::toJs(rt, value.app_state, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAppStateCxxSpecJSI : public TurboModule { -protected: - NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppStateCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "AppState"; - -protected: - NativeAppStateCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppStateCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAppStateCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppStateCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) override { - static_assert( - bridging::getParameterCount(&T::getCurrentAppState) == 3, - "Expected getCurrentAppState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentAppState, jsInvoker_, instance_, std::move(success), std::move(error)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePerformanceObserverCxxBaseRawPerformanceEntry - -template -struct NativePerformanceObserverCxxBaseRawPerformanceEntry { - P0 name; - P1 entryType; - P2 startTime; - P3 duration; - P4 processingStart; - P5 processingEnd; - P6 interactionId; - bool operator==(const NativePerformanceObserverCxxBaseRawPerformanceEntry &other) const { - return name == other.name && entryType == other.entryType && startTime == other.startTime && duration == other.duration && processingStart == other.processingStart && processingEnd == other.processingEnd && interactionId == other.interactionId; - } -}; - -template -struct NativePerformanceObserverCxxBaseRawPerformanceEntryBridging { - static NativePerformanceObserverCxxBaseRawPerformanceEntry fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativePerformanceObserverCxxBaseRawPerformanceEntry result{ - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "entryType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "startTime"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "duration"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interactionId"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String nameToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double entryTypeToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static double startTimeToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static double durationToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static double processingStartToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static double processingEndToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static double interactionIdToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativePerformanceObserverCxxBaseRawPerformanceEntry &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "entryType", bridging::toJs(rt, value.entryType, jsInvoker)); - result.setProperty(rt, "startTime", bridging::toJs(rt, value.startTime, jsInvoker)); - result.setProperty(rt, "duration", bridging::toJs(rt, value.duration, jsInvoker)); - if (value.processingStart) { - result.setProperty(rt, "processingStart", bridging::toJs(rt, value.processingStart.value(), jsInvoker)); - } - if (value.processingEnd) { - result.setProperty(rt, "processingEnd", bridging::toJs(rt, value.processingEnd.value(), jsInvoker)); - } - if (value.interactionId) { - result.setProperty(rt, "interactionId", bridging::toJs(rt, value.interactionId.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativePerformanceObserverCxxBaseGetPendingEntriesResult - -template -struct NativePerformanceObserverCxxBaseGetPendingEntriesResult { - P0 entries; - P1 droppedEntriesCount; - bool operator==(const NativePerformanceObserverCxxBaseGetPendingEntriesResult &other) const { - return entries == other.entries && droppedEntriesCount == other.droppedEntriesCount; - } -}; - -template -struct NativePerformanceObserverCxxBaseGetPendingEntriesResultBridging { - static NativePerformanceObserverCxxBaseGetPendingEntriesResult fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativePerformanceObserverCxxBaseGetPendingEntriesResult result{ - bridging::fromJs(rt, value.getProperty(rt, "entries"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "droppedEntriesCount"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array entriesToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double droppedEntriesCountToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativePerformanceObserverCxxBaseGetPendingEntriesResult &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "entries", bridging::toJs(rt, value.entries, jsInvoker)); - result.setProperty(rt, "droppedEntriesCount", bridging::toJs(rt, value.droppedEntriesCount, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePerformanceObserverCxxSpecJSI : public TurboModule { -protected: - NativePerformanceObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startReporting(jsi::Runtime &rt, double entryType) = 0; - virtual void stopReporting(jsi::Runtime &rt, double entryType) = 0; - virtual void setIsBuffered(jsi::Runtime &rt, jsi::Array entryTypes, bool isBuffered) = 0; - virtual jsi::Object popPendingEntries(jsi::Runtime &rt) = 0; - virtual void setOnPerformanceEntryCallback(jsi::Runtime &rt, std::optional callback) = 0; - virtual void logRawEntry(jsi::Runtime &rt, jsi::Object entry) = 0; - virtual jsi::Array getEventCounts(jsi::Runtime &rt) = 0; - virtual void setDurationThreshold(jsi::Runtime &rt, double entryType, double durationThreshold) = 0; - virtual void clearEntries(jsi::Runtime &rt, double entryType, std::optional entryName) = 0; - virtual jsi::Array getEntries(jsi::Runtime &rt, std::optional entryType, std::optional entryName) = 0; - -}; - -template -class JSI_EXPORT NativePerformanceObserverCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativePerformanceObserverCxx"; - -protected: - NativePerformanceObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePerformanceObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePerformanceObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePerformanceObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void startReporting(jsi::Runtime &rt, double entryType) override { - static_assert( - bridging::getParameterCount(&T::startReporting) == 2, - "Expected startReporting(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startReporting, jsInvoker_, instance_, std::move(entryType)); - } - void stopReporting(jsi::Runtime &rt, double entryType) override { - static_assert( - bridging::getParameterCount(&T::stopReporting) == 2, - "Expected stopReporting(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopReporting, jsInvoker_, instance_, std::move(entryType)); - } - void setIsBuffered(jsi::Runtime &rt, jsi::Array entryTypes, bool isBuffered) override { - static_assert( - bridging::getParameterCount(&T::setIsBuffered) == 3, - "Expected setIsBuffered(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setIsBuffered, jsInvoker_, instance_, std::move(entryTypes), std::move(isBuffered)); - } - jsi::Object popPendingEntries(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::popPendingEntries) == 1, - "Expected popPendingEntries(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::popPendingEntries, jsInvoker_, instance_); - } - void setOnPerformanceEntryCallback(jsi::Runtime &rt, std::optional callback) override { - static_assert( - bridging::getParameterCount(&T::setOnPerformanceEntryCallback) == 2, - "Expected setOnPerformanceEntryCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setOnPerformanceEntryCallback, jsInvoker_, instance_, std::move(callback)); - } - void logRawEntry(jsi::Runtime &rt, jsi::Object entry) override { - static_assert( - bridging::getParameterCount(&T::logRawEntry) == 2, - "Expected logRawEntry(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::logRawEntry, jsInvoker_, instance_, std::move(entry)); - } - jsi::Array getEventCounts(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getEventCounts) == 1, - "Expected getEventCounts(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getEventCounts, jsInvoker_, instance_); - } - void setDurationThreshold(jsi::Runtime &rt, double entryType, double durationThreshold) override { - static_assert( - bridging::getParameterCount(&T::setDurationThreshold) == 3, - "Expected setDurationThreshold(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setDurationThreshold, jsInvoker_, instance_, std::move(entryType), std::move(durationThreshold)); - } - void clearEntries(jsi::Runtime &rt, double entryType, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::clearEntries) == 3, - "Expected clearEntries(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::clearEntries, jsInvoker_, instance_, std::move(entryType), std::move(entryName)); - } - jsi::Array getEntries(jsi::Runtime &rt, std::optional entryType, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::getEntries) == 3, - "Expected getEntries(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getEntries, jsInvoker_, instance_, std::move(entryType), std::move(entryName)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativePerformanceCxxSpecJSI : public TurboModule { -protected: - NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void mark(jsi::Runtime &rt, jsi::String name, double startTime) = 0; - virtual void measure(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) = 0; - virtual jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) = 0; - virtual jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePerformanceCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativePerformanceCxx"; - -protected: - NativePerformanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePerformanceCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePerformanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePerformanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void mark(jsi::Runtime &rt, jsi::String name, double startTime) override { - static_assert( - bridging::getParameterCount(&T::mark) == 3, - "Expected mark(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::mark, jsInvoker_, instance_, std::move(name), std::move(startTime)); - } - void measure(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) override { - static_assert( - bridging::getParameterCount(&T::measure) == 7, - "Expected measure(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(name), std::move(startTime), std::move(endTime), std::move(duration), std::move(startMark), std::move(endMark)); - } - jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getSimpleMemoryInfo) == 1, - "Expected getSimpleMemoryInfo(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getSimpleMemoryInfo, jsInvoker_, instance_); - } - jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getReactNativeStartupTiming) == 1, - "Expected getReactNativeStartupTiming(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getReactNativeStartupTiming, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeBugReportingCxxSpecJSI : public TurboModule { -protected: - NativeBugReportingCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startReportAProblemFlow(jsi::Runtime &rt) = 0; - virtual void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::Object extraFiles) = 0; - virtual void setCategoryID(jsi::Runtime &rt, jsi::String categoryID) = 0; - -}; - -template -class JSI_EXPORT NativeBugReportingCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "BugReporting"; - -protected: - NativeBugReportingCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeBugReportingCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeBugReportingCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeBugReportingCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void startReportAProblemFlow(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startReportAProblemFlow) == 1, - "Expected startReportAProblemFlow(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startReportAProblemFlow, jsInvoker_, instance_); - } - void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::Object extraFiles) override { - static_assert( - bridging::getParameterCount(&T::setExtraData) == 3, - "Expected setExtraData(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setExtraData, jsInvoker_, instance_, std::move(extraData), std::move(extraFiles)); - } - void setCategoryID(jsi::Runtime &rt, jsi::String categoryID) override { - static_assert( - bridging::getParameterCount(&T::setCategoryID) == 2, - "Expected setCategoryID(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setCategoryID, jsInvoker_, instance_, std::move(categoryID)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeJSCHeapCaptureCxxSpecJSI : public TurboModule { -protected: - NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) = 0; - -}; - -template -class JSI_EXPORT NativeJSCHeapCaptureCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "JSCHeapCapture"; - -protected: - NativeJSCHeapCaptureCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeJSCHeapCaptureCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeJSCHeapCaptureCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeJSCHeapCaptureCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) override { - static_assert( - bridging::getParameterCount(&T::captureComplete) == 3, - "Expected captureComplete(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::captureComplete, jsInvoker_, instance_, std::move(path), std::move(error)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeJSCSamplingProfilerCxxSpecJSI : public TurboModule { -protected: - NativeJSCSamplingProfilerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void operationComplete(jsi::Runtime &rt, double token, std::optional result, std::optional error) = 0; - -}; - -template -class JSI_EXPORT NativeJSCSamplingProfilerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "JSCSamplingProfiler"; - -protected: - NativeJSCSamplingProfilerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeJSCSamplingProfilerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeJSCSamplingProfilerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeJSCSamplingProfilerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void operationComplete(jsi::Runtime &rt, double token, std::optional result, std::optional error) override { - static_assert( - bridging::getParameterCount(&T::operationComplete) == 4, - "Expected operationComplete(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::operationComplete, jsInvoker_, instance_, std::move(token), std::move(result), std::move(error)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeModalManagerCxxSpecJSI : public TurboModule { -protected: - NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeModalManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ModalManager"; - -protected: - NativeModalManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeModalManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeModalManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeModalManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFileReaderModuleCxxSpecJSI : public TurboModule { -protected: - NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) = 0; - virtual jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) = 0; - -}; - -template -class JSI_EXPORT NativeFileReaderModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "FileReaderModule"; - -protected: - NativeFileReaderModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFileReaderModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeFileReaderModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFileReaderModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::readAsDataURL) == 2, - "Expected readAsDataURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::readAsDataURL, jsInvoker_, instance_, std::move(data)); - } - jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) override { - static_assert( - bridging::getParameterCount(&T::readAsText) == 3, - "Expected readAsText(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::readAsText, jsInvoker_, instance_, std::move(data), std::move(encoding)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeBlobModuleCxxSpecJSI : public TurboModule { -protected: - NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void addNetworkingHandler(jsi::Runtime &rt) = 0; - virtual void addWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void removeWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) = 0; - virtual void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) = 0; - virtual void release(jsi::Runtime &rt, jsi::String blobId) = 0; - -}; - -template -class JSI_EXPORT NativeBlobModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "BlobModule"; - -protected: - NativeBlobModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeBlobModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeBlobModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeBlobModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void addNetworkingHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::addNetworkingHandler) == 1, - "Expected addNetworkingHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::addNetworkingHandler, jsInvoker_, instance_); - } - void addWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::addWebSocketHandler) == 2, - "Expected addWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void removeWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::removeWebSocketHandler) == 2, - "Expected removeWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) override { - static_assert( - bridging::getParameterCount(&T::sendOverSocket) == 3, - "Expected sendOverSocket(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendOverSocket, jsInvoker_, instance_, std::move(blob), std::move(socketID)); - } - void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) override { - static_assert( - bridging::getParameterCount(&T::createFromParts) == 3, - "Expected createFromParts(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createFromParts, jsInvoker_, instance_, std::move(parts), std::move(withId)); - } - void release(jsi::Runtime &rt, jsi::String blobId) override { - static_assert( - bridging::getParameterCount(&T::release) == 2, - "Expected release(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::release, jsInvoker_, instance_, std::move(blobId)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFrameRateLoggerCxxSpecJSI : public TurboModule { -protected: - NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void setContext(jsi::Runtime &rt, jsi::String context) = 0; - virtual void beginScroll(jsi::Runtime &rt) = 0; - virtual void endScroll(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeFrameRateLoggerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "FrameRateLogger"; - -protected: - NativeFrameRateLoggerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFrameRateLoggerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeFrameRateLoggerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFrameRateLoggerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::setGlobalOptions) == 2, - "Expected setGlobalOptions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setGlobalOptions, jsInvoker_, instance_, std::move(options)); - } - void setContext(jsi::Runtime &rt, jsi::String context) override { - static_assert( - bridging::getParameterCount(&T::setContext) == 2, - "Expected setContext(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setContext, jsInvoker_, instance_, std::move(context)); - } - void beginScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::beginScroll) == 1, - "Expected beginScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::beginScroll, jsInvoker_, instance_); - } - void endScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::endScroll) == 1, - "Expected endScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::endScroll, jsInvoker_, instance_); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - I18nManagerBaseI18nManagerConstants - -template -struct I18nManagerBaseI18nManagerConstants { - P0 doLeftAndRightSwapInRTL; - P1 isRTL; - P2 localeIdentifier; - bool operator==(const I18nManagerBaseI18nManagerConstants &other) const { - return doLeftAndRightSwapInRTL == other.doLeftAndRightSwapInRTL && isRTL == other.isRTL && localeIdentifier == other.localeIdentifier; - } -}; - -template -struct I18nManagerBaseI18nManagerConstantsBridging { - static I18nManagerBaseI18nManagerConstants fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - I18nManagerBaseI18nManagerConstants result{ - bridging::fromJs(rt, value.getProperty(rt, "doLeftAndRightSwapInRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "localeIdentifier"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool doLeftAndRightSwapInRTLToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static bool isRTLToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static std::optional localeIdentifierToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const I18nManagerBaseI18nManagerConstants &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "doLeftAndRightSwapInRTL", bridging::toJs(rt, value.doLeftAndRightSwapInRTL, jsInvoker)); - result.setProperty(rt, "isRTL", bridging::toJs(rt, value.isRTL, jsInvoker)); - if (value.localeIdentifier) { - result.setProperty(rt, "localeIdentifier", bridging::toJs(rt, value.localeIdentifier.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeI18nManagerCxxSpecJSI : public TurboModule { -protected: - NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void allowRTL(jsi::Runtime &rt, bool allowRTL) = 0; - virtual void forceRTL(jsi::Runtime &rt, bool forceRTL) = 0; - virtual void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) = 0; - -}; - -template -class JSI_EXPORT NativeI18nManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "I18nManager"; - -protected: - NativeI18nManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeI18nManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeI18nManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeI18nManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void allowRTL(jsi::Runtime &rt, bool allowRTL) override { - static_assert( - bridging::getParameterCount(&T::allowRTL) == 2, - "Expected allowRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::allowRTL, jsInvoker_, instance_, std::move(allowRTL)); - } - void forceRTL(jsi::Runtime &rt, bool forceRTL) override { - static_assert( - bridging::getParameterCount(&T::forceRTL) == 2, - "Expected forceRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::forceRTL, jsInvoker_, instance_, std::move(forceRTL)); - } - void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) override { - static_assert( - bridging::getParameterCount(&T::swapLeftAndRightInRTL) == 2, - "Expected swapLeftAndRightInRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::swapLeftAndRightInRTL, jsInvoker_, instance_, std::move(flipStyles)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpecJSI : public TurboModule { -protected: - NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void notifyTaskFinished(jsi::Runtime &rt, double taskId) = 0; - virtual jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) = 0; - -}; - -template -class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "HeadlessJsTaskSupport"; - -protected: - NativeHeadlessJsTaskSupportCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeHeadlessJsTaskSupportCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeHeadlessJsTaskSupportCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeHeadlessJsTaskSupportCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void notifyTaskFinished(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskFinished) == 2, - "Expected notifyTaskFinished(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskFinished, jsInvoker_, instance_, std::move(taskId)); - } - jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskRetry) == 2, - "Expected notifyTaskRetry(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskRetry, jsInvoker_, instance_, std::move(taskId)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedTurboModuleBaseEndResult - -template -struct NativeAnimatedTurboModuleBaseEndResult { - P0 finished; - P1 value; - bool operator==(const NativeAnimatedTurboModuleBaseEndResult &other) const { - return finished == other.finished && value == other.value; - } -}; - -template -struct NativeAnimatedTurboModuleBaseEndResultBridging { - static NativeAnimatedTurboModuleBaseEndResult fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeAnimatedTurboModuleBaseEndResult result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeAnimatedTurboModuleBaseEndResult &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedTurboModuleBaseEventMapping - -template -struct NativeAnimatedTurboModuleBaseEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedTurboModuleBaseEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedTurboModuleBaseEventMappingBridging { - static NativeAnimatedTurboModuleBaseEventMapping fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeAnimatedTurboModuleBaseEventMapping result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeAnimatedTurboModuleBaseEventMapping &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedTurboModule"; - -protected: - NativeAnimatedTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAnimatedTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedModuleBaseEndResult - -template -struct NativeAnimatedModuleBaseEndResult { - P0 finished; - P1 value; - bool operator==(const NativeAnimatedModuleBaseEndResult &other) const { - return finished == other.finished && value == other.value; - } -}; - -template -struct NativeAnimatedModuleBaseEndResultBridging { - static NativeAnimatedModuleBaseEndResult fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeAnimatedModuleBaseEndResult result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeAnimatedModuleBaseEndResult &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedModuleBaseEventMapping - -template -struct NativeAnimatedModuleBaseEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedModuleBaseEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedModuleBaseEventMappingBridging { - static NativeAnimatedModuleBaseEventMapping fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - NativeAnimatedModuleBaseEventMapping result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const NativeAnimatedModuleBaseEventMapping &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedModule"; - -protected: - NativeAnimatedModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeAnimatedModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - PushNotificationManagerBasePermissions - -template -struct PushNotificationManagerBasePermissions { - P0 alert; - P1 badge; - P2 sound; - bool operator==(const PushNotificationManagerBasePermissions &other) const { - return alert == other.alert && badge == other.badge && sound == other.sound; - } -}; - -template -struct PushNotificationManagerBasePermissionsBridging { - static PushNotificationManagerBasePermissions fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - PushNotificationManagerBasePermissions result{ - bridging::fromJs(rt, value.getProperty(rt, "alert"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "badge"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "sound"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool alertToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static bool badgeToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static bool soundToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const PushNotificationManagerBasePermissions &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "alert", bridging::toJs(rt, value.alert, jsInvoker)); - result.setProperty(rt, "badge", bridging::toJs(rt, value.badge, jsInvoker)); - result.setProperty(rt, "sound", bridging::toJs(rt, value.sound, jsInvoker)); - return result; - } -}; - - - -#pragma mark - PushNotificationManagerBaseNotification - -template -struct PushNotificationManagerBaseNotification { - P0 alertTitle; - P1 fireDate; - P2 alertBody; - P3 alertAction; - P4 userInfo; - P5 category; - P6 repeatInterval; - P7 applicationIconBadgeNumber; - P8 isSilent; - P9 soundName; - bool operator==(const PushNotificationManagerBaseNotification &other) const { - return alertTitle == other.alertTitle && fireDate == other.fireDate && alertBody == other.alertBody && alertAction == other.alertAction && userInfo == other.userInfo && category == other.category && repeatInterval == other.repeatInterval && applicationIconBadgeNumber == other.applicationIconBadgeNumber && isSilent == other.isSilent && soundName == other.soundName; - } -}; - -template -struct PushNotificationManagerBaseNotificationBridging { - static PushNotificationManagerBaseNotification fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - PushNotificationManagerBaseNotification result{ - bridging::fromJs(rt, value.getProperty(rt, "alertTitle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fireDate"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "alertBody"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "alertAction"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInfo"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "category"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "repeatInterval"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "applicationIconBadgeNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isSilent"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "soundName"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional alertTitleToJs(jsi::Runtime &rt, P0 value) { - return bridging::toJs(rt, value); - } - - static std::optional fireDateToJs(jsi::Runtime &rt, P1 value) { - return bridging::toJs(rt, value); - } - - static std::optional alertBodyToJs(jsi::Runtime &rt, P2 value) { - return bridging::toJs(rt, value); - } - - static std::optional alertActionToJs(jsi::Runtime &rt, P3 value) { - return bridging::toJs(rt, value); - } - - static std::optional userInfoToJs(jsi::Runtime &rt, P4 value) { - return bridging::toJs(rt, value); - } - - static std::optional categoryToJs(jsi::Runtime &rt, P5 value) { - return bridging::toJs(rt, value); - } - - static std::optional repeatIntervalToJs(jsi::Runtime &rt, P6 value) { - return bridging::toJs(rt, value); - } - - static std::optional applicationIconBadgeNumberToJs(jsi::Runtime &rt, P7 value) { - return bridging::toJs(rt, value); - } - - static std::optional isSilentToJs(jsi::Runtime &rt, P8 value) { - return bridging::toJs(rt, value); - } - - static std::optional soundNameToJs(jsi::Runtime &rt, P9 value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const PushNotificationManagerBaseNotification &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.alertTitle) { - result.setProperty(rt, "alertTitle", bridging::toJs(rt, value.alertTitle.value(), jsInvoker)); - } - if (value.fireDate) { - result.setProperty(rt, "fireDate", bridging::toJs(rt, value.fireDate.value(), jsInvoker)); - } - if (value.alertBody) { - result.setProperty(rt, "alertBody", bridging::toJs(rt, value.alertBody.value(), jsInvoker)); - } - if (value.alertAction) { - result.setProperty(rt, "alertAction", bridging::toJs(rt, value.alertAction.value(), jsInvoker)); - } - if (value.userInfo) { - result.setProperty(rt, "userInfo", bridging::toJs(rt, value.userInfo.value(), jsInvoker)); - } - if (value.category) { - result.setProperty(rt, "category", bridging::toJs(rt, value.category.value(), jsInvoker)); - } - if (value.repeatInterval) { - result.setProperty(rt, "repeatInterval", bridging::toJs(rt, value.repeatInterval.value(), jsInvoker)); - } - if (value.applicationIconBadgeNumber) { - result.setProperty(rt, "applicationIconBadgeNumber", bridging::toJs(rt, value.applicationIconBadgeNumber.value(), jsInvoker)); - } - if (value.isSilent) { - result.setProperty(rt, "isSilent", bridging::toJs(rt, value.isSilent.value(), jsInvoker)); - } - if (value.soundName) { - result.setProperty(rt, "soundName", bridging::toJs(rt, value.soundName.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) = 0; - virtual void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) = 0; - virtual void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) = 0; - virtual void abandonPermissions(jsi::Runtime &rt) = 0; - virtual void checkPermissions(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void cancelAllLocalNotifications(jsi::Runtime &rt) = 0; - virtual void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) = 0; - virtual jsi::Value getInitialNotification(jsi::Runtime &rt) = 0; - virtual void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void removeAllDeliveredNotifications(jsi::Runtime &rt) = 0; - virtual void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) = 0; - virtual void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "PushNotificationManager"; - -protected: - NativePushNotificationManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePushNotificationManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativePushNotificationManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePushNotificationManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) override { - static_assert( - bridging::getParameterCount(&T::onFinishRemoteNotification) == 3, - "Expected onFinishRemoteNotification(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::onFinishRemoteNotification, jsInvoker_, instance_, std::move(notificationId), std::move(fetchResult)); - } - void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) override { - static_assert( - bridging::getParameterCount(&T::setApplicationIconBadgeNumber) == 2, - "Expected setApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(num)); - } - void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getApplicationIconBadgeNumber) == 2, - "Expected getApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermissions) == 2, - "Expected requestPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermissions, jsInvoker_, instance_, std::move(permission)); - } - void abandonPermissions(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::abandonPermissions) == 1, - "Expected abandonPermissions(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::abandonPermissions, jsInvoker_, instance_); - } - void checkPermissions(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::checkPermissions) == 2, - "Expected checkPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermissions, jsInvoker_, instance_, std::move(callback)); - } - void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::presentLocalNotification) == 2, - "Expected presentLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::presentLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::scheduleLocalNotification) == 2, - "Expected scheduleLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::scheduleLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void cancelAllLocalNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancelAllLocalNotifications) == 1, - "Expected cancelAllLocalNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancelAllLocalNotifications, jsInvoker_, instance_); - } - void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) override { - static_assert( - bridging::getParameterCount(&T::cancelLocalNotifications) == 2, - "Expected cancelLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::cancelLocalNotifications, jsInvoker_, instance_, std::move(userInfo)); - } - jsi::Value getInitialNotification(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialNotification) == 1, - "Expected getInitialNotification(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialNotification, jsInvoker_, instance_); - } - void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getScheduledLocalNotifications) == 2, - "Expected getScheduledLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScheduledLocalNotifications, jsInvoker_, instance_, std::move(callback)); - } - void removeAllDeliveredNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::removeAllDeliveredNotifications) == 1, - "Expected removeAllDeliveredNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::removeAllDeliveredNotifications, jsInvoker_, instance_); - } - void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) override { - static_assert( - bridging::getParameterCount(&T::removeDeliveredNotifications) == 2, - "Expected removeDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeDeliveredNotifications, jsInvoker_, instance_, std::move(identifiers)); - } - void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getDeliveredNotifications) == 2, - "Expected getDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getDeliveredNotifications, jsInvoker_, instance_, std::move(callback)); - } - void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getAuthorizationStatus) == 2, - "Expected getAuthorizationStatus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getAuthorizationStatus, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLinkingManagerCxxSpecJSI : public TurboModule { -protected: - NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeLinkingManagerCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "LinkingManager"; - -protected: - NativeLinkingManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLinkingManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeLinkingManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLinkingManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeIntentAndroidCxxSpecJSI : public TurboModule { -protected: - NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) = 0; - -}; - -template -class JSI_EXPORT NativeIntentAndroidCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "IntentAndroid"; - -protected: - NativeIntentAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntentAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeIntentAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntentAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) override { - static_assert( - bridging::getParameterCount(&T::sendIntent) == 3, - "Expected sendIntent(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendIntent, jsInvoker_, instance_, std::move(action), std::move(extras)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeShareModuleCxxSpecJSI : public TurboModule { -protected: - NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) = 0; - -}; - -template -class JSI_EXPORT NativeShareModuleCxxSpec : public TurboModule { -public: - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.get(rt, propName); - } - - static constexpr std::string_view kModuleName = "ShareModule"; - -protected: - NativeShareModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeShareModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(static_cast(this), jsInvoker) {} - -private: - class Delegate : public NativeShareModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeShareModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {} - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) override { - static_assert( - bridging::getParameterCount(&T::share) == 3, - "Expected share(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::share, jsInvoker_, instance_, std::move(content), std::move(dialogTitle)); - } - - private: - T *instance_; - }; - - Delegate delegate_; -}; - -} // namespace react -} // namespace facebook diff --git a/template/ios/build/generated/ios/React-Codegen.podspec.json b/template/ios/build/generated/ios/React-Codegen.podspec.json deleted file mode 100644 index 71e2b68a..00000000 --- a/template/ios/build/generated/ios/React-Codegen.podspec.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"React-Codegen","version":"0.73.1","summary":"Temp pod for generated files for React Native","homepage":"https://facebook.com/","license":"Unlicense","authors":"Facebook","compiler_flags":"-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -Wno-nullability-completeness -std=c++20","source":{"git":""},"header_mappings_dir":"./","platforms":{"ios":"13.4"},"source_files":"**/*.{h,mm,cpp}","pod_target_xcconfig":{"HEADER_SEARCH_PATHS":"\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"$(PODS_ROOT)/Headers/Private/React-Fabric\" \"$(PODS_ROOT)/Headers/Private/React-RCTFabric\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_TARGET_SRCROOT)\"","FRAMEWORK_SEARCH_PATHS":[]},"dependencies":{"React-jsiexecutor":[],"RCT-Folly":[],"RCTRequired":[],"RCTTypeSafety":[],"React-Core":[],"React-jsi":[],"ReactCommon/turbomodule/bridging":[],"ReactCommon/turbomodule/core":[],"React-NativeModulesApple":[],"glog":[],"DoubleConversion":[],"hermes-engine":[],"React-rncore":[],"FBReactNativeSpec":[]}} \ No newline at end of file diff --git a/template/ios/tmp.xcconfig b/template/ios/tmp.xcconfig deleted file mode 100644 index e69de29b..00000000 diff --git a/template/metro.config.js b/template/metro.config.js index c58a52b1..a1392345 100644 --- a/template/metro.config.js +++ b/template/metro.config.js @@ -1,14 +1,12 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); +const { getDefaultConfig } = require('expo/metro-config'); +const { mergeConfig } = require('@react-native/metro-config'); /** * Metro configuration - * https://facebook.github.io/metro/docs/configuration + * https://reactnative.dev/docs/metro * * @type {import('metro-config').MetroConfig} */ -const config = { - resetCache: true, -}; +const config = {}; module.exports = mergeConfig(getDefaultConfig(__dirname), config); diff --git a/template/package.json b/template/package.json index 0d3b6918..13508d69 100644 --- a/template/package.json +++ b/template/package.json @@ -4,89 +4,93 @@ "private": true, "scripts": { "postinstall": "node ./scripts/setup.js", - "lint": "eslint index.js ./scripts/*.js ./src/** --ext .js,.ts,.tsx", - "start": "npx react-native start --reset-cache", + "lint": "eslint index.js ./declare/*.{ts,js,tsx} ./scripts/*.js ./src/**/*.{ts,js,tsx} ", + "start": "node scripts/start.js env/dev.json", "format": "prettier --write **/*.{ts,tsx,js,json,md}", - "splash": "node ./scripts/splash.js splash/splash.png FFFFFF 150 main BootSplash", + "splash": "node ./scripts/splash.js assets/splash/splash.png FFFFFF 150 main BootSplash", "type:check": "yarn tsc --noEmit --skipLibCheck", - "app-icon": "npx rn-ml appicon -s appicon/appicon.png", - "app-icon:dev": "npx rn-ml appicon -s appicon/appicon-dev.png -f dev -icn AppIcon-Dev", + "app-icon": "npx -y rn-ml appicon -s assets/appicon/appicon.png", + "app-icon:dev": "npx -y rn-ml appicon -s assets/appicon/appicon-dev.png -f dev -icn AppIcon-Dev", "ios:notification:dev": "node ./scripts/ios.js push-notification env/dev.json ", "android:report": "node scripts/android.js report", "android:hash": "node scripts/android.js hash", "android:gen-key": "node scripts/android.js keystore", "ios:dev": "node scripts/ios.js run env/dev.json", "android:dev": "node scripts/android.js run env/dev.json Debug", - "android:release": "node scripts/android.js run env/dev.json Release" + "android:release": "node scripts/android.js run env/dev.json Release", + "test": "jest" }, "dependencies": { "@gorhom/portal": "^1.0.14", - "@hookform/resolvers": "^3.3.4", - "@react-native-community/netinfo": "^11.3.1", + "@hookform/resolvers": "^3.7.0", + "@react-native-community/netinfo": "^11.3.2", "@react-native-masked-view/masked-view": "^0.3.1", "@react-navigation/native": "^6.1.17", - "@react-navigation/native-stack": "^6.9.26", - "@reduxjs/toolkit": "^2.2.1", + "@react-navigation/native-stack": "^6.10.0", + "@reduxjs/toolkit": "^2.2.6", "@shopify/flash-list": "^1.6.4", - "@shopify/react-native-skia": "^1.0.4", - "axios": "^1.6.8", - "expo": "^50.0.13", - "expo-font": "^11.10.3", - "expo-image": "^1.10.6", + "@shopify/react-native-skia": "^1.3.7", + "axios": "^1.7.2", + "expo": "^51.0.0", + "expo-dev-client": "~4.0.19", + "expo-font": "^12.0.7", + "expo-image": "^1.12.12", + "expo-status-bar": "^1.12.1", "i18next": "^20.4.0", "moment": "^2.29.4", "react": "18.2.0", "react-fast-compare": "^3.2.2", "react-freeze": "^1.0.4", - "react-hook-form": "^7.51.0", + "react-hook-form": "^7.52.1", "react-i18next": "^11.11.4", - "react-native": "0.73.8", - "react-native-animateable-text": "^0.11.1", - "react-native-bootsplash": "^5.4.1", - "react-native-gesture-handler": "^2.15.0", - "react-native-keyboard-controller": "^1.11.2", + "react-native": "0.74.5", + "react-native-animateable-text": "^0.12.1", + "react-native-bootsplash": "^5.5.3", + "react-native-gesture-handler": "^2.17.1", + "react-native-keyboard-controller": "^1.12.4", "react-native-keys": "^0.7.10", "react-native-linear-gradient": "^2.8.3", - "react-native-mmkv": "^2.12.1", - "react-native-reanimated": "3.8.1", - "react-native-safe-area-context": "^4.9.0", - "react-native-screens": "^3.29.0", - "react-native-svg": "^15.1.0", - "react-native-unistyles": "^2.4.0", - "react-native-vector-icons": "^10.0.3", - "react-redux": "^9.1.0", + "react-native-mmkv": "^2.12.2", + "react-native-reanimated": "^3.14.0", + "react-native-safe-area-context": "^4.10.7", + "react-native-screens": "^3.32.0", + "react-native-svg": "^15.3.0", + "react-native-unistyles": "^2.9.1", + "react-native-vector-icons": "^10.1.0", + "react-redux": "^9.1.2", "zod": "^3.22.4" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", - "@react-native/babel-preset": "^0.73.21", - "@react-native/eslint-config": "^0.73.2", - "@react-native/metro-config": "^0.73.5", - "@react-native/typescript-config": "^0.73.1", + "@eslint/compat": "^1.1.1", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.7.0", + "@react-native/babel-preset": "0.74.87", + "@react-native/eslint-config": "0.74.87", + "@react-native/metro-config": "0.74.87", + "@react-native/typescript-config": "0.74.87", "@types/jest": "^29.5.11", "@types/node": "^18.14.6", - "@types/react": "^18.0.24", + "@types/react": "^18.2.6", "@types/react-native-vector-icons": "^6.4.11", - "@types/react-redux": "^7.1.24", "@types/react-test-renderer": "^18.0.0", - "@typescript-eslint/eslint-plugin": "^5.17.0", - "@typescript-eslint/parser": "^5.17.0", + "@typescript-eslint/eslint-plugin": "^7.16.1", + "@typescript-eslint/parser": "^7.16.1", "babel-jest": "^29.6.3", "babel-plugin-module-resolver": "^5.0.0", "babel-plugin-transform-remove-console": "^6.9.4", "eslint": "^8.19.0", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.6.3", "lefthook": "1.5.2", "patch-package": "^8.0.0", - "prettier": "^2.8.8", + "prettier": "2.8.8", "react-test-renderer": "18.2.0", - "typescript": "5.0.4" - }, - "resolutions": { - "@types/react": "^18" + "typescript": "5.0.4", + "typescript-eslint": "^7.16.1" }, "engines": { "node": ">=18" diff --git a/template/patches/@expo+cli+0.18.28.patch b/template/patches/@expo+cli+0.18.28.patch new file mode 100644 index 00000000..737fbf42 --- /dev/null +++ b/template/patches/@expo+cli+0.18.28.patch @@ -0,0 +1,316 @@ +diff --git a/node_modules/@expo/cli/build/src/run/android/index.js b/node_modules/@expo/cli/build/src/run/android/index.js +index 9ccd32a..0ba8904 100644 +--- a/node_modules/@expo/cli/build/src/run/android/index.js ++++ b/node_modules/@expo/cli/build/src/run/android/index.js +@@ -76,6 +76,7 @@ const expoRunAndroid = async (argv)=>{ + "--no-install": Boolean, + "--no-bundler": Boolean, + "--variant": String, ++ "--appId": String, + // Unstable, temporary fallback to disable active archs only behavior + // TODO: replace with better fallback option, like free-form passing gradle props + "--all-arch": Boolean, +@@ -101,6 +102,7 @@ const expoRunAndroid = async (argv)=>{ + --no-build-cache Clear the native build cache + --no-install Skip installing dependencies + --no-bundler Skip starting the bundler ++ --appId Android application Id + --variant Build variant. {dim Default: debug} + -d, --device [device] Device name to run the app on + -p, --port Port to start the dev server on. {dim Default: 8081} +@@ -121,6 +123,7 @@ const expoRunAndroid = async (argv)=>{ + port: args["--port"], + variant: args["--variant"], + allArch: args["--all-arch"], ++ appId: args["--appId"], + // Custom parsed args + device: parsed.args["--device"] + }).catch(_errors.logCmdError); +diff --git a/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js b/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js +index bd1413b..b277716 100644 +--- a/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js ++++ b/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js +@@ -31,6 +31,7 @@ function _interopRequireDefault(obj) { + const debug = require("debug")("expo:run:android"); + async function runAndroidAsync(projectRoot, { install , ...options }) { + var ref; ++ + // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`. + (0, _nodeEnv.setNodeEnv)(options.variant === "release" ? "production" : "development"); + require("@expo/env").load(projectRoot); +@@ -38,6 +39,7 @@ async function runAndroidAsync(projectRoot, { install , ...options }) { + platform: "android", + install + }); ++ + const props = await (0, _resolveOptions.resolveOptionsAsync)(projectRoot, options); + debug("Package name: " + props.packageName); + _log.Log.log("› Building app..."); +@@ -57,11 +59,13 @@ async function runAndroidAsync(projectRoot, { install , ...options }) { + port: props.port, + // If a scheme is specified then use that instead of the package name. + scheme: (ref = await (0, _scheme.getSchemesForAndroidAsync)(projectRoot)) == null ? void 0 : ref[0], +- headless: !props.shouldStartBundler ++ headless: !props.shouldStartBundler, ++ appId: options?.appId + }); + await installAppAsync(androidProjectRoot, props); ++ + await manager.getDefaultDevServer().openCustomRuntimeAsync("emulator", { +- applicationId: props.packageName ++ applicationId: options?.appId ?? props.packageName + }, { + device: props.device.device + }); +diff --git a/node_modules/@expo/cli/build/src/run/ios/index.js b/node_modules/@expo/cli/build/src/run/ios/index.js +index 0332886..c7314d4 100644 +--- a/node_modules/@expo/cli/build/src/run/ios/index.js ++++ b/node_modules/@expo/cli/build/src/run/ios/index.js +@@ -75,6 +75,7 @@ const expoRunIos = async (argv)=>{ + "--no-install": Boolean, + "--no-bundler": Boolean, + "--configuration": String, ++ "--appId": String, + "--port": Number, + // Aliases + "-p": "--port", +@@ -92,6 +93,7 @@ const expoRunIos = async (argv)=>{ + `--no-install Skip installing dependencies`, + `--no-bundler Skip starting the Metro bundler`, + `--scheme [scheme] Scheme to build`, ++ `--appId IOS bundle identifier`, + (0, _chalk().default)`--configuration Xcode configuration to use. Debug or Release. {dim Default: Debug}`, + `-d, --device [device] Device name or UDID to build the app on`, + (0, _chalk().default)`-p, --port Port to start the Metro bundler on. {dim Default: 8081}`, +@@ -116,6 +118,7 @@ const expoRunIos = async (argv)=>{ + install: !args["--no-install"], + bundler: !args["--no-bundler"], + port: args["--port"], ++ appId: args["--appId"], + // Custom parsed args + device: parsed.args["--device"], + scheme: parsed.args["--scheme"], +diff --git a/node_modules/@expo/cli/build/src/run/ios/launchApp.js b/node_modules/@expo/cli/build/src/run/ios/launchApp.js +index e2a78ae..b96a024 100644 +--- a/node_modules/@expo/cli/build/src/run/ios/launchApp.js ++++ b/node_modules/@expo/cli/build/src/run/ios/launchApp.js +@@ -72,7 +72,7 @@ function _interopRequireWildcard(obj, nodeInterop) { + return newObj; + } + async function launchAppAsync(binaryPath, manager, props) { +- const appId = await (0, _profile.profile)(getBundleIdentifierForBinaryAsync)(binaryPath); ++ const appId = props?.appId ?? await (0, _profile.profile)(getBundleIdentifierForBinaryAsync)(binaryPath); + if (!props.isSimulator) { + if (props.device.osType === "macOS") { + await (0, _devicectl.launchBinaryOnMacAsync)(appId, binaryPath); +diff --git a/node_modules/@expo/cli/build/src/run/ios/runIosAsync.js b/node_modules/@expo/cli/build/src/run/ios/runIosAsync.js +index a59eb81..6ab1428 100644 +--- a/node_modules/@expo/cli/build/src/run/ios/runIosAsync.js ++++ b/node_modules/@expo/cli/build/src/run/ios/runIosAsync.js +@@ -98,13 +98,15 @@ async function runIosAsync(projectRoot, options) { + port: props.port, + headless: !props.shouldStartBundler, + // If a scheme is specified then use that instead of the package name. +- scheme: (ref = await (0, _scheme.getSchemesForIosAsync)(projectRoot)) == null ? void 0 : ref[0] ++ scheme: (ref = await (0, _scheme.getSchemesForIosAsync)(projectRoot)) == null ? void 0 : ref[0], ++ appId: options?.appId + }); + // Install and launch the app binary on a device. + await (0, _launchApp.launchAppAsync)(binaryPath, manager, { + isSimulator: props.isSimulator, + device: props.device, +- shouldStartBundler: props.shouldStartBundler ++ shouldStartBundler: props.shouldStartBundler, ++ appId: options?.appId + }); + // Log the location of the JS logs for the device. + if (props.shouldStartBundler) { +diff --git a/node_modules/@expo/cli/build/src/run/startBundler.js b/node_modules/@expo/cli/build/src/run/startBundler.js +index 74120d1..3bbda48 100644 +--- a/node_modules/@expo/cli/build/src/run/startBundler.js ++++ b/node_modules/@expo/cli/build/src/run/startBundler.js +@@ -69,7 +69,7 @@ function _interopRequireWildcard(obj, nodeInterop) { + } + return newObj; + } +-async function startBundlerAsync(projectRoot, { port , headless , scheme }) { ++async function startBundlerAsync(projectRoot, { port , headless , scheme, appId }) { + const options = { + port, + headless, +@@ -90,7 +90,8 @@ async function startBundlerAsync(projectRoot, { port , headless , scheme }) { + }); + var _platforms; + await (0, _startInterface.startInterfaceAsync)(devServerManager, { +- platforms: (_platforms = exp.platforms) != null ? _platforms : [] ++ platforms: (_platforms = exp.platforms) != null ? _platforms : [], ++ appId + }); + } else { + var ref; +diff --git a/node_modules/@expo/cli/build/src/start/index.js b/node_modules/@expo/cli/build/src/start/index.js +index a665d43..ba0e735 100644 +--- a/node_modules/@expo/cli/build/src/start/index.js ++++ b/node_modules/@expo/cli/build/src/start/index.js +@@ -82,6 +82,7 @@ const expoStart = async (argv)=>{ + "--localhost": Boolean, + "--offline": Boolean, + "--go": Boolean, ++ "--appId": String, + // Aliases + "-h": "--help", + "-c": "--clear", +@@ -119,6 +120,7 @@ const expoStart = async (argv)=>{ + `--localhost Same as --host localhost`, + ``, + `--offline Skip network requests and use anonymous manifest signatures`, ++ `--appId Android application id or ios bundle identifier`, + `--https Start the dev server with https protocol`, + `--scheme Custom URI protocol to use when launching an app`, + (0, _chalk().default)`-p, --port Port to start the dev server on (does not apply to web or tunnel). {dim Default: 8081}`, +diff --git a/node_modules/@expo/cli/build/src/start/interface/interactiveActions.js b/node_modules/@expo/cli/build/src/start/interface/interactiveActions.js +index 55f2a3a..210cc3a 100644 +--- a/node_modules/@expo/cli/build/src/start/interface/interactiveActions.js ++++ b/node_modules/@expo/cli/build/src/start/interface/interactiveActions.js +@@ -80,7 +80,7 @@ class DevServerManagerActions { + try { + const nativeRuntimeUrl = devServer.getNativeRuntimeUrl(); + const interstitialPageUrl = devServer.getRedirectUrl(); +- (0, _commandsTable.printQRCode)(interstitialPageUrl != null ? interstitialPageUrl : nativeRuntimeUrl); ++ // (0, _commandsTable.printQRCode)(interstitialPageUrl != null ? interstitialPageUrl : nativeRuntimeUrl); + if (interstitialPageUrl) { + _log.log((0, _commandsTable.printItem)((0, _chalk().default)`Choose an app to open your project at {underline ${interstitialPageUrl}}`)); + } +@@ -91,12 +91,12 @@ class DevServerManagerActions { + })}`); + } + _log.log((0, _commandsTable.printItem)((0, _chalk().default)`Metro waiting on {underline ${nativeRuntimeUrl}}`)); +- if (options.devClient === false) { +- // TODO: if development build, change this message! +- _log.log((0, _commandsTable.printItem)("Scan the QR code above with Expo Go (Android) or the Camera app (iOS)")); +- } else { +- _log.log((0, _commandsTable.printItem)("Scan the QR code above to open the project in a development build. " + (0, _link.learnMore)("https://expo.fyi/start"))); +- } ++ // if (options.devClient === false) { ++ // // TODO: if development build, change this message! ++ // _log.log((0, _commandsTable.printItem)("Scan the QR code above with Expo Go (Android) or the Camera app (iOS)")); ++ // } else { ++ // _log.log((0, _commandsTable.printItem)("Scan the QR code above to open the project in a development build. " + (0, _link.learnMore)("https://expo.fyi/start"))); ++ // } + } catch (error) { + console.log("err", error); + // @ts-ignore: If there is no development build scheme, then skip the QR code. +diff --git a/node_modules/@expo/cli/build/src/start/interface/startInterface.js b/node_modules/@expo/cli/build/src/start/interface/startInterface.js +index 57d60cd..e262bda 100644 +--- a/node_modules/@expo/cli/build/src/start/interface/startInterface.js ++++ b/node_modules/@expo/cli/build/src/start/interface/startInterface.js +@@ -173,7 +173,8 @@ async function startInterfaceAsync(devServerManager, options) { + } else { + try { + await server.openPlatformAsync(settings.launchTarget, { +- shouldPrompt ++ shouldPrompt, ++ appId: options?.appId + }); + (0, _commandsTable.printHelp)(); + } catch (error1) { +diff --git a/node_modules/@expo/cli/build/src/start/platforms/PlatformManager.js b/node_modules/@expo/cli/build/src/start/platforms/PlatformManager.js +index 3e1034a..afe55b2 100644 +--- a/node_modules/@expo/cli/build/src/start/platforms/PlatformManager.js ++++ b/node_modules/@expo/cli/build/src/start/platforms/PlatformManager.js +@@ -115,6 +115,7 @@ class PlatformManager { + platform: this.props.platform, + installedExpo: false + }); ++ + if (!url) { + url = this._resolveAlternativeLaunchUrl(applicationId, props); + } +diff --git a/node_modules/@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js b/node_modules/@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js +index 11db4a2..011835b 100644 +--- a/node_modules/@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js ++++ b/node_modules/@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js +@@ -17,6 +17,7 @@ class AndroidPlatformManager extends _platformManager.PlatformManager { + ...options, + resolveDeviceAsync: _androidDeviceManager.AndroidDeviceManager.resolveAsync + }); ++ this.packageName = undefined + this.projectRoot = projectRoot; + this.port = port; + } +@@ -26,11 +27,18 @@ class AndroidPlatformManager extends _platformManager.PlatformManager { + ]); + return super.openAsync(options, resolveSettings); + } ++ async updatePackageName() { ++ this.packageName = await this._getAppIdResolver().getAppIdFromNativeAsync() ++ } + _getAppIdResolver() { + return new _androidAppIdResolver.AndroidAppIdResolver(this.projectRoot); + } + _resolveAlternativeLaunchUrl(applicationId, props) { + var ref; ++ if(this.packageName && this.packageName !== applicationId){ ++ // Run app with custom application Id ++ return (ref = props == null ? void 0 : props.launchActivity) != null ? ref : `${applicationId}/${this.packageName}.MainActivity`; ++ } + return (ref = props == null ? void 0 : props.launchActivity) != null ? ref : `${applicationId}/.MainActivity`; + } + } +diff --git a/node_modules/@expo/cli/build/src/start/resolveOptions.js b/node_modules/@expo/cli/build/src/start/resolveOptions.js +index 2ab71b3..4b4921e 100644 +--- a/node_modules/@expo/cli/build/src/start/resolveOptions.js ++++ b/node_modules/@expo/cli/build/src/start/resolveOptions.js +@@ -70,6 +70,7 @@ async function resolveOptionsAsync(projectRoot, args) { + clear: !!args["--clear"], + dev: !args["--no-dev"], + https: !!args["--https"], ++ appId: args["--appId"], + maxWorkers: args["--max-workers"], + port: args["--port"], + minify: !!args["--minify"], +diff --git a/node_modules/@expo/cli/build/src/start/server/BundlerDevServer.js b/node_modules/@expo/cli/build/src/start/server/BundlerDevServer.js +index 7906e87..4cad39a 100644 +--- a/node_modules/@expo/cli/build/src/start/server/BundlerDevServer.js ++++ b/node_modules/@expo/cli/build/src/start/server/BundlerDevServer.js +@@ -30,6 +30,8 @@ const _delay = require("../../utils/delay"); + const _env = require("../../utils/env"); + const _errors = require("../../utils/errors"); + const _open = require("../../utils/open"); ++ ++ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj +@@ -332,8 +334,10 @@ class BundlerDevServer { + } + const runtime = this.isTargetingNative() ? this.isDevClient ? "custom" : "expo" : "web"; + const manager = await this.getPlatformManagerAsync(launchTarget); ++ const props = resolver?.appId ? { applicationId : resolver?.appId, packageName: resolver?.packageName } : undefined + return manager.openAsync({ +- runtime ++ runtime, ++ props + }, resolver); + } + /** Open the dev server in a runtime. */ async openCustomRuntimeAsync(launchTarget, launchProps = {}, resolver = {}) { +@@ -387,6 +391,7 @@ class BundlerDevServer { + hostType: "localhost" + }) + }); ++ await this.platformManagers[platform]?.updatePackageName?.(); + } + return this.platformManagers[platform]; + } +diff --git a/node_modules/@expo/cli/build/src/start/startAsync.js b/node_modules/@expo/cli/build/src/start/startAsync.js +index 1a57514..a690157 100644 +--- a/node_modules/@expo/cli/build/src/start/startAsync.js ++++ b/node_modules/@expo/cli/build/src/start/startAsync.js +@@ -166,6 +166,7 @@ async function startAsync(projectRoot, options, settings) { + if ((0, _interactive.isInteractive)()) { + var _platforms; + await (0, _profile.profile)(_startInterface.startInterfaceAsync)(devServerManager, { ++ appId: options?.appId, + platforms: (_platforms = exp.platforms) != null ? _platforms : [ + "ios", + "android", diff --git a/template/patches/@expo+config-plugins+8.0.8.patch b/template/patches/@expo+config-plugins+8.0.8.patch new file mode 100644 index 00000000..6d6d55db --- /dev/null +++ b/template/patches/@expo+config-plugins+8.0.8.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@expo/config-plugins/build/android/Package.js b/node_modules/@expo/config-plugins/build/android/Package.js +index cbc7688..22cc5e3 100644 +--- a/node_modules/@expo/config-plugins/build/android/Package.js ++++ b/node_modules/@expo/config-plugins/build/android/Package.js +@@ -281,7 +281,7 @@ async function getApplicationIdAsync(projectRoot) { + return null; + } + const buildGradle = await _fs().default.promises.readFile(buildGradlePath, 'utf8'); +- const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/); ++ const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/) ?? buildGradle.match(/namespace ['"](.*)['"]/); + // TODO add fallback for legacy cases to read from AndroidManifest.xml + return matchResult?.[1] ?? null; + } diff --git a/template/patches/react-native-reanimated+3.8.1.patch b/template/patches/react-native-reanimated+3.8.1.patch deleted file mode 100644 index cb77d6a2..00000000 --- a/template/patches/react-native-reanimated+3.8.1.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java b/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java -index 5db6885..a146a9e 100644 ---- a/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java -+++ b/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java -@@ -1,7 +1,7 @@ - package com.swmansion.reanimated; - - import static java.lang.Float.NaN; -- -+import android.util.Log; - import android.view.View; - import com.facebook.react.bridge.Arguments; - import com.facebook.react.bridge.GuardedRunnable; -@@ -344,6 +344,18 @@ public class NodesManager implements EventDispatcherListener { - } - - public void updateProps(int viewTag, Map props) { -+ // We need to check current view exist in UIManager or not -+ // Sometime, view can be replace, recycle, ... with wrong way (like FlashList) -+ // So before update, We need to check view tag exist in UIManager -+ try { -+ View view = mUIManager.resolveView(viewTag); -+ if(view == null) { -+ return; -+ } -+ } catch (Exception ex) { -+ Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!"); -+ return; -+ } - // TODO: update PropsNode to use this method instead of its own way of updating props - boolean hasUIProps = false; - boolean hasNativeProps = false; diff --git a/template/scripts/android.js b/template/scripts/android.js index b48345b0..7b40c63c 100644 --- a/template/scripts/android.js +++ b/template/scripts/android.js @@ -9,7 +9,7 @@ const { createInterface } = require('readline'); const { getEnvJsonFromPath } = require('./common'); -const run = ({ platform, buildType, envPath }) => { +const run = ({ buildType, envPath }) => { const envJson = getEnvJsonFromPath(envPath); // uninstall android app with adb @@ -24,18 +24,10 @@ const run = ({ platform, buildType, envPath }) => { console.log('Old App not found'); } } - - if (platform === 'darwin') { - execSync( - `npx react-native run-android --mode=${variant} --appId=${envJson.public.BUNDLE_IDENTIFIER}`, - { stdio: 'inherit' }, - ); - } else if (platform === 'win32') { - execSync( - `npx react-native run-android --mode=${variant} --appId=${envJson.public.BUNDLE_IDENTIFIER}`, - { stdio: 'inherit', shell: 'cmd.exe' }, - ); - } + execSync( + `npx expo run:android --variant ${variant} --appId=${envJson.public.BUNDLE_IDENTIFIER}`, + { stdio: 'inherit' }, + ); }; const getHashCommand = ({ keyStorePath, keyStorePass, alias }) => { @@ -47,9 +39,9 @@ const getHash = () => { execSync( getHashCommand({ - keyStorePath: 'android/app/debug.keystore', - keyStorePass: 'android', alias: 'androiddebugkey', + keyStorePass: 'android', + keyStorePath: 'android/app/debug.keystore', }), { stdio: 'inherit' }, ); @@ -63,9 +55,9 @@ const getHash = () => { execSync( getHashCommand({ - keyStorePath: `fastlane/release-keystore/${envJson.public.ANDROID_KEY_STORE_FILE}`, - keyStorePass: envJson.public.ANDROID_KEY_STORE_KEY_PASSWORD, alias: envJson.public.ANDROID_KEY_STORE_KEY_ALIAS, + keyStorePass: envJson.public.ANDROID_KEY_STORE_KEY_PASSWORD, + keyStorePath: `fastlane/release-keystore/${envJson.public.ANDROID_KEY_STORE_FILE}`, }), { stdio: 'inherit' }, ); @@ -84,8 +76,8 @@ const signingReport = () => { execSync( getReportCommand({ alias: 'androiddebugkey', - keyStorePath: 'android/app/debug.keystore', keyStorePass: 'android', + keyStorePath: 'android/app/debug.keystore', }), { stdio: 'inherit', @@ -104,8 +96,8 @@ const signingReport = () => { execSync( getReportCommand({ alias: `${envJson.public.ANDROID_KEY_STORE_KEY_ALIAS}`, - keyStorePath: `fastlane/release-keystore/${envJson.public.ANDROID_KEY_STORE_FILE}`, keyStorePass: `${envJson.public.ANDROID_KEY_STORE_KEY_PASSWORD}`, + keyStorePath: `fastlane/release-keystore/${envJson.public.ANDROID_KEY_STORE_FILE}`, }), { stdio: 'inherit', @@ -158,7 +150,7 @@ const genKeyStore = async () => { switch (nameFunc) { case 'run': - run({ platform, buildType, envPath }); + run({ buildType, envPath, platform }); break; case 'hash': diff --git a/template/scripts/common.js b/template/scripts/common.js index 8253f511..59f9c25b 100644 --- a/template/scripts/common.js +++ b/template/scripts/common.js @@ -1,6 +1,6 @@ /* eslint-disable import/order */ /* eslint-disable @typescript-eslint/no-var-requires */ -const { execSync } = require('child_process'); +const { execSync, spawnSync } = require('child_process'); const { readFileSync, writeFileSync } = require('fs'); @@ -73,9 +73,9 @@ import Keys from 'react-native-keys'; infoJsEnv += '\n'; // remove cache - execSync('rm -rf $TMPDIR/metro-*'); + spawnSync('rm -rf $TMPDIR/metro-*'); - execSync('rm -rf node_modules/.cache/babel-loader/*'); + spawnSync('rm -rf node_modules/.cache/babel-loader/*'); // write env-config.ts writeFileSync( @@ -115,8 +115,8 @@ const getAndroidHome = () => { }; module.exports = { + getAndroidHome, getEnvJsonFromPath, - setupEnv, getRubyVersion, - getAndroidHome, + setupEnv, }; diff --git a/template/scripts/ios.js b/template/scripts/ios.js index 74d87b36..894e53f1 100644 --- a/template/scripts/ios.js +++ b/template/scripts/ios.js @@ -28,34 +28,22 @@ const uninstallOldApp = bundleId => { execSync(`xcrun simctl uninstall booted "${bundleId}"`); }; -const run = ({ platform, envPath }) => { - if (platform !== 'darwin') { - console.log('This script is only for macOS'); - - return; - } - +const run = ({ envPath }) => { const envJson = getEnvJsonFromPath(envPath); - const simulator = 'iPhone 14 Pro'; + const simulator = 'iPhone 15 Pro Max'; const udid = bootDevice(simulator); uninstallOldApp(envJson.public.BUNDLE_IDENTIFIER); execSync( - `npx react-native run-ios --scheme ${envJson.public.WORKSPACE_NAME}-${envJson.public.SCHEME_SUFFIX} --udid=${udid}`, + `npx expo run:ios --appId ${envJson.public.BUNDLE_IDENTIFIER} --scheme ${envJson.public.WORKSPACE_NAME}-${envJson.public.SCHEME_SUFFIX} --device ${udid}`, { stdio: 'inherit' }, ); }; -const pushNotification = ({ envPath, platform }) => { - if (platform !== 'darwin') { - console.log('This script is only for macOS'); - - return; - } - +const pushNotification = ({ envPath }) => { const envJson = getEnvJsonFromPath(envPath); const simulator = 'iPhone 14 Pro'; @@ -71,17 +59,23 @@ const pushNotification = ({ envPath, platform }) => { (() => { const { argv, platform } = process; + if (platform !== 'darwin') { + console.log('This script is only for macOS'); + + return; + } + const actualArgv = argv.slice(2); const [nameFunc, envPath] = actualArgv; switch (nameFunc) { case 'run': - run({ platform, envPath }); + run({ envPath }); break; case 'push-notification': - pushNotification({ platform, envPath }); + pushNotification({ envPath }); break; diff --git a/template/scripts/setup.js b/template/scripts/setup.js index 0a32f3f4..990553ca 100644 --- a/template/scripts/setup.js +++ b/template/scripts/setup.js @@ -1,13 +1,13 @@ /* eslint-disable @typescript-eslint/no-var-requires */ -const { execSync } = require('child_process'); +const { execSync, spawnSync } = require('child_process'); const { getAndroidHome, getRubyVersion } = require('./common'); (function () { try { - execSync('npx lefthook install', { stdio: 'inherit' }); + execSync('npx --yes patch-package', { stdio: 'inherit' }); - execSync('yarn patch-package', { stdio: 'inherit' }); + spawnSync('npx lefthook install', { stdio: 'inherit' }); if (getAndroidHome() !== '') { execSync( diff --git a/template/scripts/splash.js b/template/scripts/splash.js index 7d920864..58119a0f 100644 --- a/template/scripts/splash.js +++ b/template/scripts/splash.js @@ -3,8 +3,10 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const { execSync } = require('child_process'); -const { readFileSync, rmSync, writeFileSync } = require('fs'); -const { resolve } = require('path')(function () { +const { readFileSync, rmSync, writeFileSync, copyFileSync } = require('fs'); +const { resolve } = require('path'); + +(function () { const { argv } = process; const actualArgv = argv.slice(2); @@ -43,7 +45,7 @@ const { resolve } = require('path')(function () { ); // remove old .imageset if exist - rmSync(newBootSplashLogoPath, { recursive: true, force: true }); + rmSync(newBootSplashLogoPath, { force: true, recursive: true }); execSync( `yarn react-native generate-bootsplash ${path} --background=${bgColor} --platforms=android,ios --logo-width=${width} --assets-output=assets --flavor=${flavor}`, @@ -59,7 +61,7 @@ const { resolve } = require('path')(function () { 'utf8', ); - execSync(`mv -f ${oldBootSplashPath} ${newBootSplashPath}`); + copyFileSync(oldBootSplashPath, newBootSplashPath); if (oldBootSplashLogoPath !== newBootSplashLogoPath) { execSync(`mv -f ${oldBootSplashLogoPath} ${newBootSplashLogoPath}`); diff --git a/template/scripts/start.js b/template/scripts/start.js new file mode 100644 index 00000000..d27b30f4 --- /dev/null +++ b/template/scripts/start.js @@ -0,0 +1,21 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const { execSync } = require('child_process'); + +const { getEnvJsonFromPath } = require('./common'); + +(() => { + const { argv } = process; + + const actualArgv = argv.slice(2); + + const [envPath] = actualArgv; + + const envJson = getEnvJsonFromPath(envPath); + + execSync( + `npx expo start --appId ${envJson.public.BUNDLE_IDENTIFIER} --clear`, + { + stdio: 'inherit', + }, + ); +})(); diff --git a/template/sonar-project.properties b/template/sonar-project.properties new file mode 100644 index 00000000..238769df --- /dev/null +++ b/template/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=Helloworld +sonar.projectName=Helloworld +sonar.projectVersion=1.0 +sonar.sources=./src,./declare +sonar.sourceEncoding=UTF-8 +sonar.host.url=http://localhost:9000 +sonar.exclusions=**/themes/colors/**,**/.yarn/** diff --git a/template/src/app.tsx b/template/src/app.tsx index 02a5d9ad..d51f1e74 100644 --- a/template/src/app.tsx +++ b/template/src/app.tsx @@ -1,5 +1,5 @@ import React, { ReactNode, Suspense, useState } from 'react'; -import { StatusBar, StyleSheet } from 'react-native'; +import { StyleSheet } from 'react-native'; import { I18nextProvider } from 'react-i18next'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; @@ -15,20 +15,21 @@ import { useLoadFont } from '@theme/typography'; import I18n from '@utils/i18n/i18n'; import './app/themes/index'; -// const json = require('./app/assets/vector-icon/selection.json'); - -// const key = json.icons.reduce((pv, curr) => { -// pv[(curr.properties.name as string).replaceAll('-', '_')] = -// curr.properties.name; - -// return pv; -// }, {}); - -// console.log( -// Object.entries(key) -// .sort(([, a], [, b]) => a - b) -// .reduce((r, [k, v]) => ({ ...r, [k]: v }), {}), -// ); +/** + * const json = require('./app/library/components/vector-icon/selection.json'); + * const key = json.icons.reduce((pv, curr) => { + * pv[(curr.properties.name as string).replaceAll('-', '_')] = + * curr.properties.name; + * + * return pv; + * }, {}); + * + * console.log( + * Object.entries(key) + * .sort(([, a], [, b]) => a - b) + * .reduce((r, [k, v]) => ({ ...r, [k]: v }), {}), + * ); + */ const styles = StyleSheet.create({ root: { @@ -70,7 +71,6 @@ export const MyApp = () => { // render return ( - diff --git a/template/src/app/common/animated/hook.ts b/template/src/app/common/animated/hook.ts index 4488320c..a0abbc59 100644 --- a/template/src/app/common/animated/hook.ts +++ b/template/src/app/common/animated/hook.ts @@ -121,7 +121,7 @@ export function useInsideView( const rectTop = useSharedValue(0); const visible = useDerivedValue(() => { - return rectTop.value <= (wrapHeight || height) && rectBottom.value >= 0; + return rectTop.value <= (wrapHeight ?? height) && rectBottom.value >= 0; }); useDerivedValue(() => { @@ -167,7 +167,7 @@ type UseTimingParams = { export const useTiming = ({ callback, - config, + config = {}, from = 0, toValue = 1, delay = 0, @@ -180,13 +180,12 @@ export const useTiming = ({ delay, withTiming( toValue, - Object.assign( - { - duration: 500, - easing: Easing.bezier(0.33, 0.01, 0, 1), - }, - config, - ), + { + duration: 500, + easing: Easing.bezier(0.33, 0.01, 0, 1), + ...config, + }, + callback, ), ); diff --git a/template/src/app/common/animated/math.ts b/template/src/app/common/animated/math.ts index 048241d9..e1969c11 100644 --- a/template/src/app/common/animated/math.ts +++ b/template/src/app/common/animated/math.ts @@ -32,7 +32,7 @@ export const sharedSub = (...args: number[]) => { export const sharedMin = (...args: number[]) => { 'worklet'; - return args.reduce((accumulator, curr) => Math.min(curr, accumulator)); + return Math.min.call(null, ...args); }; /** @@ -41,7 +41,7 @@ export const sharedMin = (...args: number[]) => { export const sharedMax = (...args: number[]) => { 'worklet'; - return args.reduce((accumulator, curr) => Math.max(accumulator, curr)); + return Math.max.call(null, ...args); }; /** diff --git a/template/src/app/common/animated/running-animated.ts b/template/src/app/common/animated/running-animated.ts index 9b77539c..01a55e6e 100644 --- a/template/src/app/common/animated/running-animated.ts +++ b/template/src/app/common/animated/running-animated.ts @@ -13,8 +13,8 @@ import { WithTimingConfig, } from 'react-native-reanimated'; -import { HigherOrderAnimation } from 'react-native-reanimated/lib/typescript/reanimated2/animation'; -import { Timestamp } from 'react-native-reanimated/lib/typescript/reanimated2/commonTypes'; +import { HigherOrderAnimation } from 'react-native-reanimated/lib/typescript/animation'; +import { Timestamp } from 'react-native-reanimated/lib/typescript/commonTypes'; /** * Updates position by running timing based animation from a given position to a destination determined by toValue. @@ -28,13 +28,11 @@ export const sharedTiming = ( return withTiming( toValue, - Object.assign( - { - duration: 500, - easing: Easing.bezier(0.33, 0.01, 0, 1), - }, - config, - ), + { + duration: 500, + easing: Easing.bezier(0.33, 0.01, 0, 1), + ...(config ?? {}), + }, callBack, ); }; @@ -123,16 +121,16 @@ export const sharePause = function ( }; return { + callback, + current: nextAnimation.current, + elapsed: 0, isHigherOrder: true, + lastTimestamp: 0, onFrame, onStart, - current: nextAnimation.current, - callback, previousAnimation: null, startTime: 0, started: false, - lastTimestamp: 0, - elapsed: 0, }; }, ); diff --git a/template/src/app/common/animated/transition.ts b/template/src/app/common/animated/transition.ts index 23dbce76..4da1f711 100644 --- a/template/src/app/common/animated/transition.ts +++ b/template/src/app/common/animated/transition.ts @@ -1,7 +1,8 @@ import { useEffect } from 'react'; -import Animated, { +import { Easing, + SharedValue, useDerivedValue, useSharedValue, withSpring, @@ -19,7 +20,7 @@ export const useSharedTransition = ( state: boolean | number, config?: WithTimingConfig, initialValue?: number, -): Animated.SharedValue => { +): SharedValue => { const value = useSharedValue(initialValue ?? 0); useEffect(() => { @@ -27,13 +28,11 @@ export const useSharedTransition = ( }, [state, value]); return useDerivedValue(() => - withTiming( - value.value, - Object.assign( - { duration: 500, easing: Easing.bezier(0.33, 0.01, 0, 1) }, - config, - ), - ), + withTiming(value.value, { + duration: 500, + easing: Easing.bezier(0.33, 0.01, 0, 1), + ...(config ?? {}), + }), ); }; @@ -44,7 +43,7 @@ export const useSharedSpringTransition = ( state: boolean, config?: WithSpringConfig, initialValue?: number, -): Animated.SharedValue => { +): SharedValue => { const value = useSharedValue(initialValue ?? 0); useEffect(() => { diff --git a/template/src/app/common/camera-roll/hooks.ts b/template/src/app/common/camera-roll/hooks.ts index 08db99be..fcb6a941 100644 --- a/template/src/app/common/camera-roll/hooks.ts +++ b/template/src/app/common/camera-roll/hooks.ts @@ -1,124 +1,127 @@ -// import { useCallback, useEffect, useState } from 'react'; -// import { AppState, EmitterSubscription, Platform } from 'react-native'; export {}; -// import { -// cameraRollEventEmitter, -// CameraRoll as PhotoGallery, -// PhotoIdentifier, -// } from '@react-native-camera-roll/camera-roll'; -// import { GalleryLogic, GalleryOptions, Media, MediaType } from './type'; +/** +import { useCallback, useEffect, useState } from 'react'; +import { AppState, EmitterSubscription, Platform } from 'react-native'; +import { + cameraRollEventEmitter, + CameraRoll as PhotoGallery, + PhotoIdentifier, +} from '@react-native-camera-roll/camera-roll'; -// const isAndroid = Platform.OS === 'android'; -// const isAboveIOS14 = parseInt(String(Platform.Version), 10) > 14; +import { GalleryLogic, GalleryOptions, Media, MediaType } from './type'; -// const convertMedia = (edges: Array): Array => { -// return edges.map(x => ({ -// uri: x.node.image.uri, -// type: x.node.type as MediaType, -// playableDuration: x.node.image?.playableDuration ?? 0, -// })); -// }; +const isAndroid = Platform.OS === 'android'; +const isAboveIOS14 = parseInt(String(Platform.Version), 10) > 14; -// export const useGallery = ({ -// pageSize = 30, -// assetType, -// }: GalleryOptions): GalleryLogic => { -// const [isLoading, setIsLoading] = useState(false); -// const [isReloading, setIsReloading] = useState(false); -// const [isLoadingNextPage, setIsLoadingNextPage] = useState(false); -// const [hasNextPage, setHasNextPage] = useState(false); -// const [nextCursor, setNextCursor] = useState(); -// const [medias, setMedias] = useState>([]); +const convertMedia = (edges: Array): Array => { + return edges.map(x => ({ + uri: x.node.image.uri, + type: x.node.type as MediaType, + playableDuration: x.node.image?.playableDuration ?? 0, + })); +}; -// const loadNextPage = useCallback(async () => { -// try { -// nextCursor ? setIsLoadingNextPage(true) : setIsLoading(true); -// const { edges, page_info } = await PhotoGallery.getPhotos({ -// first: pageSize, -// after: nextCursor, -// assetType, -// ...(isAndroid && { include: ['fileSize', 'filename'] }), -// }); -// const newMedias = convertMedia(edges); -// console.log(JSON.stringify(edges)); -// setMedias(prev => [...(prev ?? []), ...newMedias]); +export const useGallery = ({ + pageSize = 30, + assetType, +}: GalleryOptions): GalleryLogic => { + const [isLoading, setIsLoading] = useState(false); + const [isReloading, setIsReloading] = useState(false); + const [isLoadingNextPage, setIsLoadingNextPage] = useState(false); + const [hasNextPage, setHasNextPage] = useState(false); + const [nextCursor, setNextCursor] = useState(); + const [medias, setMedias] = useState>([]); -// setNextCursor(page_info.end_cursor); -// setHasNextPage(page_info.has_next_page); -// } catch (error) { -// console.error('useGallery getPhotos error:', error); -// } finally { -// setIsLoading(false); -// setIsLoadingNextPage(false); -// } -// }, [assetType, nextCursor, pageSize]); + const loadNextPage = useCallback(async () => { + try { + nextCursor ? setIsLoadingNextPage(true) : setIsLoading(true); + const { edges, page_info } = await PhotoGallery.getPhotos({ + first: pageSize, + after: nextCursor, + assetType, + ...(isAndroid && { include: ['fileSize', 'filename'] }), + }); + const newMedias = convertMedia(edges); + console.log(JSON.stringify(edges)); + setMedias(prev => [...(prev ?? []), ...newMedias]); -// const getUnloadedPictures = useCallback(async () => { -// try { -// setIsReloading(true); -// const { edges, page_info } = await PhotoGallery.getPhotos({ -// first: !medias || medias.length < pageSize ? pageSize : medias.length, -// assetType, -// // Include fileSize only for android since it's causing performance issues on IOS. -// ...(isAndroid && { include: ['fileSize', 'filename'] }), -// }); -// const newMedias = convertMedia(edges); -// setMedias(newMedias); -// setNextCursor(page_info.end_cursor); -// setHasNextPage(page_info.has_next_page); -// } catch (error) { -// console.error('useGallery getNewPhotos error:', error); -// } finally { -// setIsReloading(false); -// } -// }, [assetType, pageSize, medias]); + setNextCursor(page_info.end_cursor); + setHasNextPage(page_info.has_next_page); + } catch (error) { + console.error('useGallery getPhotos error:', error); + } finally { + setIsLoading(false); + setIsLoadingNextPage(false); + } + }, [assetType, nextCursor, pageSize]); -// useEffect(() => { -// if (medias.length <= 0) { -// loadNextPage(); -// } -// }, [loadNextPage, medias]); + const getUnloadedPictures = useCallback(async () => { + try { + setIsReloading(true); + const { edges, page_info } = await PhotoGallery.getPhotos({ + first: !medias || medias.length < pageSize ? pageSize : medias.length, + assetType, + // Include fileSize only for android since it's causing performance issues on IOS. + ...(isAndroid && { include: ['fileSize', 'filename'] }), + }); + const newMedias = convertMedia(edges); + setMedias(newMedias); + setNextCursor(page_info.end_cursor); + setHasNextPage(page_info.has_next_page); + } catch (error) { + console.error('useGallery getNewPhotos error:', error); + } finally { + setIsReloading(false); + } + }, [assetType, pageSize, medias]); -// useEffect(() => { -// const subscription = AppState.addEventListener( -// 'change', -// async nextAppState => { -// if (nextAppState === 'active') { -// getUnloadedPictures(); -// } -// }, -// ); + useEffect(() => { + if (medias.length <= 0) { + loadNextPage(); + } + }, [loadNextPage, medias]); -// return () => { -// subscription.remove(); -// }; -// }, [getUnloadedPictures]); + useEffect(() => { + const subscription = AppState.addEventListener( + 'change', + async nextAppState => { + if (nextAppState === 'active') { + getUnloadedPictures(); + } + }, + ); -// useEffect(() => { -// let subscription: EmitterSubscription; -// if (isAboveIOS14) { -// subscription = cameraRollEventEmitter.addListener( -// 'onLibrarySelectionChange', -// _event => { -// getUnloadedPictures(); -// }, -// ); -// } + return () => { + subscription.remove(); + }; + }, [getUnloadedPictures]); -// return () => { -// if (isAboveIOS14 && subscription) { -// subscription.remove(); -// } -// }; -// }, [getUnloadedPictures]); + useEffect(() => { + let subscription: EmitterSubscription; + if (isAboveIOS14) { + subscription = cameraRollEventEmitter.addListener( + 'onLibrarySelectionChange', + _event => { + getUnloadedPictures(); + }, + ); + } -// return { -// medias, -// loadNextPage, -// isLoading, -// isLoadingNextPage, -// isReloading, -// hasNextPage, -// }; -// }; + return () => { + if (isAboveIOS14 && subscription) { + subscription.remove(); + } + }; + }, [getUnloadedPictures]); + + return { + medias, + loadNextPage, + isLoading, + isLoadingNextPage, + isReloading, + hasNextPage, + }; +}; + */ diff --git a/template/src/app/common/constant/index.ts b/template/src/app/common/constant/index.ts index 201778b3..f44cfa5b 100644 --- a/template/src/app/common/constant/index.ts +++ b/template/src/app/common/constant/index.ts @@ -1,3 +1,5 @@ +import { Platform } from 'react-native'; + export const MMKV_KEY = { APP_TOKEN: 'APP_TOKEN', } as const; @@ -5,14 +7,16 @@ export const MMKV_KEY = { export const API_CONFIG = { CODE_DEFAULT: -200, CODE_SUCCESS: 200, + CODE_TIME_OUT: 408, ERROR_NETWORK_CODE: -100, RESULT_CODE_PUSH_OUT: 401, - TIME_OUT: 10 * 1000, STATUS_TIME_OUT: 'ECONNABORTED', - CODE_TIME_OUT: 408, + TIME_OUT: 10 * 1000, +}; + +export const SLICE_NAME = { + APP: 'APP_', + AUTHENTICATION: 'AUTHENTICATION_', }; -export enum SLICE_NAME { - APP = 'APP_', - AUTHENTICATION = 'AUTHENTICATION_', -} +export const isIos = Platform.OS === 'ios'; diff --git a/template/src/app/common/emitter/index.ts b/template/src/app/common/emitter/index.ts index 3713c5f6..ca21f4f9 100644 --- a/template/src/app/common/emitter/index.ts +++ b/template/src/app/common/emitter/index.ts @@ -19,12 +19,12 @@ export const subscribeEvent = ( ] : [eventKey: T, listener: (data: P) => void] ) => { - const uuid = String.prototype.randomUniqueId(); + const uuid = randomUniqueId(); listeners.push({ - uuid, eventKey: args[0], listener: args[1], + uuid, }); return () => { @@ -39,11 +39,9 @@ export const emitEvent = ( ? undefined extends EventParamsList[T] ? [eventName: T] : [eventName: T, payload: P | EventParamsList[T]] - : [eventName: T, payload?: P | any] + : [eventName: T, payload?: P] ) => { - for (let index = 0; index < listeners.length; index++) { - const element = listeners[index]; - + for (const element of listeners) { if (element.eventKey === args[0]) { element.listener(args[1]); } diff --git a/template/src/app/common/firebase/auth.ts b/template/src/app/common/firebase/auth.ts index ae01a9e8..858a0d31 100644 --- a/template/src/app/common/firebase/auth.ts +++ b/template/src/app/common/firebase/auth.ts @@ -2,25 +2,27 @@ * remove this line when use */ export {}; -// import firebaseAuth, {FirebaseAuthTypes} from '@react-native-firebase/auth'; +/** +import firebaseAuth, {FirebaseAuthTypes} from '@react-native-firebase/auth'; -// export const onLoginWithEmailAndPassword = async ( -// email: string, -// password: string, -// ): Promise< -// FirebaseAuthTypes.UserCredential | FirebaseAuthTypes.NativeFirebaseAuthError -// > => { -// return await firebaseAuth() -// .signInWithEmailAndPassword(email, password) -// .then(user => { -// return user; -// }) -// .catch((error: FirebaseAuthTypes.NativeFirebaseAuthError) => { -// return error; -// }); -// }; -// export const onCheckLoggedIn = ( -// callback: (user: FirebaseAuthTypes.User | null) => void, -// ) => { -// firebaseAuth().onAuthStateChanged(callback); -// }; +export const onLoginWithEmailAndPassword = async ( + email: string, + password: string, +): Promise< + FirebaseAuthTypes.UserCredential | FirebaseAuthTypes.NativeFirebaseAuthError +> => { + return await firebaseAuth() + .signInWithEmailAndPassword(email, password) + .then(user => { + return user; + }) + .catch((error: FirebaseAuthTypes.NativeFirebaseAuthError) => { + return error; + }); +}; +export const onCheckLoggedIn = ( + callback: (user: FirebaseAuthTypes.User | null) => void, +) => { + firebaseAuth().onAuthStateChanged(callback); +}; + */ diff --git a/template/src/app/common/firebase/database.ts b/template/src/app/common/firebase/database.ts index 9773273e..60a72786 100644 --- a/template/src/app/common/firebase/database.ts +++ b/template/src/app/common/firebase/database.ts @@ -2,30 +2,32 @@ * remove this line when use */ export {}; -// /* eslint-disable @typescript-eslint/no-explicit-any */ -// import database, {FirebaseDatabaseTypes} from '@react-native-firebase/database'; +/** +// eslint-disable @typescript-eslint/no-explicit-any +import database, {FirebaseDatabaseTypes} from '@react-native-firebase/database'; -// import {isTypeof} from '../method'; -// export async function getDatabase(ref: string): Promise> { -// return await database() -// .ref(ref) -// .once('value') -// .then(snap => { -// return snap.val(); -// }) -// .catch(() => { -// return []; -// }); -// } -// export function onListenDataChange( -// ref: string, -// onChange: (data: Array) => void, -// ) { -// database() -// .ref(ref) -// .on('value', (snapshot: FirebaseDatabaseTypes.DataSnapshot) => { -// if (isTypeof(onChange, 'function')) { -// onChange(snapshot.val()); -// } -// }); -// } +import {isTypeof} from '../method'; +export async function getDatabase(ref: string): Promise> { + return await database() + .ref(ref) + .once('value') + .then(snap => { + return snap.val(); + }) + .catch(() => { + return []; + }); +} +export function onListenDataChange( + ref: string, + onChange: (data: Array) => void, +) { + database() + .ref(ref) + .on('value', (snapshot: FirebaseDatabaseTypes.DataSnapshot) => { + if (isTypeof(onChange, 'function')) { + onChange(snapshot.val()); + } + }); +} + */ diff --git a/template/src/app/common/firebase/index.ts b/template/src/app/common/firebase/index.ts index eb50f4a4..c1ed2368 100644 --- a/template/src/app/common/firebase/index.ts +++ b/template/src/app/common/firebase/index.ts @@ -1,7 +1,9 @@ -// import * as auth from './auth'; -// import * as database from './database'; -// import * as notification from './notification'; export {}; -// auth, -// database, -// notification, +/** +import * as auth from './auth'; +import * as database from './database'; +import * as notification from './notification'; +auth, +database, +notification, + */ diff --git a/template/src/app/common/firebase/notification.ts b/template/src/app/common/firebase/notification.ts index dc020e43..e0ef7f6a 100644 --- a/template/src/app/common/firebase/notification.ts +++ b/template/src/app/common/firebase/notification.ts @@ -2,89 +2,85 @@ * remove this line when use */ export {}; -// import {ReOmit} from '@common'; -// import messaging, { -// FirebaseMessagingTypes, -// } from '@react-native-firebase/messaging'; -// import {useEffect} from 'react'; +/** +import {ReOmit} from '@common'; +import messaging, { + FirebaseMessagingTypes, +} from '@react-native-firebase/messaging'; +import {useEffect} from 'react'; + +export interface RemoteNotification + extends ReOmit { +// Nested data from fcm is string. carefully when use +// example data:{ nested:{ a: 1 }} +// => nested will be string + data?: T; +} -// export interface RemoteNotification -// extends ReOmit { -// // Nested data from fcm is string. carefully when use -// // example data:{ nested:{ a: 1 }} -// // => nested will be string -// data?: T; -// } +export const requestNotificationPermission = async () => { + const authStatus = await messaging().requestPermission(); + const enabled = + authStatus === messaging.AuthorizationStatus.AUTHORIZED || + authStatus === messaging.AuthorizationStatus.PROVISIONAL; -// export const requestNotificationPermission = async () => { -// const authStatus = await messaging().requestPermission(); -// const enabled = -// authStatus === messaging.AuthorizationStatus.AUTHORIZED || -// authStatus === messaging.AuthorizationStatus.PROVISIONAL; + console.log('enabled', enabled); + return enabled; +}; -// console.log('enabled', enabled); -// return enabled; -// }; +export const getDeviceToken = async () => { + return messaging().getToken(); +}; -// export const getDeviceToken = async () => { -// return messaging().getToken(); -// }; +// Notification coming when app in foreground +export const useInAppNotification = ( + callback: (remoteNotification: RemoteNotification) => any, + ) => { + // effect + useEffect(() => { + messaging().onMessage( + callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, + ); + }, []); + }; -// /** -// * Notification coming when app in foreground -// */ -// export const useInAppNotification = ( -// callback: (remoteNotification: RemoteNotification) => any, -// ) => { -// // effect -// useEffect(() => { -// messaging().onMessage( -// callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, -// ); -// }, []); -// }; + // Notification coming when app in background or quit state + export const useBackgroundNotification = ( + callback: (remoteNotification: RemoteNotification) => any, + ) => { + useEffect(() => { + messaging().setBackgroundMessageHandler( + callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, + ); + }, []); + }; -// /** -// * Notification coming when app in background or quit state -// */ -// export const useBackgroundNotification = ( -// callback: (remoteNotification: RemoteNotification) => any, -// ) => { -// useEffect(() => { -// messaging().setBackgroundMessageHandler( -// callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, -// ); -// }, []); -// }; + // User click notification when app in background + export const useBackgroundOpenedNotification = ( + callback: (remoteNotification: RemoteNotification) => any, + ) => { + // effect + useEffect(() => { + messaging().onNotificationOpenedApp( + callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, + ); + }, []); + }; -// /** -// * User click notification when app in background -// */ -// export const useBackgroundOpenedNotification = ( -// callback: (remoteNotification: RemoteNotification) => any, -// ) => { -// // effect -// useEffect(() => { -// messaging().onNotificationOpenedApp( -// callback as (message: FirebaseMessagingTypes.RemoteMessage) => any, -// ); -// }, []); -// }; + // User click notification when app in killed or quit state -// /** -// * User click notification when app in killed or quit state -// */ -// export const useKilledOpenedNotification = ( -// callback: (remoteNotification: RemoteNotification | null) => any, -// ) => { -// // effect -// useEffect(() => { -// messaging() -// .getInitialNotification() -// .then( -// callback as ( -// message: FirebaseMessagingTypes.RemoteMessage | null, -// ) => any, -// ); -// }, []); -// }; + export const useKilledOpenedNotification = ( + callback: (remoteNotification: RemoteNotification | null) => any, + ) => { + // effect + useEffect(() => { + messaging() + .getInitialNotification() + .then( + callback as ( + message: FirebaseMessagingTypes.RemoteMessage | null, + ) => any, + ); + }, []); + }; + + */ diff --git a/template/src/app/common/hooks/index.ts b/template/src/app/common/hooks/index.ts index 5ca5831f..022a4423 100644 --- a/template/src/app/common/hooks/index.ts +++ b/template/src/app/common/hooks/index.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/ban-types */ /* eslint-disable @typescript-eslint/no-explicit-any */ import React, { - SetStateAction, useCallback, useEffect, useLayoutEffect, @@ -24,7 +23,6 @@ import { useTranslation as useRNTranslation, } from 'react-i18next'; -import { isTypeof } from '@common/method'; import NetInfo, { NetInfoState } from '@react-native-community/netinfo'; import { I18nKeys } from '@utils/i18n/locales'; import { StringMap, TFunctionResult, TOptions } from 'i18next'; @@ -51,23 +49,17 @@ function useNetWorkStatus(): NetInfoTuple { } function useInterval(callback: Function, delay: number) { - const savedCallback = useRef(); - - useEffect(() => { - savedCallback.current = callback; + const tick = useCallback(() => { + callback?.(); }, [callback]); useEffect(() => { - function tick() { - savedCallback.current && savedCallback.current(); - } - if (delay !== null) { const id = setInterval(tick, delay); return () => clearInterval(id); } - }, [delay]); + }, [delay, tick]); } function usePrevious(value: T): T | undefined { @@ -80,87 +72,6 @@ function usePrevious(value: T): T | undefined { return ref.current; } -type UseSetArrayStateAction = React.Dispatch< - SetStateAction> ->; -type UseSetStateArray = [ - T, - UseSetArrayStateAction, - () => void, -]; -function useSetStateArray( - initialValue: T, -): UseSetStateArray { - const [value, setValue] = useState(initialValue); - - const setState = useCallback( - (v: SetStateAction>) => { - return setValue(oldValue => ({ - ...oldValue, - ...(typeof v === 'function' ? v(oldValue) : v), - })); - }, - [setValue], - ); - - const resetState = useCallback(() => setValue(initialValue), [initialValue]); - - return [value, setState, resetState]; -} - -type UseSetStateAction = React.Dispatch< - SetStateAction> ->; -type UseSetState = { - setState: UseSetStateAction; - state: T; - resetState: () => void; -}; -function useSetState(initialValue: T): UseSetState { - const [state, setState, resetState] = useSetStateArray(initialValue); - - return useMemo( - () => ({ - setState, - resetState, - state, - }), - [setState, resetState, state], - ); -} - -function useAsyncState( - initialValue: T, -): [ - T, - (newValue: SetStateAction, callback?: (newState: T) => void) => void, -] { - const [state, setState] = useState(initialValue); - - const _callback = useRef<(newState: T) => void>(); - - const _setState = ( - newValue: SetStateAction, - callback?: (newState: T) => void, - ) => { - if (callback) { - _callback.current = callback; - } - - setState(newValue); - }; - - useEffect(() => { - if (typeof _callback.current === 'function') { - _callback.current(state); - - _callback.current = undefined; - } - }, [state]); - - return [state, _setState]; -} - function useUnMount(callback: () => void) { // eslint-disable-next-line react-hooks/exhaustive-deps return useEffect(() => () => callback(), []); @@ -171,18 +82,6 @@ function useDidMount(callback: () => void) { return useEffect(callback, []); } -function useForceUpdate() { - const unloadingRef = useRef(false); - - const [forcedRenderCount, setForcedRenderCount] = useState(0); - - useUnMount(() => (unloadingRef.current = true)); - - return useCallback(() => { - !unloadingRef.current && setForcedRenderCount(forcedRenderCount + 1); - }, [forcedRenderCount]); -} - function useIsKeyboardShown() { const [isKeyboardShown, setIsKeyboardShown] = React.useState(false); @@ -377,19 +276,16 @@ const useTranslation = < }; export { - useAsyncState, useDidMount, useDisableBackHandler, useDismissKeyboard, useErrorMessageTranslation, useEventCallback, - useForceUpdate, useInterval, useIsKeyboardShown, useMounted, useNetWorkStatus, usePrevious, - useSetState, useTranslation, useUnMount, }; diff --git a/template/src/app/common/method/index.ts b/template/src/app/common/method/index.ts index 4a113373..86d9b8b2 100644 --- a/template/src/app/common/method/index.ts +++ b/template/src/app/common/method/index.ts @@ -1,90 +1,30 @@ /* eslint-disable no-bitwise */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Alert, ColorValue, Linking, Platform } from 'react-native'; +import { Alert, ColorValue, Linking } from 'react-native'; import { processColor } from 'react-native-reanimated'; -import { appActions } from '@redux-slice'; +import { appActions } from '@redux-slice/app'; import { remove } from '@storage'; import { I18nKeys } from '@utils/i18n/locales'; -import { translate } from '@utils/i18n/translate'; import { MMKV_KEY } from '../constant'; import { dispatch } from '../redux'; -type TypesBase = - | 'bigint' - | 'boolean' - | 'function' - | 'number' - | 'object' - | 'string' - | 'symbol' - | 'undefined'; - export const onShowErrorBase = (msg: string) => { Alert.alert(msg); }; -export const isTypeof = (source: any, type: TypesBase): source is TypesBase => { - return typeof source === type; -}; - export const checkKeyInObject = (T: Record, key: string) => { return Object.keys(T).includes(key); }; -/** - * return true when success and false when error - */ -export const validResponse = ( - response: ResponseBase, -): response is ResponseBase => { - if (!response.status) { - // TODO: handle error - return false; - } - - return true; -}; - -export const execFunc = any>( - func?: Fn, - ...args: Parameters -) => { - if (isTypeof(func, 'function')) { - func(...args); - } -}; - -export const isIos = Platform.OS === 'ios'; - export const logout = () => { dispatch(appActions.logout()); remove(MMKV_KEY.APP_TOKEN); }; -export const handleErrorApi = (status: number) => { - const result = { status: false, code: status, msg: '' }; - - if (status > 505) { - result.msg = translate('error:server_error'); - - return result; - } - - if (status < 500 && status >= 418) { - result.msg = translate('error:error_on_request'); - - return result; - } - - result.msg = translate(('error:' + status) as I18nKeys); - - return result; -}; - export const openLinking = (url: string) => { Linking.canOpenURL(url).then(supported => { if (supported) { @@ -106,93 +46,76 @@ export const setAlpha = (color: ColorValue, alpha = 1) => { const b = num & 0xff, g = (num & 0xff00) >>> 8, r = (num & 0xff0000) >>> 16; - // a = ((num & 0xff000000) >>> 24) / 255; return 'rgba(' + [r, g, b, alpha].join(',') + ')'; }; export const timeAgo = ( date: Date, -): { - title: I18nKeys; - options?: { count: number }; -} => { - const diff = (new Date().getTime() - date.getTime()) / 1000, - day_diff = Math.floor(diff / 86400); - - if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31) { - return { - title: 'date:just_now', - }; - } - - if (day_diff === 0 && diff < 60) { - return { - title: 'date:just_now', - }; - } - - if (day_diff === 0 && diff < 120) { - return { - title: 'date:minute_ago', - options: { count: 1 }, - }; - } - - if (day_diff === 0 && diff < 3600) { - return { - title: 'date:minutes_ago', - options: { count: Math.floor(diff / 60) }, - }; - } - - if (day_diff === 0 && diff < 7200) { - return { - title: 'date:hour_ago', - options: { count: 1 }, - }; - } - - if (day_diff === 0 && diff < 86400) { - return { - title: 'date:hours_ago', - options: { count: Math.floor(diff / 3600) }, - }; - } - - if (day_diff === 1) { - return { - title: 'date:yesterday', - }; - } - - if (day_diff < 7) { - return { - title: 'date:last_week', - }; - } - - if (day_diff < 31) { - return { - title: 'date:last_month', - }; - } - - if (day_diff < 365) { - return { - title: 'date:months_ago', - options: { count: Math.ceil(day_diff / 30) }, - }; - } - - if (day_diff === 365) { - return { - title: 'date:last_year', - }; +): { title: I18nKeys; options?: { count: number } } => { + const diff = (new Date().getTime() - date.getTime()) / 1000; + + const day_diff = Math.floor(diff / 86400); + + const conditions: Array<{ + check: boolean; + result: { title: I18nKeys; options?: any }; + }> = [ + { + check: isNaN(day_diff) || day_diff < 0 || day_diff >= 31, + result: { title: 'date:just_now' }, + }, + { check: day_diff === 0 && diff < 60, result: { title: 'date:just_now' } }, + { + check: day_diff === 0 && diff < 120, + result: { options: { count: 1 }, title: 'date:minute_ago' }, + }, + { + check: day_diff === 0 && diff < 3600, + result: { + options: { count: Math.floor(diff / 60) }, + title: 'date:minutes_ago', + }, + }, + { + check: day_diff === 0 && diff < 7200, + result: { options: { count: 1 }, title: 'date:hour_ago' }, + }, + { + check: day_diff === 0 && diff < 86400, + result: { + options: { count: Math.floor(diff / 3600) }, + title: 'date:hours_ago', + }, + }, + { check: day_diff === 1, result: { title: 'date:yesterday' } }, + { check: day_diff < 7, result: { title: 'date:last_week' } }, + { check: day_diff < 31, result: { title: 'date:last_month' } }, + { + check: day_diff < 365, + result: { + options: { count: Math.ceil(day_diff / 30) }, + title: 'date:months_ago', + }, + }, + { check: day_diff === 365, result: { title: 'date:last_year' } }, + { + check: true, + result: { + options: { count: Math.floor(day_diff / 365) }, + title: 'date:years_ago', + }, + }, + ]; + + for (const condition of conditions) { + if (condition.check) { + return condition.result; + } } return { - title: 'date:years_ago', options: { count: Math.floor(day_diff / 365) }, + title: 'date:years_ago', }; }; diff --git a/template/src/app/common/regex/index.ts b/template/src/app/common/regex/index.ts index c252c83e..3bc9a793 100644 --- a/template/src/app/common/regex/index.ts +++ b/template/src/app/common/regex/index.ts @@ -1,8 +1,7 @@ -export const rxEmail = new RegExp( - '^[a-zA-Z0-9]+([%\\^&\\-\\=\\+\\,\\.]?[a-zA-Z0-9]+)@[a-zA-Z]+([\\.]?[a-zA-Z]+)*(\\.[a-zA-Z]{2,3})+$', -); +export const rxEmail = + /^[a-zA-Z0-9]+([%^&=+,.\\-][a-zA-Z0-9]+)*@[a-zA-Z]+(\\.[a-zA-Z]+)*(\\.[a-zA-Z]{2,3})$/g; export const rxPassword = - /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\W])(?!.*['"]).{8,}$/; + /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*\W)(?!.*['"]).{8,}$/; export const rxNumber = /[^\d]+/g; diff --git a/template/src/app/common/request-permission/index.ts b/template/src/app/common/request-permission/index.ts index dddac0a7..067de1c6 100644 --- a/template/src/app/common/request-permission/index.ts +++ b/template/src/app/common/request-permission/index.ts @@ -2,43 +2,45 @@ * remove this line when use */ export {}; -// /* eslint-disable @typescript-eslint/ban-types */ -// import {Platform} from 'react-native'; -// import { -// PERMISSIONS, -// request, -// } from 'react-native-permissions'; +/** +import {Platform} from 'react-native'; +import { + PERMISSIONS, + request, +} from 'react-native-permissions'; + +export async function useCameraPermission() { + const status = await request( + Platform.select({ + android: PERMISSIONS.ANDROID.CAMERA, + ios: PERMISSIONS.IOS.CAMERA, + }), + ); + return status; +} +export async function useMediaPermission() { + const statusRead = await request( + Platform.select({ + android: PERMISSIONS.ANDROID.READ_EXTERNAL_STORAGE, + ios: PERMISSIONS.IOS.MEDIA_LIBRARY, + }), + ); + const statusWrite = await request( + Platform.select({ + android: PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE, + ios: PERMISSIONS.IOS.MEDIA_LIBRARY, + }), + ); + return {statusRead, statusWrite}; +} +export async function useLocationPermission() { + const status = await request( + Platform.select({ + android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION, + ios: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE, + }), + ); + return status; +} -// export async function useCameraPermission() { -// const status = await request( -// Platform.select({ -// android: PERMISSIONS.ANDROID.CAMERA, -// ios: PERMISSIONS.IOS.CAMERA, -// }), -// ); -// return status; -// } -// export async function useMediaPermission() { -// const statusRead = await request( -// Platform.select({ -// android: PERMISSIONS.ANDROID.READ_EXTERNAL_STORAGE, -// ios: PERMISSIONS.IOS.MEDIA_LIBRARY, -// }), -// ); -// const statusWrite = await request( -// Platform.select({ -// android: PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE, -// ios: PERMISSIONS.IOS.MEDIA_LIBRARY, -// }), -// ); -// return {statusRead, statusWrite}; -// } -// export async function useLocationPermission() { -// const status = await request( -// Platform.select({ -// android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION, -// ios: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE, -// }), -// ); -// return status; -// } + */ diff --git a/template/src/app/common/social-login/apple.ts b/template/src/app/common/social-login/apple.ts index 5d6580e1..0f49fe53 100644 --- a/template/src/app/common/social-login/apple.ts +++ b/template/src/app/common/social-login/apple.ts @@ -1,96 +1,100 @@ -// import { Platform } from 'react-native'; - -// import { APPLE_REDIRECT_URI, CLIENT_ID_APPLE_SERVICE } from '@env'; -// import { -// appleAuth, -// appleAuthAndroid, -// } from '@invertase/react-native-apple-authentication'; export {}; -// type AppleResponse = { -// nonce?: string; -// identityToken?: string; -// }; -// type LoginResult = { -// success?: boolean; -// data?: AppleResponse; -// }; - -// export const AppleService = { -// isSupport: -// Platform.OS === 'android' -// ? appleAuthAndroid.isSupported -// : appleAuth.isSupported, -// appleLogin: async (): Promise => { -// if (Platform.OS === 'ios') { -// try { -// const appleAuthRequestResponse = await appleAuth.performRequest({ -// requestedOperation: appleAuth.Operation.LOGIN, -// requestedScopes: [appleAuth.Scope.EMAIL, appleAuth.Scope.FULL_NAME], -// }); - -// return { -// success: true, -// data: { -// nonce: appleAuthRequestResponse.nonce, -// identityToken: appleAuthRequestResponse.identityToken ?? '', -// }, -// }; -// } catch (err) { -// console.log('IOS-APPPLE-LOGIN-ERROR', err); - -// return { -// success: false, -// }; -// } -// } else { -// try { -// // Generate secure, random values for state and nonce -// const rawNonce = String.prototype.randomUniqueId(); - -// const state = String.prototype.randomUniqueId(); - -// // Configure the request -// appleAuthAndroid.configure({ -// // The Service ID you registered with Apple -// clientId: CLIENT_ID_APPLE_SERVICE, - -// // Return URL added to your Apple dev console. We intercept this redirect, but it must still match -// // the URL you provided to Apple. It can be an empty route on your backend as it's never called. -// redirectUri: APPLE_REDIRECT_URI, - -// // The type of response requested - code, id_token, or both. -// responseType: appleAuthAndroid.ResponseType.ALL, - -// // The amount of user information requested from Apple. -// scope: appleAuthAndroid.Scope.ALL, - -// // Random nonce value that will be SHA256 hashed before sending to Apple. -// nonce: rawNonce, - -// // Unique state value used to prevent CSRF attacks. A UUID will be generated if nothing is provided. -// state, -// }); - -// // Open the browser window for user sign in -// const response = await appleAuthAndroid.signIn(); - -// const { nonce, id_token } = response; - -// return { -// success: true, -// data: { -// nonce, -// identityToken: id_token, -// }, -// }; -// // Send the authorization code to your backend for verification -// } catch (err) { -// console.log('ANDROID-APPPLE-LOGIN-ERROR', err); - -// return { -// success: false, -// }; -// } -// } -// }, -// }; +/** +import { Platform } from 'react-native'; + +import { APPLE_REDIRECT_URI, CLIENT_ID_APPLE_SERVICE } from '@env'; +import { + appleAuth, + appleAuthAndroid, +} from '@invertase/react-native-apple-authentication'; + +type AppleResponse = { + nonce?: string; + identityToken?: string; +}; +type LoginResult = { + success?: boolean; + data?: AppleResponse; +}; + +export const AppleService = { + isSupport: + Platform.OS === 'android' + ? appleAuthAndroid.isSupported + : appleAuth.isSupported, + appleLogin: async (): Promise => { + if (Platform.OS === 'ios') { + try { + const appleAuthRequestResponse = await appleAuth.performRequest({ + requestedOperation: appleAuth.Operation.LOGIN, + requestedScopes: [appleAuth.Scope.EMAIL, appleAuth.Scope.FULL_NAME], + }); + + return { + success: true, + data: { + nonce: appleAuthRequestResponse.nonce, + identityToken: appleAuthRequestResponse.identityToken ?? '', + }, + }; + } catch (err) { + console.log('IOS-APPPLE-LOGIN-ERROR', err); + + return { + success: false, + }; + } + } else { + try { + // Generate secure, random values for state and nonce + const rawNonce = String.prototype.randomUniqueId(); + + const state = String.prototype.randomUniqueId(); + + // Configure the request + appleAuthAndroid.configure({ + // The Service ID you registered with Apple + clientId: CLIENT_ID_APPLE_SERVICE, + + // Return URL added to your Apple dev console. We intercept this redirect, but it must still match + // the URL you provided to Apple. It can be an empty route on your backend as it's never called. + redirectUri: APPLE_REDIRECT_URI, + + // The type of response requested - code, id_token, or both. + responseType: appleAuthAndroid.ResponseType.ALL, + + // The amount of user information requested from Apple. + scope: appleAuthAndroid.Scope.ALL, + + // Random nonce value that will be SHA256 hashed before sending to Apple. + nonce: rawNonce, + + // Unique state value used to prevent CSRF attacks. A UUID will be generated if nothing is provided. + state, + }); + + // Open the browser window for user sign in + const response = await appleAuthAndroid.signIn(); + + const { nonce, id_token } = response; + + return { + success: true, + data: { + nonce, + identityToken: id_token, + }, + }; + // Send the authorization code to your backend for verification + } catch (err) { + console.log('ANDROID-APPPLE-LOGIN-ERROR', err); + + return { + success: false, + }; + } + } + }, +}; + + */ diff --git a/template/src/app/common/social-login/facebook.ts b/template/src/app/common/social-login/facebook.ts index a5f27f74..0b3a9b71 100644 --- a/template/src/app/common/social-login/facebook.ts +++ b/template/src/app/common/social-login/facebook.ts @@ -1,70 +1,74 @@ -// import { -// AccessToken, -// GraphRequest, -// GraphRequestManager, -// LoginManager, -// Settings, -// } from 'react-native-fbsdk-next'; export {}; -// const init = () => { -// Settings.initializeSDK(); -// }; +/** +import { + AccessToken, + GraphRequest, + GraphRequestManager, + LoginManager, + Settings, +} from 'react-native-fbsdk-next'; -// type LoginResult = {success: boolean; token?: string}; -// const login = () => { -// return new Promise(rs => { -// LoginManager.logInWithPermissions(['public_profile', 'email']).then( -// result => { -// if (result.isCancelled) { -// rs({success: false}); -// } else { -// AccessToken.getCurrentAccessToken() -// .then(data => { -// if (data && data.accessToken) { -// rs({success: true, token: data.accessToken}); -// } else { -// rs({success: false}); -// } -// }) -// .catch(err => { -// console.log('FACEBOOK-LOGIN-ERROR', err); -// rs({success: false}); -// }); -// } -// }, -// ); -// }); -// }; +const init = () => { + Settings.initializeSDK(); +}; -// const logout = async () => { -// try { -// const data = await AccessToken.getCurrentAccessToken(); -// if (data?.accessToken) { -// const logoutGraph = new GraphRequest( -// 'me/permissions/', -// { -// accessToken: data?.accessToken, -// httpMethod: 'DELETE', -// }, -// error => { -// if (error) { -// console.log('Error fetching data: ' + error.toString()); -// } else { -// LoginManager.logOut(); -// } -// }, -// ); -// new GraphRequestManager().addRequest(logoutGraph).start(); -// } else { -// LoginManager.logOut(); -// } -// } catch (err) { -// console.log('FACEBOOK-LOGOUT-ERROR', err); -// } -// }; +type LoginResult = {success: boolean; token?: string}; +const login = () => { + return new Promise(rs => { + LoginManager.logInWithPermissions(['public_profile', 'email']).then( + result => { + if (result.isCancelled) { + rs({success: false}); + } else { + AccessToken.getCurrentAccessToken() + .then(data => { + if (data && data.accessToken) { + rs({success: true, token: data.accessToken}); + } else { + rs({success: false}); + } + }) + .catch(err => { + console.log('FACEBOOK-LOGIN-ERROR', err); + rs({success: false}); + }); + } + }, + ); + }); +}; -// export const FacebookService = { -// init, -// login, -// logout, -// }; +const logout = async () => { + try { + const data = await AccessToken.getCurrentAccessToken(); + if (data?.accessToken) { + const logoutGraph = new GraphRequest( + 'me/permissions/', + { + accessToken: data?.accessToken, + httpMethod: 'DELETE', + }, + error => { + if (error) { + console.log('Error fetching data: ' + error.toString()); + } else { + LoginManager.logOut(); + } + }, + ); + new GraphRequestManager().addRequest(logoutGraph).start(); + } else { + LoginManager.logOut(); + } + } catch (err) { + console.log('FACEBOOK-LOGOUT-ERROR', err); + } +}; + +export const FacebookService = { + init, + login, + logout, +}; + + */ diff --git a/template/src/app/common/social-login/google.ts b/template/src/app/common/social-login/google.ts index ec6f062d..ad692817 100644 --- a/template/src/app/common/social-login/google.ts +++ b/template/src/app/common/social-login/google.ts @@ -1,33 +1,36 @@ -// import {GoogleSignin} from '@react-native-google-signin/google-signin'; - -// const init = () => { -// GoogleSignin.configure(); -// }; export {}; -// type LoginResult = {success: boolean; token?: string}; -// const login = async (): Promise => { -// try { -// await GoogleSignin.hasPlayServices(); -// await GoogleSignin.signIn(); -// const userToken = await GoogleSignin.getTokens(); -// return {success: true, token: userToken.accessToken}; -// } catch (err) { -// console.log('GOOGLE-LOGIN-ERROR', err); -// return {success: false}; -// } -// }; +/** +import {GoogleSignin} from '@react-native-google-signin/google-signin'; + +const init = () => { + GoogleSignin.configure(); +}; +type LoginResult = {success: boolean; token?: string}; +const login = async (): Promise => { + try { + await GoogleSignin.hasPlayServices(); + await GoogleSignin.signIn(); + const userToken = await GoogleSignin.getTokens(); + return {success: true, token: userToken.accessToken}; + } catch (err) { + console.log('GOOGLE-LOGIN-ERROR', err); + return {success: false}; + } +}; + +const logout = async () => { + try { + await GoogleSignin.signOut(); + return true; + } catch (err) { + console.log('GOOGLE-LOGOUT-ERROR', err); + } +}; -// const logout = async () => { -// try { -// await GoogleSignin.signOut(); -// return true; -// } catch (err) { -// console.log('GOOGLE-LOGOUT-ERROR', err); -// } -// }; +export const GoogleService = { + init, + login, + logout, +}; -// export const GoogleService = { -// init, -// login, -// logout, -// }; + */ diff --git a/template/src/app/common/socketIo/index.ts b/template/src/app/common/socketIo/index.ts index c1fb9fba..42d3bd51 100644 --- a/template/src/app/common/socketIo/index.ts +++ b/template/src/app/common/socketIo/index.ts @@ -2,69 +2,71 @@ * remove this line when use */ export {}; -// /* eslint-disable @typescript-eslint/no-explicit-any */ -// import {createContext, useCallback, useContext, useState} from 'react'; -// import {io, Socket} from 'socket.io-client'; +/** +import {createContext, useCallback, useContext, useState} from 'react'; +import {io, Socket} from 'socket.io-client'; + +export const useSocket = () => { + // state + const [socket, setSocket] = useState(undefined); -// export const useSocket = () => { -// // state -// const [socket, setSocket] = useState(undefined); + // function + const socketDisconnect = useCallback(() => { + if (socket) { + socket.offAny(); + socket.disconnect(); + setSocket(undefined); + } + }, [socket]); -// // function -// const socketDisconnect = useCallback(() => { -// if (socket) { -// socket.offAny(); -// socket.disconnect(); -// setSocket(undefined); -// } -// }, [socket]); + const socketInit = useCallback(() => { + const client = io('', { + transports: ['websocket'], + reconnection: true, + reconnectionDelay: 500, + reconnectionAttempts: 9999999, + forceNew: true, + }); + client.on('connection-success', () => { + console.log('Connected', client.connected); + }); + setSocket(client); + }, []); -// const socketInit = useCallback(() => { -// const client = io('', { -// transports: ['websocket'], -// reconnection: true, -// reconnectionDelay: 500, -// reconnectionAttempts: 9999999, -// forceNew: true, -// }); -// client.on('connection-success', () => { -// console.log('Connected', client.connected); -// }); -// setSocket(client); -// }, []); + const socketOff = useCallback( + (event?: string, listener?: any) => { + if (socket) { + socket.off(event, listener); + } + }, + [socket], + ); -// const socketOff = useCallback( -// (event?: string, listener?: any) => { -// if (socket) { -// socket.off(event, listener); -// } -// }, -// [socket], -// ); + const socketListen = useCallback( + (event: string, listener: (...args: any[]) => void) => { + if (socket) { + socket.on(event, listener); + } + }, + [socket], + ); -// const socketListen = useCallback( -// (event: string, listener: (...args: any[]) => void) => { -// if (socket) { -// socket.on(event, listener); -// } -// }, -// [socket], -// ); + // result + return {socket, socketInit, socketOff, socketListen, socketDisconnect}; +}; -// // result -// return {socket, socketInit, socketOff, socketListen, socketDisconnect}; -// }; +type SocketContext = { + socket: Socket | undefined; + socketOff: (event?: string, listener?: any) => void; + socketListen: (event: string, listener: (...args: any[]) => void) => void; + socketInit: () => void; + socketDisconnect: () => void; +}; -// type SocketContext = { -// socket: Socket | undefined; -// socketOff: (event?: string, listener?: any) => void; -// socketListen: (event: string, listener: (...args: any[]) => void) => void; -// socketInit: () => void; -// socketDisconnect: () => void; -// }; +export const SocketIoContext = createContext( + {} as SocketContext, +); +export const SocketProvider = SocketIoContext.Provider; +export const useSocketContext = () => useContext(SocketIoContext); -// export const SocketIoContext = createContext( -// {} as SocketContext, -// ); -// export const SocketProvider = SocketIoContext.Provider; -// export const useSocketContext = () => useContext(SocketIoContext); + */ diff --git a/template/src/app/common/string/index.ts b/template/src/app/common/string/index.ts index 82a3acc5..0825bc92 100644 --- a/template/src/app/common/string/index.ts +++ b/template/src/app/common/string/index.ts @@ -55,21 +55,21 @@ export const onHandleTagToArrayText = ( const arrText: ResultHandleTagToArrayText[] = []; textSplit.forEach((text: string, i: number) => { - const textData = { text: text, bold: false }; + const textData = { bold: false, text: text }; - if (text[0] === char) { + if (text.startsWith(char)) { textData.bold = true; arrText.push(textData); } else { - arrText.push({ text: text, bold: false }); + arrText.push({ bold: false, text: text }); } if ( (text === '' && i !== textSplit.length - 1) || i !== textSplit.length - 1 ) { - arrText.push({ text: ' ', bold: false }); + arrText.push({ bold: false, text: ' ' }); } }); diff --git a/template/src/app/library/components/button/default-button.tsx b/template/src/app/library/components/button/default-button.tsx index dddd6fca..c8c20d19 100644 --- a/template/src/app/library/components/button/default-button.tsx +++ b/template/src/app/library/components/button/default-button.tsx @@ -15,11 +15,11 @@ export const DefaultButton = ({ }: TouchableOpacityProps & Pick) => { const [, handlePress, handleLongPress, handlePressIn, handlePressOut] = useThrottle({ - throttleMs, - onPress, onLongPress, + onPress, onPressIn, onPressOut, + throttleMs, }); // render diff --git a/template/src/app/library/components/button/hook.ts b/template/src/app/library/components/button/hook.ts index 45a104dc..fec06c2f 100644 --- a/template/src/app/library/components/button/hook.ts +++ b/template/src/app/library/components/button/hook.ts @@ -5,7 +5,6 @@ import { import { Easing, useSharedValue, withTiming } from 'react-native-reanimated'; -import { execFunc, isTypeof } from '@common/method'; import { useEventCallback } from '@hooks'; export type UseThrottleParam = { diff --git a/template/src/app/library/components/button/outline-button.tsx b/template/src/app/library/components/button/outline-button.tsx index e5f6412b..99bfc659 100644 --- a/template/src/app/library/components/button/outline-button.tsx +++ b/template/src/app/library/components/button/outline-button.tsx @@ -1,15 +1,19 @@ import React from 'react'; import { ImageProps, TouchableWithoutFeedback } from 'react-native'; -import { useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated'; +import { + useAnimatedProps, + useAnimatedStyle, + useDerivedValue, +} from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { AnimatedIcon } from '@components/icon'; import { useTranslation } from '@hooks'; import { AnimatedText, View } from '@rn-core'; -import { useStyles } from '@theme'; import { useThrottle } from './hook'; -import { outlineButtonStyleSheet } from './styles'; +import { buttonStyleSheet } from './styles'; import { ButtonProps } from './type'; export const OutlineButton = ({ @@ -30,7 +34,7 @@ export const OutlineButton = ({ const { styles, theme: { color }, - } = useStyles(outlineButtonStyleSheet); + } = useStyles(buttonStyleSheet); const t = useTranslation(); @@ -42,32 +46,38 @@ export const OutlineButton = ({ handlePressOut, pressed, ] = useThrottle({ - throttleMs, - onPress, onLongPress, + onPress, onPressIn, onPressOut, + throttleMs, + }); + + const tintColor = useDerivedValue(() => { + if (disabled) { + return color.neutral100; + } + + if (pressed.value) { + return color.primary; + } + + return color.primary500; }); // style - const textStyle = useAnimatedStyle(() => ({ - // eslint-disable-next-line no-nested-ternary - color: disabled - ? color.neutral100 - : pressed.value - ? color.primary - : color.primary500, - })); + const textStyle = useAnimatedStyle(() => { + return { + color: tintColor.value, + }; + }); // props - const iconProps = useAnimatedProps(() => ({ - // eslint-disable-next-line no-nested-ternary - tintColor: disabled - ? color.neutral100 - : pressed.value - ? color.primary - : color.primary500, - })); + const iconProps = useAnimatedProps(() => { + return { + tintColor: tintColor.value, + }; + }); // render return ( @@ -81,7 +91,7 @@ export const OutlineButton = ({ + style={[styles[size], styles.buttonColor(disabled), styles.outline]}> {leftIcon ? ( ) : null} diff --git a/template/src/app/library/components/button/primary-button.tsx b/template/src/app/library/components/button/primary-button.tsx index 5d5b15bb..6885480a 100644 --- a/template/src/app/library/components/button/primary-button.tsx +++ b/template/src/app/library/components/button/primary-button.tsx @@ -2,14 +2,15 @@ import React from 'react'; import { TouchableWithoutFeedback } from 'react-native'; import { useAnimatedStyle } from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { Icon } from '@components/icon'; import { useTranslation } from '@hooks'; import { AnimatedView, Text } from '@rn-core'; -import { Colors, useStyles } from '@theme'; +import { Colors } from '@theme/index'; import { useThrottle } from './hook'; -import { primaryButtonStyleSheet } from './styles'; +import { buttonStyleSheet } from './styles'; import { ButtonProps } from './type'; export const PrimaryButton = ({ @@ -30,7 +31,7 @@ export const PrimaryButton = ({ const { styles, theme: { color }, - } = useStyles(primaryButtonStyleSheet); + } = useStyles(buttonStyleSheet); const t = useTranslation(); @@ -42,25 +43,29 @@ export const PrimaryButton = ({ handlePressOut, pressed, ] = useThrottle({ - throttleMs, - onPress, onLongPress, + onPress, onPressIn, onPressOut, + throttleMs, }); // func const iconColor: Colors = disabled ? 'neutral200' : 'neutral50'; // style - const containerStyle = useAnimatedStyle(() => ({ - // eslint-disable-next-line no-nested-ternary - backgroundColor: disabled - ? color.neutral100 - : pressed.value - ? color.primary - : color.primary500, - })); + const containerStyle = useAnimatedStyle(() => { + let backgroundColor: string = color.primary500; + if (disabled) { + backgroundColor = color.neutral100; + } else if (pressed.value) { + backgroundColor = color.primary; + } + + return { + backgroundColor, + }; + }); // render return ( diff --git a/template/src/app/library/components/button/secondary-button.tsx b/template/src/app/library/components/button/secondary-button.tsx deleted file mode 100644 index c669074a..00000000 --- a/template/src/app/library/components/button/secondary-button.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React from 'react'; -import { TouchableWithoutFeedback } from 'react-native'; - -import { useAnimatedStyle } from 'react-native-reanimated'; - -import { Icon } from '@components/icon'; -import { useTranslation } from '@hooks'; -import { AnimatedView, Text } from '@rn-core'; -import { Colors, useStyles } from '@theme'; - -import { useThrottle } from './hook'; -import { secondaryButtonStyleSheet } from './styles'; -import { ButtonProps } from './type'; - -export const SecondaryButton = ({ - t18n, - text, - throttleMs, - onPress, - onPressIn, - onPressOut, - onLongPress, - leftIcon, - rightIcon, - size = 'normal', - disabled = false, - ...rest -}: ButtonProps) => { - // state - const { - styles, - theme: { color }, - } = useStyles(secondaryButtonStyleSheet); - - const t = useTranslation(); - - const [ - , - handlePress, - handleLongPress, - handlePressIn, - handlePressOut, - pressed, - ] = useThrottle({ - throttleMs, - onPress, - onLongPress, - onPressIn, - onPressOut, - }); - - // func - const iconColor: Colors = disabled ? 'neutral200' : 'primary500'; - - // style - const containerStyle = useAnimatedStyle(() => ({ - // eslint-disable-next-line no-nested-ternary - backgroundColor: disabled - ? color.neutral100 - : pressed.value - ? color.primary100 - : color.primary50, - })); - - // render - return ( - - - {leftIcon ? : null} - {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} - {/* @ts-ignore */} - - {t18n ? t(t18n) : text} - - {rightIcon ? : null} - - - ); -}; diff --git a/template/src/app/library/components/button/styles.ts b/template/src/app/library/components/button/styles.ts index a0520370..1d568825 100644 --- a/template/src/app/library/components/button/styles.ts +++ b/template/src/app/library/components/button/styles.ts @@ -1,110 +1,41 @@ -import { createStyleSheet } from '@theme'; +import { createStyleSheet } from 'react-native-unistyles'; -export const primaryButtonStyleSheet = createStyleSheet( - ({ color, textPresets }) => ({ - normal: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 12, - }, - small: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 10, - }, - extraSmall: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 8, - }, - text_normal: { ...textPresets.CTAs }, - text_small: { ...textPresets.CTASmall }, - text_extraSmall: { ...textPresets.extraSmall }, - textColor: (disabled?: boolean) => ({ - color: disabled ? color.neutral200 : color.neutral50, - }), +export const buttonStyleSheet = createStyleSheet(({ color, textPresets }) => ({ + buttonColor: (disabled?: boolean) => ({ + backgroundColor: disabled ? color.neutral200 : color.neutral50, + borderColor: disabled ? color.neutral200 : color.primary500, }), -); - -export const secondaryButtonStyleSheet = createStyleSheet( - ({ color, textPresets }) => ({ - normal: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 12, - }, - small: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 10, - }, - extraSmall: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - padding: 8, - }, - text_normal: { ...textPresets.CTAs }, - text_small: { ...textPresets.CTASmall }, - text_extraSmall: { ...textPresets.extraSmall }, - textColor: (disabled?: boolean) => ({ - color: disabled ? color.neutral200 : color.primary500, - }), - }), -); - -export const outlineButtonStyleSheet = createStyleSheet( - ({ color, textPresets }) => ({ - normal: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - borderWidth: 1, - padding: 12, - }, - small: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - borderWidth: 1, - padding: 10, - }, - extraSmall: { - flexDirection: 'row', - alignItems: 'center', - columnGap: 8, - borderRadius: 8, - overflow: 'hidden', - borderWidth: 1, - padding: 8, - }, - buttonColor: (disabled?: boolean) => ({ - backgroundColor: disabled ? color.neutral200 : color.neutral50, - borderColor: disabled ? color.neutral200 : color.primary500, - }), - text_normal: { ...textPresets.CTAs }, - text_small: { ...textPresets.CTASmall }, - text_extraSmall: { ...textPresets.extraSmall }, + extraSmall: { + alignItems: 'center', + borderRadius: 8, + columnGap: 8, + flexDirection: 'row', + overflow: 'hidden', + padding: 8, + }, + normal: { + alignItems: 'center', + borderRadius: 8, + columnGap: 8, + flexDirection: 'row', + overflow: 'hidden', + padding: 12, + }, + outline: { + borderWidth: 1, + }, + small: { + alignItems: 'center', + borderRadius: 8, + columnGap: 8, + flexDirection: 'row', + overflow: 'hidden', + padding: 10, + }, + textColor: (disabled?: boolean) => ({ + color: disabled ? color.neutral200 : color.neutral50, }), -); + text_extraSmall: { ...textPresets.extraSmall }, + text_normal: { ...textPresets.CTAs }, + text_small: { ...textPresets.CTASmall }, +})); diff --git a/template/src/app/library/components/checkbox/index.tsx b/template/src/app/library/components/checkbox/index.tsx index 5a2695ed..e5fba986 100644 --- a/template/src/app/library/components/checkbox/index.tsx +++ b/template/src/app/library/components/checkbox/index.tsx @@ -6,12 +6,11 @@ import { useAnimatedProps, useAnimatedStyle, } from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { useSharedTransition } from '@animated'; -import { execFunc, isTypeof } from '@common/method'; import { AnimatedIcon } from '@components/icon'; import { AnimatedView } from '@rn-core'; -import { useStyles } from '@theme'; import { stylesSheet } from './styles'; import { CheckboxProps } from './type'; @@ -50,19 +49,19 @@ export const Checkbox = ({ // style const containerStyle = useAnimatedStyle(() => { return { - borderColor: disabled - ? color.neutral200 + backgroundColor: disabled + ? color.neutral50 : interpolateColor( progress.value, [0, 1], - [color.technical, color.primary500], + [color.neutral50, color.primary500], ), - backgroundColor: disabled - ? color.neutral50 + borderColor: disabled + ? color.neutral200 : interpolateColor( progress.value, [0, 1], - [color.neutral50, color.primary500], + [color.technical, color.primary500], ), }; }); diff --git a/template/src/app/library/components/checkbox/styles.ts b/template/src/app/library/components/checkbox/styles.ts index d12c26c8..cf4a73c6 100644 --- a/template/src/app/library/components/checkbox/styles.ts +++ b/template/src/app/library/components/checkbox/styles.ts @@ -1,13 +1,13 @@ -import { createStyleSheet } from '@theme'; +import { createStyleSheet } from 'react-native-unistyles'; export const stylesSheet = createStyleSheet({ container: (size: number) => ({ - justifyContent: 'center', alignItems: 'center', - position: 'relative', - width: size, - height: size, borderRadius: 4, borderWidth: 1, + height: size, + justifyContent: 'center', + position: 'relative', + width: size, }), }); diff --git a/template/src/app/library/components/divider/index.tsx b/template/src/app/library/components/divider/index.tsx index f0267e60..44c5067b 100644 --- a/template/src/app/library/components/divider/index.tsx +++ b/template/src/app/library/components/divider/index.tsx @@ -1,8 +1,9 @@ import React, { useMemo } from 'react'; import { StyleSheet, ViewStyle } from 'react-native'; +import { useStyles } from 'react-native-unistyles'; + import { View } from '@rn-core'; -import { useStyles } from '@theme'; import { DividerProps } from './type'; diff --git a/template/src/app/library/components/divider/type.ts b/template/src/app/library/components/divider/type.ts index bd97d06a..c90b5ac8 100644 --- a/template/src/app/library/components/divider/type.ts +++ b/template/src/app/library/components/divider/type.ts @@ -1,4 +1,4 @@ -import { Colors } from '@theme'; +import { Colors } from '@theme/index'; export interface DividerProps { /** diff --git a/template/src/app/library/components/focus-aware-status-bar/index.tsx b/template/src/app/library/components/focus-aware-status-bar/index.tsx index 1606bc2d..48f9a8f5 100644 --- a/template/src/app/library/components/focus-aware-status-bar/index.tsx +++ b/template/src/app/library/components/focus-aware-status-bar/index.tsx @@ -1,12 +1,13 @@ import * as React from 'react'; -import { StatusBar, StatusBarProps, StyleSheet } from 'react-native'; +import { StyleSheet } from 'react-native'; import { PostDelay } from '@components/post-delay'; import { useIsFocused } from '@react-navigation/native'; import { View } from '@rn-core'; +import { StatusBar, StatusBarProps } from 'expo-status-bar'; export const FocusAwareStatusBar = ({ - barStyle = 'dark-content', + style = 'dark', ...props }: StatusBarProps) => { // state @@ -16,7 +17,7 @@ export const FocusAwareStatusBar = ({ return isFocused ? ( - + ) : null; @@ -24,7 +25,7 @@ export const FocusAwareStatusBar = ({ const styles = StyleSheet.create({ container: { - position: 'absolute', opacity: 0, + position: 'absolute', }, }); diff --git a/template/src/app/library/components/icon/index.tsx b/template/src/app/library/components/icon/index.tsx index 33d4fe96..f415ec05 100644 --- a/template/src/app/library/components/icon/index.tsx +++ b/template/src/app/library/components/icon/index.tsx @@ -2,9 +2,9 @@ import React, { forwardRef, useMemo } from 'react'; import { Image, ImageProps, ImageStyle } from 'react-native'; import Animated, { AnimatedProps } from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { icons } from '@assets/icon'; -import { useStyles } from '@theme'; import { IconProps } from './type'; @@ -23,7 +23,7 @@ export const Icon = ({ // style const style = useMemo( - () => ({ width: size, height: size }), + () => ({ height: size, width: size }), [size], ); @@ -61,7 +61,7 @@ export const AnimatedIcon = forwardRef< // style const style = useMemo( - () => ({ width: size, height: size }), + () => ({ height: size, width: size }), [size], ); diff --git a/template/src/app/library/components/icon/type.ts b/template/src/app/library/components/icon/type.ts index d1915542..cc02412c 100644 --- a/template/src/app/library/components/icon/type.ts +++ b/template/src/app/library/components/icon/type.ts @@ -1,5 +1,5 @@ import { IconTypes } from '@assets/icon'; -import { Colors } from '@theme'; +import { Colors } from '@theme/index'; export interface IconProps { /** diff --git a/template/src/app/library/components/image/index.tsx b/template/src/app/library/components/image/index.tsx index 32f36ca1..65dbecce 100644 --- a/template/src/app/library/components/image/index.tsx +++ b/template/src/app/library/components/image/index.tsx @@ -1,21 +1,21 @@ -import React from "react"; -import { StyleSheet } from "react-native"; +import React from 'react'; +import { StyleSheet } from 'react-native'; -import { Image as ExpoImage } from "expo-image"; +import { Image as ExpoImage } from 'expo-image'; -import { ImageProps } from "./type"; +import { ImageProps } from './type'; export const Image = ({ ...rest }: ImageProps) => { // render return ( , 'onRefresh' | 'refreshControl' | 'refreshing' >) - | ({ type?: 'flashlist' | undefined } & ReOmit< + | ({ type?: 'flashlist' } & ReOmit< FlashListProps, 'onRefresh' | 'refreshControl' | 'refreshing' >) diff --git a/template/src/app/library/components/local-image/styles.ts b/template/src/app/library/components/local-image/styles.ts index e961e120..3a50d874 100644 --- a/template/src/app/library/components/local-image/styles.ts +++ b/template/src/app/library/components/local-image/styles.ts @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native'; export const styles = StyleSheet.create({ img: { - width: '100%', height: '100%', + width: '100%', }, }); diff --git a/template/src/app/library/components/modal/modal-content.tsx b/template/src/app/library/components/modal/modal-content.tsx index ae9587f1..6558674e 100644 --- a/template/src/app/library/components/modal/modal-content.tsx +++ b/template/src/app/library/components/modal/modal-content.tsx @@ -21,7 +21,6 @@ import { } from 'react-native-reanimated'; import { sharedTiming } from '@animated'; -import { execFunc } from '@common/method'; import { useDisableBackHandler } from '@hooks'; import { AnimatedView } from '@rn-core'; @@ -57,9 +56,9 @@ export const ModalContent = forwardRef( () => [ StyleSheet.absoluteFillObject, { - width: '100%', - height: '100%', backgroundColor: backdropColor, + height: '100%', + width: '100%', }, ], [backdropColor], diff --git a/template/src/app/library/components/modal/styles.ts b/template/src/app/library/components/modal/styles.ts index a47f7278..d8de9005 100644 --- a/template/src/app/library/components/modal/styles.ts +++ b/template/src/app/library/components/modal/styles.ts @@ -1,13 +1,13 @@ import { StyleSheet } from 'react-native'; export const styles = StyleSheet.create({ - modal: { - ...StyleSheet.absoluteFillObject, - zIndex: 2, - backgroundColor: 'transparent', - }, content: { flex: 1, justifyContent: 'center', }, + modal: { + ...StyleSheet.absoluteFillObject, + backgroundColor: 'transparent', + zIndex: 2, + }, }); diff --git a/template/src/app/library/components/parsed-text/index.tsx b/template/src/app/library/components/parsed-text/index.tsx index dc24d12a..7b069852 100644 --- a/template/src/app/library/components/parsed-text/index.tsx +++ b/template/src/app/library/components/parsed-text/index.tsx @@ -1,38 +1,26 @@ import React, { useCallback } from 'react'; import { Text } from 'react-native'; -import { isTypeof } from '@common/method'; - import { ParsedTextProps } from './type'; -import { PATTERNS, textExtraction } from './utils'; +import { textExtraction } from './utils'; export const ParsedText = ({ parse, children, ...rest }: ParsedTextProps) => { // function - const getPatterns = useCallback(() => { - return parse.map(option => { - const { type, ...patternOption } = option; - - if (type && PATTERNS[type]) { - patternOption.pattern = PATTERNS[type]; - } - - return patternOption; - }); - }, [parse]); - const renderTexts = useCallback(() => { if (!parse || !isTypeof(children, 'string')) { return children; } - const text = textExtraction(children, getPatterns()); + const text = textExtraction(children, parse); return text.map((localProps, index) => { const { style, ...restText } = localProps; - return ; + return ( + + ); }); - }, [children, getPatterns, parse]); + }, [children, parse]); // render return {renderTexts()}; diff --git a/template/src/app/library/components/parsed-text/type.ts b/template/src/app/library/components/parsed-text/type.ts index 47929c8d..1b383fdf 100644 --- a/template/src/app/library/components/parsed-text/type.ts +++ b/template/src/app/library/components/parsed-text/type.ts @@ -1,7 +1,5 @@ import { TextProps } from 'react-native'; -import { PATTERNS } from './utils'; - export type ParsedText = { children: string; _matched?: boolean }; export type ParsedTexts = Array; @@ -19,7 +17,6 @@ export type Pattern = { }; export type Parse = { - type?: keyof typeof PATTERNS; pattern?: RegExp; } & CustomTextProps & { onPress?: (text: string, index: number) => void; diff --git a/template/src/app/library/components/parsed-text/utils.ts b/template/src/app/library/components/parsed-text/utils.ts index 924ed656..0b9e98f7 100644 --- a/template/src/app/library/components/parsed-text/utils.ts +++ b/template/src/app/library/components/parsed-text/utils.ts @@ -2,11 +2,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { CustomTextProps, MatchedPart, ParsedText, Pattern } from './type'; -export const PATTERNS = { - url: /(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i, - phone: /[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/, - email: /\S+@\S+\.\S+/, -}; type Parsed = Array>; export const textExtraction = ( @@ -32,7 +27,7 @@ export const textExtraction = ( pattern.pattern.lastIndex = 0; while (textLeft && (matches = pattern.pattern.exec(textLeft))) { - const previousText = textLeft.substr(0, matches.index); + const previousText = textLeft.substring(0, matches.index); indexOfMatchedString = matches.index; @@ -94,7 +89,7 @@ function getMatchedPart( return { ...props, - children: customChildren, _matched: true, + children: customChildren, }; } diff --git a/template/src/app/library/components/post-delay/index.tsx b/template/src/app/library/components/post-delay/index.tsx index 5703c121..5a990942 100644 --- a/template/src/app/library/components/post-delay/index.tsx +++ b/template/src/app/library/components/post-delay/index.tsx @@ -22,6 +22,7 @@ export const PostDelay = ({ return () => { clearTimeout(id); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); // render diff --git a/template/src/app/library/components/radio-button/index.tsx b/template/src/app/library/components/radio-button/index.tsx index 43551fa4..a259f9f1 100644 --- a/template/src/app/library/components/radio-button/index.tsx +++ b/template/src/app/library/components/radio-button/index.tsx @@ -2,11 +2,10 @@ import React, { useState } from 'react'; import { TouchableWithoutFeedback } from 'react-native'; import { interpolate, useAnimatedStyle } from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { useSharedTransition } from '@animated'; -import { execFunc, isTypeof } from '@common/method'; import { AnimatedView } from '@rn-core'; -import { useStyles } from '@theme'; import { stylesSheet } from './styles'; import { RadioButtonProps } from './type'; @@ -41,8 +40,8 @@ export const RadioButton = ({ // style const dotStyle = useAnimatedStyle(() => ({ - transform: [{ scale: interpolate(progress.value, [0, 1], [0, 1]) }], opacity: progress.value, + transform: [{ scale: interpolate(progress.value, [0, 1], [0, 1]) }], })); // render diff --git a/template/src/app/library/components/radio-button/styles.ts b/template/src/app/library/components/radio-button/styles.ts index ec856f5b..fad46442 100644 --- a/template/src/app/library/components/radio-button/styles.ts +++ b/template/src/app/library/components/radio-button/styles.ts @@ -1,27 +1,27 @@ -import { createStyleSheet } from '@theme'; +import { createStyleSheet } from 'react-native-unistyles'; export const stylesSheet = createStyleSheet(theme => ({ container: (size: number, disabled?: boolean) => ({ - justifyContent: 'center', alignItems: 'center', - position: 'relative', - width: size, - height: size, - borderRadius: size, - borderWidth: 1, backgroundColor: theme.color.neutral50, borderColor: disabled ? theme.color.neutral200 : theme.color.technical, + borderRadius: size, + borderWidth: 1, + height: size, + justifyContent: 'center', + position: 'relative', + width: size, }), dot: (size: number, disabled) => { return { - width: size / 2, - height: size / 2, - borderRadius: size / 4, - position: 'absolute', alignSelf: 'center', backgroundColor: disabled ? theme.color.neutral200 : theme.color.primary500, + borderRadius: size / 4, + height: size / 2, + position: 'absolute', + width: size / 2, }; }, })); diff --git a/template/src/app/library/components/screen/index.tsx b/template/src/app/library/components/screen/index.tsx index 223e088e..8a2adb1e 100644 --- a/template/src/app/library/components/screen/index.tsx +++ b/template/src/app/library/components/screen/index.tsx @@ -8,9 +8,9 @@ import { SafeAreaViewProps, useSafeAreaInsets, } from 'react-native-safe-area-context'; +import { useStyles } from 'react-native-unistyles'; import { View } from '@rn-core'; -import { useStyles } from '@theme'; import { styles } from './styles'; import { @@ -54,12 +54,12 @@ const Inset = ({ const style = useMemo( () => ({ backgroundColor: color, - width, + bottom, height, - top, left, - bottom, right, + top, + width, }), [bottom, color, height, left, right, top, width], ); @@ -90,7 +90,7 @@ const InsetComponent = ({ hidden={hiddenStatusBar} backgroundColor={'transparent'} translucent - barStyle={statusBarStyle || 'light-content'} + style={statusBarStyle ?? 'light'} /> {!unsafe && edges.includes('top') && ( + contentContainerStyle={[style]}> + {children} + { setData(d => d.concat([ { - id: String().randomUniqueId(), + id: randomUniqueId(), + interval, msg, type, - interval, }, ]), ); @@ -82,5 +82,5 @@ export const showSnack = ({ interval?: number; type?: TypeMessage; }) => { - snackBarRef.current?.show({ msg, interval, type }); + snackBarRef.current?.show({ interval, msg, type }); }; diff --git a/template/src/app/library/components/snack-bar/snack-bar-item.tsx b/template/src/app/library/components/snack-bar/snack-bar-item.tsx index b1506133..db77a362 100644 --- a/template/src/app/library/components/snack-bar/snack-bar-item.tsx +++ b/template/src/app/library/components/snack-bar/snack-bar-item.tsx @@ -17,7 +17,7 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { sharedTiming, sharePause } from '@animated'; -import { VectorIcon, VectorIconIcon } from '@assets/vector-icon/vector-icon'; +import { VectorIcon, VIconName } from '@components/vector-icon'; import { useErrorMessageTranslation } from '@hooks'; import { AnimatedView, Text } from '@rn-core'; @@ -49,7 +49,7 @@ const getColor = (typeMessage: TypeMessage): string => { } }; -const getIcon = (typeMessage: TypeMessage): VectorIconIcon => { +const getIcon = (typeMessage: TypeMessage): VIconName => { switch (typeMessage) { case TYPE_MESSAGE.SUCCESS: return 'tick_square'; @@ -110,17 +110,15 @@ export const SnackItem = memo( }; return { - initialValues, animations, callback, + initialValues, }; }; const CustomExitAnimation = (values: any) => { 'worklet'; const animations = { - // your animations - zIndex: index, transform: [ { translateY: sharedTiming(-(values.currentHeight + insets.top), { @@ -128,6 +126,8 @@ export const SnackItem = memo( }), }, ], + // your animations + zIndex: index, }; const initialValues = { @@ -142,9 +142,9 @@ export const SnackItem = memo( }; return { - initialValues, animations, callback, + initialValues, }; }; diff --git a/template/src/app/library/components/snack-bar/styles.ts b/template/src/app/library/components/snack-bar/styles.ts index eda5d70b..d31f507a 100644 --- a/template/src/app/library/components/snack-bar/styles.ts +++ b/template/src/app/library/components/snack-bar/styles.ts @@ -7,16 +7,20 @@ export const styles = StyleSheet.create({ minHeight: 50, }, itemBar: { + // alignSelf: 'center', + alignItems: 'center', + + flexDirection: 'row', + paddingHorizontal: sizeScale(15), + paddingVertical: sizeScale(13), + position: 'absolute', width: '100%', - // alignSelf: 'center', - alignItems: 'center', - flexDirection: 'row', }, text: { - marginTop: sizeScale(-2), flex: 1, + marginTop: sizeScale(-2), }, }); diff --git a/template/src/app/library/components/snack-bar/type.ts b/template/src/app/library/components/snack-bar/type.ts index f1c6b95c..44a0211a 100644 --- a/template/src/app/library/components/snack-bar/type.ts +++ b/template/src/app/library/components/snack-bar/type.ts @@ -1,8 +1,8 @@ export const TYPE_MESSAGE = { - SUCCESS: 'success', ERROR: 'error', - WARN: 'warn', LINK: 'link', + SUCCESS: 'success', + WARN: 'warn', } as const; export type TypeMessage = (typeof TYPE_MESSAGE)[keyof typeof TYPE_MESSAGE]; diff --git a/template/src/app/library/components/spacer/index.tsx b/template/src/app/library/components/spacer/index.tsx index 006da792..5cd2f0d5 100644 --- a/template/src/app/library/components/spacer/index.tsx +++ b/template/src/app/library/components/spacer/index.tsx @@ -10,8 +10,8 @@ export const Spacer = ({ height = 0, width = 0 }: SpacerProps) => { // style const actualStyle = useMemo>( () => ({ - width: typeof width === 'number' ? sizeScale(width) : width, height: typeof height === 'number' ? sizeScale(height) : height, + width: typeof width === 'number' ? sizeScale(width) : width, }), [height, width], ); diff --git a/template/src/app/library/components/stack-view/index.tsx b/template/src/app/library/components/stack-view/index.tsx index 4739673f..ef7a8376 100644 --- a/template/src/app/library/components/stack-view/index.tsx +++ b/template/src/app/library/components/stack-view/index.tsx @@ -10,7 +10,7 @@ export const StackView = forwardRef( // render return ( { const styleSheet = createStyleSheet(theme => ({ container: { - flexDirection: 'row', backgroundColor: theme.color.neutral50, + flexDirection: 'row', }, })); diff --git a/template/src/app/library/components/tabs/tab-item.tsx b/template/src/app/library/components/tabs/tab-item.tsx index 84e6a00f..95e053a6 100644 --- a/template/src/app/library/components/tabs/tab-item.tsx +++ b/template/src/app/library/components/tabs/tab-item.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { useAnimatedStyle } from 'react-native-reanimated'; +import { createStyleSheet, useStyles } from 'react-native-unistyles'; import { DefaultButton } from '@components/button/default-button'; import { useTranslation } from '@hooks'; import { AnimatedText, AnimatedView, View } from '@rn-core'; -import { createStyleSheet, useStyles } from '@theme'; import { TabItemProps } from './type'; @@ -57,30 +57,30 @@ export const TabItem = ({ tab, index, selectedIndex }: TabItemProps) => { const styleSheet = createStyleSheet(theme => ({ button: { - justifyContent: 'center', alignItems: 'center', - paddingVertical: 12, + justifyContent: 'center', paddingHorizontal: 8, + paddingVertical: 12, }, container: { flex: 1, }, underline: { - position: 'absolute', + backgroundColor: theme.color.primary500, bottom: 0, + height: 2, left: 0, + position: 'absolute', right: 0, - height: 2, - backgroundColor: theme.color.primary500, zIndex: 99, }, underlineOverlay: { - position: 'absolute', + backgroundColor: theme.color.primary50, bottom: 0, + height: 2, left: 0, + position: 'absolute', right: 0, - height: 2, - backgroundColor: theme.color.primary50, zIndex: 9, }, })); diff --git a/template/src/app/assets/vector-icon/icon-name.ts b/template/src/app/library/components/vector-icon/icon-name.ts similarity index 100% rename from template/src/app/assets/vector-icon/icon-name.ts rename to template/src/app/library/components/vector-icon/icon-name.ts diff --git a/template/src/app/assets/vector-icon/vector-icon.tsx b/template/src/app/library/components/vector-icon/index.tsx similarity index 86% rename from template/src/app/assets/vector-icon/vector-icon.tsx rename to template/src/app/library/components/vector-icon/index.tsx index 009248ff..a92ba51d 100644 --- a/template/src/app/assets/vector-icon/vector-icon.tsx +++ b/template/src/app/library/components/vector-icon/index.tsx @@ -1,9 +1,10 @@ import React from 'react'; import Animated from 'react-native-reanimated'; +import { useStyles } from 'react-native-unistyles'; import { createIconSetFromIcoMoon } from 'react-native-vector-icons'; -import { Colors, useStyles } from '@theme'; +import { Colors } from '@theme/index'; import { IconProps } from 'react-native-vector-icons/Icon'; import { ICONS } from './icon-name'; @@ -17,10 +18,10 @@ const VectorIconBase = createIconSetFromIcoMoon( export const AnimatedIcon = Animated.createAnimatedComponent(VectorIconBase); -export type VectorIconIcon = keyof typeof ICONS; +export type VIconName = keyof typeof ICONS; type VectorIconProps = ReOmit & { - icon: VectorIconIcon; + icon: VIconName; colorTheme?: Colors; }; diff --git a/template/src/app/assets/vector-icon/selection.json b/template/src/app/library/components/vector-icon/selection.json similarity index 100% rename from template/src/app/assets/vector-icon/selection.json rename to template/src/app/library/components/vector-icon/selection.json diff --git a/template/src/app/library/networking/helper.ts b/template/src/app/library/networking/helper.ts index b59e7922..ad2c5781 100644 --- a/template/src/app/library/networking/helper.ts +++ b/template/src/app/library/networking/helper.ts @@ -1,14 +1,16 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { createRef } from 'react'; import { API_CONFIG } from '@common/constant'; -import { handleErrorApi, logout } from '@common/method'; +import { logout } from '@common/method'; +import { I18nKeys } from '@utils/i18n/locales'; import { translate } from '@utils/i18n/translate'; import { AxiosError, AxiosResponse, Method } from 'axios'; const responseDefault: ResponseBase> = { code: -500, - status: false, msg: translate('error:have_error'), + status: false, }; export const onPushLogout = async () => { @@ -18,6 +20,22 @@ export const onPushLogout = async () => { */ }; +/** + * return true when success and false when error + */ +export const validResponse = ( + response: ResponseBase, +): response is ResponseBase => { + if (!response.status) { + /** + * handler error + */ + return false; + } + + return true; +}; + export const controller = createRef(); // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore @@ -38,12 +56,32 @@ export const handleResponseAxios = >( res: AxiosResponse, ): ResponseBase => { if (res.data) { - return { code: API_CONFIG.CODE_SUCCESS, status: true, data: res.data }; + return { code: API_CONFIG.CODE_SUCCESS, data: res.data, status: true }; } return responseDefault as ResponseBase; }; +const handleErrorApi = (status: number) => { + const result = { code: status, msg: '', status: false }; + + if (status > 505) { + result.msg = translate('error:server_error'); + + return result; + } + + if (status < 500 && status >= 418) { + result.msg = translate('error:error_on_request'); + + return result; + } + + result.msg = translate(('error:' + status) as I18nKeys); + + return result; +}; + export const handleErrorAxios = >( error: AxiosError, ): ResponseBase => { @@ -94,9 +132,9 @@ export const handleParameter = ( return { ...props, - method, - url: handlePath(url, path), data: body, + method, params, + url: handlePath(url, path), }; }; diff --git a/template/src/app/library/networking/index.ts b/template/src/app/library/networking/index.ts deleted file mode 100644 index 6abba7b6..00000000 --- a/template/src/app/library/networking/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './api'; - -export * from './service'; diff --git a/template/src/app/library/networking/service.ts b/template/src/app/library/networking/service.ts index c582896f..5674b256 100644 --- a/template/src/app/library/networking/service.ts +++ b/template/src/app/library/networking/service.ts @@ -5,7 +5,7 @@ import { API_CONFIG } from '@common/constant'; import { dispatch, getState } from '@common/redux'; import { API_URL } from '@env'; import { AppState } from '@model/app'; -import { appActions } from '@redux-slice'; +import { appActions } from '@redux-slice/app'; import Axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; import { ApiConstants } from './api'; @@ -28,23 +28,19 @@ AxiosInstance.interceptors.response.use( const originalRequest = error.config; if ( - error && - error.response && - (error.response.status === 403 || error.response.status === 401) && + (error?.response?.status === 403 || error?.response?.status === 401) && !originalRequest._retry ) { originalRequest._retry = true; - refreshTokenRequest = refreshTokenRequest - ? refreshTokenRequest - : refreshToken(); + refreshTokenRequest = refreshTokenRequest ?? refreshToken(); const newToken = await refreshTokenRequest; refreshTokenRequest = null; if (newToken === null) { - return Promise.reject(error); + return Promise.reject(error as Error); } dispatch(appActions.setToken(newToken)); @@ -54,21 +50,21 @@ AxiosInstance.interceptors.response.use( return AxiosInstance(originalRequest); } - return Promise.reject(error); + return Promise.reject(error as Error); }, ); // refresh token -async function refreshToken(): Promise { - return new Promise(rs => { +async function refreshToken(): Promise { + return new Promise(rs => { AxiosInstance.request({ - method: 'POST', - url: ApiConstants.REFRESH_TOKEN, _retry: true, baseURL: API_URL, data: { refresh_token: '', }, + method: 'POST', + url: ApiConstants.REFRESH_TOKEN, } as AxiosRequestConfig) .then((res: AxiosResponse) => rs(res.data)) .catch(() => rs(null)); @@ -81,11 +77,11 @@ function Request>(config: ParamsNetwork) { const defaultConfig: AxiosRequestConfig = { baseURL: API_URL, - timeout: API_CONFIG.TIME_OUT, headers: { 'Content-Type': 'application/json', [tokenKeyHeader]: token ?? '', }, + timeout: API_CONFIG.TIME_OUT, }; return new Promise | null>(rs => { @@ -135,8 +131,8 @@ async function PostFormData(params: ParamsNetwork) { const { token }: AppState = getState('app'); const headers: AxiosRequestConfig['headers'] = { - [tokenKeyHeader]: token ?? '', 'Content-Type': 'multipart/form-data', + [tokenKeyHeader]: token ?? '', }; return Request( @@ -159,10 +155,10 @@ export type NetWorkResponseType = ( ) => Promise | null>; export const NetWorkService = { + Delete, Get, Post, - Put, - Delete, PostFormData, + Put, Request, }; diff --git a/template/src/app/library/utils/i18n/i18n.ts b/template/src/app/library/utils/i18n/i18n.ts index 21ecec24..6f86f708 100644 --- a/template/src/app/library/utils/i18n/i18n.ts +++ b/template/src/app/library/utils/i18n/i18n.ts @@ -7,35 +7,37 @@ import i18n, { LanguageDetectorAsyncModule, Resource } from 'i18next'; import { resources } from './locales'; const languageDetector: LanguageDetectorAsyncModule = { - type: 'languageDetector', // flags below detection to be async async: true, + + cacheUserLanguage: () => {}, detect: (callback: (lng: string | readonly string[] | undefined) => void) => { callback(DEFAULT_FALLBACK_LNG_I18n); }, init: () => {}, - cacheUserLanguage: () => {}, + type: 'languageDetector', }; export const initOptionsI18n = (source: Resource) => { return { - fallbackLng: DEFAULT_FALLBACK_LNG_I18n, - - resources: source, + debug: false, - // have a common namespace used around the full app - ns: ['common'], defaultNS: 'common', - debug: false, + + fallbackLng: DEFAULT_FALLBACK_LNG_I18n, // cache: { // enabled: true // }, - interpolation: { // not needed for react as it does escape per default to prevent xss! escapeValue: false, }, + + // have a common namespace used around the full app + ns: ['common'], + + resources: source, }; }; diff --git a/template/src/app/library/utils/storage/index.ts b/template/src/app/library/utils/storage/index.ts index 9073c42b..763264bd 100644 --- a/template/src/app/library/utils/storage/index.ts +++ b/template/src/app/library/utils/storage/index.ts @@ -4,8 +4,8 @@ import { MMKV } from 'react-native-mmkv'; import { APP_DISPLAY_NAME, PRIVATE_KEY_STORAGE } from '@env'; export const AppStorage = new MMKV({ - id: `user-${APP_DISPLAY_NAME}-storage`, encryptionKey: PRIVATE_KEY_STORAGE, + id: `user-${APP_DISPLAY_NAME}-storage`, }); /** @@ -87,11 +87,6 @@ interface Storage { } export const reduxPersistStorage: Storage = { - setItem: (key, value) => { - AppStorage.set(key, value); - - return Promise.resolve(true); - }, getItem: key => { const value = AppStorage.getString(key); @@ -102,4 +97,9 @@ export const reduxPersistStorage: Storage = { return Promise.resolve(); }, + setItem: (key, value) => { + AppStorage.set(key, value); + + return Promise.resolve(true); + }, }; diff --git a/template/src/app/navigation/app-navigation.tsx b/template/src/app/navigation/app-navigation.tsx index 9f8595ae..8c4b931c 100644 --- a/template/src/app/navigation/app-navigation.tsx +++ b/template/src/app/navigation/app-navigation.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; -import { StatusBar } from 'react-native'; +import { useStyles } from 'react-native-unistyles'; import { useSelector } from 'react-redux'; import { dispatch, RXStore } from '@common/redux'; @@ -13,8 +13,8 @@ import { useNavigationContainerRef, } from '@react-navigation/native'; import { selectAppConfig } from '@redux-selector/app'; -import { appActions } from '@redux-slice'; -import { useStyles } from '@theme'; +import { appActions } from '@redux-slice/app'; +import { StatusBar } from 'expo-status-bar'; import { NavigationService } from './navigation-service'; diff --git a/template/src/app/navigation/navigation-service.tsx b/template/src/app/navigation/navigation-service.tsx index 6ea7effc..d3b7bdf8 100644 --- a/template/src/app/navigation/navigation-service.tsx +++ b/template/src/app/navigation/navigation-service.tsx @@ -18,13 +18,13 @@ const NavigationComponent = forwardRef((_, ref) => { useImperativeHandle( ref, () => ({ + dispatch: (args: any) => { + navigation.dispatch(args); + }, navigate: (...args: any[]) => { // @ts-ignore navigation.navigate(...(args as never)); }, - dispatch: (args: any) => { - navigation.dispatch(args); - }, }), [navigation], ); diff --git a/template/src/app/navigation/root-navigator.tsx b/template/src/app/navigation/root-navigator.tsx index 7fbb5ddd..bc6e67f5 100644 --- a/template/src/app/navigation/root-navigator.tsx +++ b/template/src/app/navigation/root-navigator.tsx @@ -29,8 +29,8 @@ export const RootNavigation = () => { {token === undefined ? ( ) => { - state.token = payload; - }, - setAppProfile: (state, { payload }: PayloadAction) => { - state.profile = payload; - }, - startLoadApp: state => { - state.loadingApp = true; - }, endLoadApp: state => { state.loadingApp = false; }, @@ -32,6 +25,15 @@ const appSlice = createSlice({ state.profile = {}; }, + setAppProfile: (state, { payload }: PayloadAction) => { + state.profile = payload; + }, + setToken: (state, { payload }: PayloadAction) => { + state.token = payload; + }, + startLoadApp: state => { + state.loadingApp = true; + }, }, }); diff --git a/template/src/app/redux/action-slice/authentication.ts b/template/src/app/redux/action-slice/authentication.ts index 0bd77c2c..4797dd79 100644 --- a/template/src/app/redux/action-slice/authentication.ts +++ b/template/src/app/redux/action-slice/authentication.ts @@ -9,8 +9,8 @@ const initialState: AuthenticationState = { }; const authenticationSlice = createSlice({ - name: SLICE_NAME.AUTHENTICATION, initialState: initialState, + name: SLICE_NAME.AUTHENTICATION, reducers: { reset: () => initialState, }, @@ -21,8 +21,8 @@ const login = createAction( (body: any, onSucceeded: () => void, onFailure: (msg: string) => void) => ({ payload: { body, - onSucceeded, onFailure, + onSucceeded, }, }), ); diff --git a/template/src/app/redux/action-slice/index.ts b/template/src/app/redux/action-slice/index.ts deleted file mode 100644 index 0222c5ac..00000000 --- a/template/src/app/redux/action-slice/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './app'; - -export * from './authentication'; diff --git a/template/src/app/redux/listener/app.ts b/template/src/app/redux/listener/app.ts index 5180ede1..ee87109d 100644 --- a/template/src/app/redux/listener/app.ts +++ b/template/src/app/redux/listener/app.ts @@ -1,9 +1,8 @@ import { MMKV_KEY } from '@common/constant'; import { takeLatestListeners } from '@listener'; +import { appActions } from '@redux-slice/app'; import { loadString } from '@utils/storage'; -import { appActions } from '../action-slice/app'; - export const runAppListener = () => { takeLatestListeners()({ actionCreator: appActions.startLoadApp, diff --git a/template/src/app/redux/listener/authentication.ts b/template/src/app/redux/listener/authentication.ts index c02ddd11..074b489f 100644 --- a/template/src/app/redux/listener/authentication.ts +++ b/template/src/app/redux/listener/authentication.ts @@ -1,8 +1,8 @@ -import { validResponse } from '@common/method'; import { takeLatestListeners } from '@listener'; -import { ApiConstants, NetWorkService } from '@networking'; - -import { authenticationActions } from '../action-slice/authentication'; +import { ApiConstants } from '@networking/api'; +import { validResponse } from '@networking/helper'; +import { NetWorkService } from '@networking/service'; +import { authenticationActions } from '@redux-slice/authentication'; export const runAuthenticationListener = () => { takeLatestListeners()({ @@ -15,9 +15,9 @@ export const runAuthenticationListener = () => { await listenerApi.delay(1000); const response = await NetWorkService.Post({ - url: ApiConstants.LOGIN, body, signal: listenerApi.signal, + url: ApiConstants.LOGIN, }); if (!response) { @@ -25,7 +25,9 @@ export const runAuthenticationListener = () => { } if (validResponse(response)) { - // TODO: do something when login success + /** + * Do something when login success + */ } }, }); diff --git a/template/src/app/redux/store/all-reducers.ts b/template/src/app/redux/store/all-reducers.ts index 8db211ba..b6f1f840 100644 --- a/template/src/app/redux/store/all-reducers.ts +++ b/template/src/app/redux/store/all-reducers.ts @@ -1,4 +1,5 @@ -import { appReducer, authenticationReducer } from '@redux-slice'; +import { appReducer } from '@redux-slice/app'; +import { authenticationReducer } from '@redux-slice/authentication'; import { combineReducers } from '@reduxjs/toolkit'; export const allReducer = combineReducers({ diff --git a/template/src/app/redux/store/store.ts b/template/src/app/redux/store/store.ts index b76f0b7c..89f252b7 100644 --- a/template/src/app/redux/store/store.ts +++ b/template/src/app/redux/store/store.ts @@ -19,12 +19,12 @@ const devMode = __DEV__; const middleware = [] as any[]; export const store = configureStore({ - reducer: allReducer, devTools: devMode, middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false }) .prepend(listenerMiddleware.middleware) .concat(middleware), + reducer: allReducer, }); /** * export const persistore = persistStore(store); diff --git a/template/src/app/screens/un-authentication/login/index.tsx b/template/src/app/screens/un-authentication/login/index.tsx index 42314c12..28164954 100644 --- a/template/src/app/screens/un-authentication/login/index.tsx +++ b/template/src/app/screens/un-authentication/login/index.tsx @@ -1,10 +1,5 @@ -import React, { useRef } from 'react'; -import { - StatusBar, - StyleSheet, - useWindowDimensions, - ViewProps, -} from 'react-native'; +import React, { useRef, useState } from 'react'; +import { StyleSheet, useWindowDimensions, ViewProps } from 'react-native'; import { runOnJS, @@ -14,11 +9,14 @@ import { useSharedValue, withTiming, } from 'react-native-reanimated'; -import { UnistylesRuntime } from 'react-native-unistyles'; +import { + createStyleSheet, + UnistylesRuntime, + useStyles, +} from 'react-native-unistyles'; import { OutlineButton } from '@components/button/outline-button'; import { PrimaryButton } from '@components/button/primary-button'; -import { SecondaryButton } from '@components/button/secondary-button'; import { Checkbox } from '@components/checkbox'; import { Divider } from '@components/divider'; import { RadioButton } from '@components/radio-button'; @@ -33,11 +31,13 @@ import { makeImageFromView, SkImage, } from '@shopify/react-native-skia'; -import { createStyleSheet, useStyles } from '@theme'; +import { StatusBarStyle } from 'expo-status-bar'; const wait = (ms: number) => { return new Promise(resolve => { - setTimeout(resolve, ms); + setTimeout(() => { + resolve(true); + }, ms); }); }; @@ -58,11 +58,11 @@ export const Login = () => { const { styles, theme } = useStyles(styleSheet); + const [barStyle, setBarStyle] = useState('dark'); + // func const updateStatusBar = (prevType: string) => { - StatusBar.setBarStyle( - prevType !== 'dark' ? 'light-content' : 'dark-content', - ); + setBarStyle(prevType !== 'dark' ? 'light' : 'dark'); }; const handleChangeTheme = async () => { @@ -110,7 +110,7 @@ export const Login = () => { opacity: opacity.value, })); - const size = useSharedValue({ width: 0, height: 0 }); + const size = useSharedValue({ height: 0, width: 0 }); const widthCanvas = useDerivedValue(() => size.value.width); @@ -129,8 +129,8 @@ export const Login = () => { bottomInsetColor="transparent" scroll excludeEdges={['bottom']} - statusBarStyle="dark-content" - style={{ paddingVertical: 0, paddingHorizontal: 10 }} + statusBarStyle={barStyle} + style={{ paddingHorizontal: 10, paddingVertical: 0 }} backgroundColor={'transparent'}> Divider @@ -169,15 +169,6 @@ export const Login = () => { - - Secondary Button - - - - - - - Outline Button @@ -217,25 +208,25 @@ export const Login = () => { }; const styleSheet = createStyleSheet(theme => ({ - text: { - ...theme.textPresets.label, - color: theme.color.neutral500, + colItem: { + alignItems: 'flex-start', + paddingVertical: 15, + rowGap: 8, }, root: { + backgroundColor: theme.color.background, flex: 1, - paddingTop: 0, paddingHorizontal: 15, - backgroundColor: theme.color.background, + paddingTop: 0, }, rowItem: { - flexDirection: 'row', - paddingVertical: 15, alignItems: 'center', columnGap: 8, - }, - colItem: { + flexDirection: 'row', paddingVertical: 15, - rowGap: 8, - alignItems: 'flex-start', + }, + text: { + ...theme.textPresets.label, + color: theme.color.neutral500, }, })); diff --git a/template/src/app/themes/colors/dark.ts b/template/src/app/themes/colors/dark.ts index d98aa7f7..ea0fc730 100644 --- a/template/src/app/themes/colors/dark.ts +++ b/template/src/app/themes/colors/dark.ts @@ -1,64 +1,64 @@ export const darkColors = { background: '#141417', - primary50: '#3D2731', + danger: '#E96F6F', + danger100: '#4F2729', + danger20: '#2F1A1D', + danger200: '#773335', + danger300: '#8B3A3B', + danger400: '#B24647', + danger50: '#321D20', + + danger500: '#DA5353', + + info: '#87C2F0', + info100: '#2E4457', + info200: '#3F6482', + info300: '#487497', + info400: '#5994C2', + info50: '#1D242C', + info500: '#6BB4ED', + + neutral: '#EAE9F2', + + neutral100: '#42404D', + neutral200: '#615F6D', + neutral300: '#7A7887', + neutral400: '#A4A2B4', + neutral50: '#201F26', + neutral500: '#E0DEEA', + primary: '#F193B2', + primary100: '#52313E', primary200: '#7B4558', primary300: '#904E65', primary400: '#BA627F', + primary50: '#3D2731', primary500: '#E37599', - primary: '#F193B2', - primaryGradient: ['#E37599', '#F2CB78'], - secondary50: '#332E29', + secondary: '#FEE2A5', secondary100: '#574B34', secondary200: '#836F47', secondary300: '#998251', secondary400: '#C6A665', + secondary50: '#332E29', secondary500: '#F2CB78', - secondary: '#FEE2A5', - technical: '#7E7F96', - - info50: '#1D242C', - info100: '#2E4457', - info200: '#3F6482', - info300: '#487497', - info400: '#5994C2', - info500: '#6BB4ED', - info: '#87C2F0', - - success50: '#21332C', + success: '#91F2BB', success100: '#2E5240', success200: '#407C5B', success300: '#499169', success400: '#5ABA85', + success50: '#21332C', success500: '#6CE4A0', - success: '#91F2BB', + technical: '#7E7F96', - warning50: '#352F1E', + warning: '#F4D168', warning100: '#564925', warning200: '#826D2E', warning300: '#987E32', warning400: '#C4A23B', + warning50: '#352F1E', warning500: '#F0C544', - warning: '#F4D168', - - danger20: '#2F1A1D', - danger50: '#321D20', - danger100: '#4F2729', - danger200: '#773335', - danger300: '#8B3A3B', - danger400: '#B24647', - danger500: '#DA5353', - danger: '#E96F6F', - - neutral50: '#201F26', - neutral100: '#42404D', - neutral200: '#615F6D', - neutral300: '#7A7887', - neutral400: '#A4A2B4', - neutral500: '#E0DEEA', - neutral: '#EAE9F2', } as const; diff --git a/template/src/app/themes/colors/light.ts b/template/src/app/themes/colors/light.ts index d8698e97..33f44645 100644 --- a/template/src/app/themes/colors/light.ts +++ b/template/src/app/themes/colors/light.ts @@ -1,64 +1,64 @@ export const lightColors = { background: '#F2F8FC', - primary50: '#FDE1EB', + danger: '#B41313', + danger100: '#EFA8A8', + danger20: '#FCF2F2', + danger200: '#EB8C8C', + danger300: '#E26060', + danger400: '#D94949', + danger50: '#F9E3E3', + + danger500: '#C92B2B', + + info: '#248DDE', + info100: '#BCE0FB', + info200: '#9BCFF6', + info300: '#7ABEF2', + info400: '#59ADEE', + info50: '#DEF1FF', + info500: '#3D9EE9', + + neutral: '#141417', + + neutral100: '#E6E5EA', + neutral200: '#C7C5CD', + neutral300: '#83818E', + neutral400: '#4F4E59', + neutral50: '#F4F3F5', + neutral500: '#2B2A31', + primary: '#BC305D', + primary100: '#F5C0D2', primary200: '#F2A3BD', primary300: '#E27A9C', primary400: '#D46287', + primary50: '#FDE1EB', primary500: '#C84771', - primary: '#BC305D', - primaryGradient: ['#C84771', '#ECBC55'], - secondary50: '#F5EFE1', + secondary: '#D8A12D', secondary100: '#F6E7C6', secondary200: '#F0D9A6', secondary300: '#ECCF91', secondary400: '#E5C173', + secondary50: '#F5EFE1', secondary500: '#ECBC55', - secondary: '#D8A12D', - technical: '#535474', - - info50: '#DEF1FF', - info100: '#BCE0FB', - info200: '#9BCFF6', - info300: '#7ABEF2', - info400: '#59ADEE', - info500: '#3D9EE9', - info: '#248DDE', - - success50: '#D9F6E5', + success: '#26B765', success100: '#B4EFCD', success200: '#97E7B9', success300: '#75DEA2', success400: '#5ED792', + success50: '#D9F6E5', success500: '#41C97C', - success: '#26B765', + technical: '#535474', - warning50: '#FFF4D2', + warning: '#CF9C00', warning100: '#FCE399', warning200: '#F6D369', warning300: '#F2C746', warning400: '#EBBA28', + warning50: '#FFF4D2', warning500: '#E5AF0C', - warning: '#CF9C00', - - danger20: '#FCF2F2', - danger50: '#F9E3E3', - danger100: '#EFA8A8', - danger200: '#EB8C8C', - danger300: '#E26060', - danger400: '#D94949', - danger500: '#C92B2B', - danger: '#B41313', - - neutral50: '#F4F3F5', - neutral100: '#E6E5EA', - neutral200: '#C7C5CD', - neutral300: '#83818E', - neutral400: '#4F4E59', - neutral500: '#2B2A31', - neutral: '#141417', } as const; diff --git a/template/src/app/themes/dark.ts b/template/src/app/themes/dark.ts index 1ee67adc..d42e49ad 100644 --- a/template/src/app/themes/dark.ts +++ b/template/src/app/themes/dark.ts @@ -2,7 +2,7 @@ import { darkColors } from './colors/dark'; import { textPresets } from './text-presets'; export const darkTheme = { - type: 'dark', color: darkColors, textPresets: textPresets, + type: 'dark', }; diff --git a/template/src/app/themes/index.ts b/template/src/app/themes/index.ts index 23165538..ce24730d 100644 --- a/template/src/app/themes/index.ts +++ b/template/src/app/themes/index.ts @@ -1,9 +1,4 @@ -import { - createStyleSheet, - UnistylesRegistry, - UnistylesThemes, - useStyles, -} from 'react-native-unistyles'; +import { UnistylesRegistry, UnistylesThemes } from 'react-native-unistyles'; import { darkTheme } from './dark'; import { lightTheme } from './light'; @@ -16,8 +11,8 @@ type AppThemes = { }; UnistylesRegistry.addThemes({ - light: lightTheme, dark: darkTheme, + light: lightTheme, }).addConfig({ adaptiveThemes: false, initialTheme: 'light', @@ -27,5 +22,3 @@ declare module 'react-native-unistyles' { // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface UnistylesThemes extends AppThemes {} } - -export { useStyles, createStyleSheet }; diff --git a/template/src/app/themes/light.ts b/template/src/app/themes/light.ts index ce28bb52..cdd2c023 100644 --- a/template/src/app/themes/light.ts +++ b/template/src/app/themes/light.ts @@ -2,7 +2,7 @@ import { lightColors } from './colors/light'; import { textPresets } from './text-presets'; export const lightTheme = { - type: 'light', color: lightColors, textPresets: textPresets, + type: 'light', }; diff --git a/template/src/app/themes/text-presets/index.ts b/template/src/app/themes/text-presets/index.ts index 32dae810..51c47834 100644 --- a/template/src/app/themes/text-presets/index.ts +++ b/template/src/app/themes/text-presets/index.ts @@ -5,15 +5,20 @@ import { sizeScale } from '@common/scale'; import { FontDefault } from '../typography'; const presets = { - caption: { + CTALinks: { color: '#000000', fontFamily: FontDefault.primary, - fontSize: sizeScale(12), + fontSize: sizeScale(18), }, - overline: { + CTASmall: { color: '#000000', fontFamily: FontDefault.primary, - fontSize: sizeScale(10), + fontSize: sizeScale(14), + }, + CTAs: { + color: '#000000', + fontFamily: FontDefault.primary, + fontSize: sizeScale(16), }, H1: { color: '#000000', @@ -40,15 +45,30 @@ const presets = { fontFamily: FontDefault.primarySemiBold, fontSize: sizeScale(24), }, - subtitle1: { + assistive: { color: '#000000', - fontFamily: FontDefault.primarySemiBold, - fontSize: sizeScale(20), + fontFamily: FontDefault.primary, + fontSize: sizeScale(1248), }, - subtitle2: { + caption: { color: '#000000', - fontFamily: FontDefault.primarySemiBold, - fontSize: sizeScale(18), + fontFamily: FontDefault.primary, + fontSize: sizeScale(12), + }, + extraSmall: { + color: '#000000', + fontFamily: FontDefault.primary, + fontSize: sizeScale(12), + }, + label: { + color: '#000000', + fontFamily: FontDefault.primary, + fontSize: sizeScale(12), + }, + overline: { + color: '#000000', + fontFamily: FontDefault.primary, + fontSize: sizeScale(10), }, paragraph1: { color: '#000000', @@ -65,45 +85,25 @@ const presets = { fontFamily: FontDefault.primaryBold, fontSize: sizeScale(14), }, - quotes: { - color: '#000000', - fontFamily: FontDefault.secondaryItalic, - fontSize: sizeScale(18), - }, - label: { - color: '#000000', - fontFamily: FontDefault.primary, - fontSize: sizeScale(12), - }, placeholder: { color: '#000000', fontFamily: FontDefault.primary, fontSize: sizeScale(14), }, - assistive: { - color: '#000000', - fontFamily: FontDefault.primary, - fontSize: sizeScale(1248), - }, - CTAs: { - color: '#000000', - fontFamily: FontDefault.primary, - fontSize: sizeScale(16), - }, - CTALinks: { + quotes: { color: '#000000', - fontFamily: FontDefault.primary, + fontFamily: FontDefault.secondaryItalic, fontSize: sizeScale(18), }, - CTASmall: { + subtitle1: { color: '#000000', - fontFamily: FontDefault.primary, - fontSize: sizeScale(14), + fontFamily: FontDefault.primarySemiBold, + fontSize: sizeScale(20), }, - extraSmall: { + subtitle2: { color: '#000000', - fontFamily: FontDefault.primary, - fontSize: sizeScale(12), + fontFamily: FontDefault.primarySemiBold, + fontSize: sizeScale(18), }, }; diff --git a/template/src/app/themes/typography/index.ts b/template/src/app/themes/typography/index.ts index 2f43c694..e1340f75 100644 --- a/template/src/app/themes/typography/index.ts +++ b/template/src/app/themes/typography/index.ts @@ -1,5 +1,4 @@ -/* eslint-disable import/extensions */ - +import { fonts } from '@assets/fonts'; import { useFonts } from 'expo-font'; export const FontDefault = { @@ -14,12 +13,12 @@ export const useLoadFont = () => { // state const [isLoaded] = useFonts({ // icons is default font for react native vector icons. flowing IcMoon to use icons - icons: require('@assets/fonts/icons.ttf'), - [FontDefault.primary]: require('@assets/fonts/Manrope-Medium.ttf'), - [FontDefault.primaryBold]: require('@assets/fonts/Manrope-Bold.ttf'), - [FontDefault.primarySemiBold]: require('@assets/fonts/Manrope-SemiBold.ttf'), - [FontDefault.secondary]: require('@assets/fonts/Roboto-Regular.ttf'), - [FontDefault.secondaryItalic]: require('@assets/fonts/Roboto-Italic.ttf'), + icons: fonts.icons, + [FontDefault.primary]: fonts.manrope_medium, + [FontDefault.primaryBold]: fonts.manrope_bold, + [FontDefault.primarySemiBold]: fonts.manrope_semibold, + [FontDefault.secondary]: fonts.roboto_regular, + [FontDefault.secondaryItalic]: fonts.roboto_italic, }); return isLoaded; diff --git a/template/tsconfig.json b/template/tsconfig.json index 6dae638f..174298b4 100644 --- a/template/tsconfig.json +++ b/template/tsconfig.json @@ -1,19 +1,10 @@ { + "extends": "@react-native/typescript-config/tsconfig.json", "compilerOptions": { - "target": "esnext", - "module": "commonjs", - "lib": ["es2017", "DOM"], - "allowJs": true, - "jsx": "react-native", - "noEmit": true, - "isolatedModules": true, - "resolveJsonModule": true, - "strict": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { "@env": ["./env-config.ts"], - "@assets/*": ["./src/app/assets/*"], + "@assets/*": ["./assets/*"], "@common/*": ["./src/app/common/*"], "@app-emitter": ["./src/app/common/emitter/index"], "@app-firebase": ["./src/app/common/firebase/index"], @@ -26,28 +17,14 @@ "@components/*": ["./src/app/library/components/*"], "@utils/*": ["./src/app/library/utils/*"], "@storage": ["./src/app/library/utils/storage/index"], - "@networking": ["./src/app/library/networking/index"], "@networking/*": ["./src/app/library/networking/*"], "@model/*": ["./src/app/model/*"], "@navigation/*": ["./src/app/navigation/*"], "@store/*": ["./src/app/redux/store/*"], - "@redux-slice": ["./src/app/redux/action-slice/index"], + "@redux-slice/*": ["./src/app/redux/action-slice/*"], "@redux-selector/*": ["./src/app/redux/selector/*"], "@redux-action-type/*": ["./src/app/redux/action-type/*"], - "@theme": ["./src/app/themes/index"], - "@theme/*": ["./src/app/themes/*"], - "*": ["declare/*", "*"] - }, - "typeRoots": ["declare", "./node_modules/@types"], - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "skipLibCheck": false - }, - "exclude": [ - "node_modules", - "babel.config.js", - "metro.config.js", - "jest.config.js", - "scripts" - ] + "@theme/*": ["./src/app/themes/*"] + } + } }