react-native-malwarelytics
Version:
Malwarelytics for React Native protects your banking or fintech app from a broad range of mobile security threats with an industry-leading mobile threat intelligence solution.
48 lines • 1.81 kB
TypeScript
import { EmitterSubscription } from "react-native";
import { MalwarelyticsModuleIfc } from "./MalwarelyticsModule";
/**
* Type defining events reported from the native code.
*/
export type EventType = 'Malwarelytics.STATE' | 'Malwarelytics.RASP' | 'Malwarelytics.AV_UPDATE' | 'Malwarelytics.AV_APK_THREAT';
/**
* The `EventHandler` class helps with listening to events sent from the native code.
*/
export declare class EventHelper {
/**
* Instance of native module interface.
*/
readonly module: MalwarelyticsModuleIfc;
/**
* Native emitter instance
*/
private eventEmitter;
/**
* Cached list of supported event on the platform.
*/
private supportedEvents;
/**
* Construct event handler.
* @param module Native module
*/
constructor(module: MalwarelyticsModuleIfc);
/**
* Test whether the event type is supported.
* @param event Event type to test
* @returns Boolean promise indicating support of requested event type.
*/
isEventSupported(event: EventType): Promise<boolean>;
/**
* Add listener for the requested event type. The event type should be supported. Be aware that not all
* event types are supported on both platforms. You should use `isEventSupported()` function before this call.
* @param event Listen to this type of event.
* @param callback The listener function.
* @returns `EmitterSubscription` object.
*/
addListener(event: EventType, callback: (data: any) => void): Promise<EmitterSubscription>;
/**
* Remove listener previously registered in `addListener()` function.
* @param subscription `EmitterSubscription` object.
*/
removeListener(subscription: EmitterSubscription): void;
}
//# sourceMappingURL=EventHelper.d.ts.map