UNPKG

@datadog/mobile-react-native

Version:

A client-side React Native module to interact with Datadog

25 lines 1.44 kB
import type { Attributes } from '../AttributesSingleton/types'; import type { UserInfo } from '../UserInfoSingleton/types'; export type AdditionalEventDataForMapper = { userInfo: UserInfo; attributes: Attributes; }; /** * Generic class for applying event mappers. * * Calls params in this order: formatRawEventForMapper, eventMapper, formatMapperEventForNative. * * @param eventMapper the user-registered event mapper * @param formatRawEventForMapper formatter that gets the raw event (from javascript call) and returns the input given to the mapper * @param formatMapperEventForNative formatter that gets the output of the mapper, and returns the input given to the native SDKs * @param formatRawEventForNative called when no event mapper is registered */ export declare class EventMapper<RawEvent, MapperEvent, NativeEvent> { private eventMapper?; private formatRawEventForMapper; private formatMapperEventForNative; private formatRawEventForNative; constructor(eventMapper: ((event: MapperEvent) => MapperEvent | null) | undefined, formatRawEventForMapper: (event: RawEvent, additionalData: AdditionalEventDataForMapper) => MapperEvent, formatMapperEventForNative: (event: MapperEvent, originalEvent: MapperEvent) => NativeEvent, formatRawEventForNative: (event: RawEvent) => NativeEvent); applyEventMapper: (rawEvent: RawEvent) => NativeEvent | null; } //# sourceMappingURL=EventMapper.d.ts.map