mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
cfef30f386
commit
0c7008f28b
-40
@@ -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);
|
||||
}
|
||||
+26
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user