Skip to content

Commit

Permalink
'[skip ci] [RN][kotlin] Migrate RCTEventEmitter to Kotlin (#48467)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #48467

# Changelog:
[Internal] -

As in the title.

Differential Revision: D67793304'
  • Loading branch information
rshest authored and facebook-github-bot committed Jan 3, 2025
1 parent 5e7a5a0 commit eedcdc5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 45 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.JavaScriptModule
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap

/**
* Paper JS interface to emit events from native to JS.
*
* Deprecated in favor of [RCTModernEventEmitter], which works with both the old and new renderer.
*/
@DoNotStripAny
@Deprecated("Use [RCTModernEventEmitter] instead")
public interface RCTEventEmitter : JavaScriptModule {
/**
* @param targetTag react tag of the view that receives the event
* @param eventName name of event
* @param event event params
*/
@Deprecated("Use [RCTModernEventEmitter.receiveEvent] instead")
public fun receiveEvent(targetTag: Int, eventName: String, event: WritableMap?)

/**
* Receive and process touches
*
* @param eventName JS event name
* @param touches active pointers data
* @param changedIndices indices of changed pointers
*/
@Deprecated("Dispatch the TouchEvent using [EventDispatcher] instead")
public fun receiveTouches(
eventName: String,
touches: WritableArray,
changedIndices: WritableArray
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ internal class ReactEventEmitter(private val reactContext: ReactApplicationConte
}

@Deprecated("Please use RCTModernEventEmitter")
override fun receiveEvent(targetReactTag: Int, eventName: String, event: WritableMap?) {
receiveEvent(-1, targetReactTag, eventName, event)
override fun receiveEvent(targetTag: Int, eventName: String, event: WritableMap?) {
receiveEvent(-1, targetTag, eventName, event)
}

override fun receiveEvent(
Expand Down

0 comments on commit eedcdc5

Please sign in to comment.