import { csEventSubscriber } from '../core/csEventSubscriber'; import { ContentsquareModule } from '../core/nativeModules'; import { EventSubscriberType } from '../types/types'; /** * Exports CS onSessionReplayLinkChanged subscriber triggered when session replay link is updated. * * @param {function} onSessionReplayLinkChange - A callback that consumes the session replay link. */ export const onSessionReplayLinkChange = ( onSessionReplayLinkChange: (sessionReplayLink: string) => void ): any => { const removeListener = csEventSubscriber( EventSubscriberType.ON_SESSION_REPLAY_LINK_CHANGE, (payload: string) => { onSessionReplayLinkChange(payload); } ); ContentsquareModule.setOnSessionReplayLinkChange(); return removeListener; }; /** * set the default value of Masking * @param {boolean} isMasking default value if not interpreted is TRUE */ export const setDefaultMasking = (isMasking: boolean): void => { ContentsquareModule.setDefaultMasking(isMasking); };