forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlinify the remaining interfaces in react.bridge (facebook#44546)
Summary: Pull Request resolved: facebook#44546 # Changelog: [Internal] - This wraps up moving all of the interfaces to Kotling inside `react.bridge`. Differential Revision: D57253634
- Loading branch information
1 parent
3d5aa15
commit c332165
Showing
21 changed files
with
367 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
...ct-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ActivityEventListener.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...eact-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ActivityEventListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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.bridge | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
|
||
/** | ||
* Listener for receiving activity events. Consider using [BaseActivityEventListener] if you're not | ||
* interested in all the events sent to this interface. | ||
*/ | ||
public interface ActivityEventListener { | ||
/** Called when host (activity/service) receives an [Activity.onActivityResult] call. */ | ||
public fun onActivityResult(activity: Activity?, requestCode: Int, resultCode: Int, data: Intent?) | ||
|
||
/** Called when a new intent is passed to the activity */ | ||
public fun onNewIntent(intent: Intent?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
...t-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSBundleLoaderDelegate.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
...act-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSBundleLoaderDelegate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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.bridge | ||
|
||
import android.content.res.AssetManager | ||
|
||
/** An interface for classes that initialize JavaScript using [JSBundleLoader] */ | ||
public interface JSBundleLoaderDelegate { | ||
/** | ||
* Load a JS bundle from Android assets. See [JSBundleLoader.createAssetLoader] | ||
* | ||
* @param assetManager | ||
* @param assetURL | ||
* @param loadSynchronously | ||
*/ | ||
public fun loadScriptFromAssets( | ||
assetManager: AssetManager, | ||
assetURL: String, | ||
loadSynchronously: Boolean | ||
) | ||
|
||
/** | ||
* Load a JS bundle from the filesystem. See [JSBundleLoader.createFileLoader] and | ||
* [JSBundleLoader.createCachedBundleFromNetworkLoader] | ||
* | ||
* @param fileName | ||
* @param sourceURL | ||
* @param loadSynchronously | ||
*/ | ||
public fun loadScriptFromFile(fileName: String, sourceURL: String, loadSynchronously: Boolean) | ||
|
||
/** | ||
* Load a split JS bundle from the filesystem. See | ||
* [ ][JSBundleLoader.createCachedSplitBundleFromNetworkLoader]. | ||
*/ | ||
public fun loadSplitBundleFromFile(fileName: String, sourceURL: String) | ||
|
||
/** | ||
* This API is used in situations where the JS bundle is being executed not on the device, but on | ||
* a host machine. In that case, we must provide two source URLs for the JS bundle: One to be used | ||
* on the device, and one to be used on the remote debugging machine. | ||
* | ||
* @param deviceURL A source URL that is accessible from this device. | ||
* @param remoteURL A source URL that is accessible from the remote machine executing the JS. | ||
*/ | ||
public fun setSourceURLs(deviceURL: String, remoteURL: String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
...s/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModule.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...ges/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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.bridge | ||
|
||
import com.facebook.proguard.annotations.DoNotStrip | ||
|
||
/** | ||
* Interface denoting that a class is the interface to a module with the same name in JS. Calling | ||
* functions on this interface will result in corresponding methods in JS being called. | ||
* | ||
* When extending JavaScriptModule and registering it with a CatalystInstance, all public methods | ||
* are assumed to be implemented on a JS module with the same name as this class. Calling methods on | ||
* the object returned from [ReactContext.getJSModule] or [CatalystInstance.getJSModule] will result | ||
* in the methods with those names exported by that module being called in JS. | ||
* | ||
* NB: JavaScriptModule does not allow method name overloading because JS does not allow method name | ||
* overloading. | ||
*/ | ||
@DoNotStrip public interface JavaScriptModule |
Oops, something went wrong.