Skip to content

Commit

Permalink
Migrate EventDispatcher interface to Kotlin (#48445)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #48445

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67760373

fbshipit-source-id: 6360ed5b488ec47bdd2e4d0357d0d06e8e42f614
  • Loading branch information
rshest authored and facebook-github-bot committed Jan 6, 2025
1 parent d470f39 commit a9d86be
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.

This file was deleted.

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()
}

0 comments on commit a9d86be

Please sign in to comment.