-
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.
Add RawEventTelemetryEventEmitter interface to ReactNativePrivateInte…
…rface Summary: This will be used from the React JS renderer in a followup PR. Changelog: [Added][JS] New event telemetry mechanism exposed from JS to supercede the Pressability-specific telemetry mechanism Reviewed By: ryancat Differential Revision: D33986916 fbshipit-source-id: 912d0b351869348f0ca6e5f6a882fc0501c2c7f0
- Loading branch information
1 parent
97ce240
commit 1f15a64
Showing
2 changed files
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* 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. | ||
* | ||
* @flow strict-local | ||
* @format | ||
*/ | ||
|
||
import EventEmitter from '../vendor/emitter/EventEmitter'; | ||
import type {IEventEmitter} from '../vendor/emitter/EventEmitter'; | ||
|
||
export type RawEventTelemetryEvent = $ReadOnly<{| | ||
eventName: string, | ||
// We expect, but do not/cannot require, that nativeEvent is an object | ||
// with the properties: key, elementType (string), type (string), tag (numeric), | ||
// and a stateNode of the native element/Fiber the event was emitted to. | ||
nativeEvent: {[string]: mixed}, | ||
|}>; | ||
|
||
type RawEventDefinitions = { | ||
[eventChannel: string]: [RawEventTelemetryEvent], | ||
}; | ||
|
||
const RawEventTelemetryEventEmitter: IEventEmitter<RawEventDefinitions> = | ||
new EventEmitter<RawEventDefinitions>(); | ||
|
||
export default RawEventTelemetryEventEmitter; |
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