-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate EventDispatcher interface to Kotlin (#48445)
Summary: Pull Request resolved: #48445 # Changelog: [Internal] - As in the title. Differential Revision: D67760373
- Loading branch information
1 parent
6572d75
commit 3613ceb
Showing
7 changed files
with
66 additions
and
57 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
37 changes: 0 additions & 37 deletions
37
...ative/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
...-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.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,40 @@ | ||
/* | ||
* 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.uimanager.events | ||
|
||
import com.facebook.react.uimanager.common.UIManagerType | ||
|
||
public interface EventDispatcher { | ||
/** Sends the given Event to JS, coalescing eligible events if JS is backed up. */ | ||
public fun dispatchEvent(event: Event<*>?) | ||
|
||
public fun dispatchAllEvents() | ||
|
||
/** Add a listener to this EventDispatcher. */ | ||
public fun addListener(listener: EventDispatcherListener) | ||
|
||
/** Remove a listener from this EventDispatcher. */ | ||
public fun removeListener(listener: EventDispatcherListener) | ||
|
||
public fun addBatchEventDispatchedListener(listener: BatchEventDispatchedListener) | ||
|
||
public fun removeBatchEventDispatchedListener(listener: BatchEventDispatchedListener) | ||
|
||
@Deprecated("Use the modern version with RCTModernEventEmitter") | ||
@Suppress("DEPRECATION") | ||
public fun registerEventEmitter(@UIManagerType uiManagerType: Int, eventEmitter: RCTEventEmitter) | ||
|
||
public fun registerEventEmitter( | ||
@UIManagerType uiManagerType: Int, | ||
eventEmitter: RCTModernEventEmitter | ||
) | ||
|
||
public fun unregisterEventEmitter(@UIManagerType uiManagerType: Int) | ||
|
||
public fun onCatalystInstanceDestroyed() | ||
} |
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
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