import InstrumentationModule from '../../native/InstrumentationModule'; /** * Unblocks screenshot capture if it is currently blocked. Otherwise, this has * no effect. * * If screenshots are disabled through {@link AgentConfiguration.screenshotsEnabled} * or through the controller UI, this method has no effect. * * If screenshots are set to manual mode in the controller UI, this method * unblocks for manual mode only. * * **Warning:** This will unblock capture for the entire app. Use the returned * promise to determine when screenshots have effectively been unblocked. * * The user is expected to manage any possible nesting issues that may * occur if blocking and unblocking occur in different code paths. */ async function unblockScreenshots(): Promise { await InstrumentationModule.unblockScreenshots(); } /** * Blocks screenshot capture if it is currently unblocked. Otherwise, this has * no effect. * * If screenshots are disabled through {@link AgentConfiguration.screenshotsEnabled} * or through the controller UI, this method has no effect. * * **Warning:** This will block capture for the entire app. Use the returned * promise to determine when screenshots have effectively been blocked. * * The user is expected to manage any possible nesting issues that may * occur if blocking and unblocking occur in different code paths. * * See {@link unblockScreenshots} */ async function blockScreenshots(): Promise { await InstrumentationModule.blockScreenshots(); } /** * See {@link blockScreenshots}. * * @returns {boolean} Value whether screenshot capture is blocked. */ function screenshotsBlocked(): Promise { return InstrumentationModule.screenshotsBlocked(); } /** * Asynchronously takes a screenshot of the current screen. * * If screenshots are disabled through {@link AgentConfiguration.screenshotsEnabled} * or through the controller UI, this method does nothing. * * This will capture everything, including personal information, so you must be cautious of * when to take the screenshot. * * These screenshots will show up in the Sessions screen for this user. * * The screenshots are taken on a background thread, compressed, and only non-redundant parts * are uploaded, so it is safe to take many of these without impacting performance of your * application. */ async function takeScreenshot(): Promise { await InstrumentationModule.takeScreenshot(); } export { takeScreenshot, screenshotsBlocked, blockScreenshots, unblockScreenshots, };