UNPKG

1.09 kBTypeScriptView Raw
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 */
9
10import {DeviceEventEmitterStatic} from './RCTDeviceEventEmitter';
11
12export interface NativeEventSubscription {
13 /**
14 * Call this method to un-subscribe from a native-event
15 */
16 remove(): void;
17}
18
19/**
20 * Receive events from native-code
21 * Deprecated - subclass NativeEventEmitter to create granular event modules instead of
22 * adding all event listeners directly to RCTNativeAppEventEmitter.
23 * @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\EventEmitter\RCTNativeAppEventEmitter.js
24 * @see https://reactnative.dev/docs/native-modules-ios#sending-events-to-javascript
25 */
26type RCTNativeAppEventEmitter = DeviceEventEmitterStatic;
27
28/**
29 * Deprecated - subclass NativeEventEmitter to create granular event modules instead of
30 * adding all event listeners directly to RCTNativeAppEventEmitter.
31 */
32export const NativeAppEventEmitter: RCTNativeAppEventEmitter;