Convert EmptyReactNativeConfig to Kotlin (#42286)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42286

Convert EmptyReactNativeConfig to Kotlin

Changelog:
[Internal] [Changed] - Convert EmptyReactNativeConfig to Kotlin

Reviewed By: huntie

Differential Revision: D52698594

fbshipit-source-id: c4963ff4edc5054d1b78d1c1858e22eb4ef9279e
This commit is contained in:
Nicola Corti
2024-01-15 10:47:20 -08:00
committed by Facebook GitHub Bot
parent cfef30f386
commit 0c7008f28b
2 changed files with 26 additions and 40 deletions
@@ -1,40 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric;
import androidx.annotation.NonNull;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStripAny;
/**
* An empty {@link ReactNativeConfig} that is backed by the C++ implementation where the defaults
* are store.
*/
@DoNotStripAny
public class EmptyReactNativeConfig implements ReactNativeConfig {
@NonNull private final HybridData mHybridData;
private static native HybridData initHybrid();
public EmptyReactNativeConfig() {
mHybridData = initHybrid();
}
@Override
public native boolean getBool(final String param);
@Override
public native long getInt64(final String param);
@Override
public native String getString(final String param);
@Override
public native double getDouble(final String param);
}
@@ -0,0 +1,26 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStripAny
/**
* An empty [ReactNativeConfig] that is backed by the C++ implementation where the defaults
* are stored.
*/
@DoNotStripAny
class EmptyReactNativeConfig : ReactNativeConfig {
private val mHybridData: HybridData = initHybrid()
private external fun initHybrid(): HybridData
external override fun getBool(param: String): Boolean
external override fun getInt64(param: String): Long
external override fun getString(param: String): String
external override fun getDouble(param: String): Double
}