react-native-screenguard
Version:
A React Native library for preventing your app from screenshots and screen recordings, with powerful event detection capabilities.
75 lines • 3.27 kB
TypeScript
import * as ScreenGuardData from './data';
import { useSGScreenShot } from './useSGScreenShot';
import { useSGScreenRecord } from './useSGScreenRecord';
import * as ScreenGuardConstants from './constant';
declare const _default: {
/**
* initialize the screen guard with settings
* @param data ScreenGuardSettingsData
* @version v2.0.0+
*/
initSettings(data?: ScreenGuardData.ScreenGuardSettingsData | null): Promise<void | string>;
/**
* activate screenshot blocking with a color effect (iOS 13+, Android 8+)
* @param data ScreenGuardColorData object
* throws error if ScreenGuard is not initialized
* @version v0.0.2+
*/
register(data: ScreenGuardData.ScreenGuardColorData): Promise<void | string>;
/**
* (Android only) activate screenshot and screen record blocking without
* any effect (blur, image, color) on Android (Android 5+)
* throws error if ScreenGuard is not initialized
* warning if called on iOS platform
* @deprecated Use register function with displayScreenguardOverlayAndroid = false instead
* @version v1.0.0+
*/
registerWithoutEffect(): Promise<void | string>;
/**
* Activate screenshot blocking with a blur effect after captured (iOS 13+, Android 8+)
* throws error if ScreenGuard is not initialized
* @param data ScreenGuardBlurDataObject data object
* @version v0.1.2+
*/
registerWithBlurView(data: ScreenGuardData.ScreenGuardBlurDataObject): Promise<void | string>;
/**
* Activate with an Image uri (iOS 13+, Android 8+)
* throws error if ScreenGuard is not initialized
* throws error if alignment is not in range from 0 -> 8
* @param data ScreenGuardImageDataObject data object,
* @version v1.0.2+
*/
registerWithImage(data: ScreenGuardData.ScreenGuardImageDataObject): Promise<void | string>;
/**
* (iOS only) Activate screenshot blocking on a specific view region (iOS 13+)
*
* Measures the current position of the view referenced by `viewRef` via
* measureInWindow() and overlays that region with `backgroundColor` in
* screenshots / screen recordings.
*
* Note: the mask is captured once at call time. If the view moves after
* this call, re-invoke to update the masked region.
*
* throws error if ScreenGuard is not initialized
* @param data ScreenGuardPartiallyData object containing viewRef and optional backgroundColor
* @version v2.1.0+
*/
registerScreenguardPartially(data: ScreenGuardData.ScreenGuardPartiallyData): Promise<void | string>;
/**
* Deactivate screenguard
* Clear all screen protector and event listening
* throws error if ScreenGuard is not initialized
* @version v0.0.2+
*/
unregister(): Promise<void | string>;
/**
* Get the current logs of screenguard
* throws error if ScreenGuard is not initialized
* @param maxCount maximum number of logs to retrieve
* @version v2.0.0+
*/
getScreenGuardLogs(maxCount?: number): Promise<Array<ScreenGuardData.ScreenGuardLogEntry> | null>;
};
export default _default;
export { ScreenGuardConstants, useSGScreenShot, useSGScreenRecord };
//# sourceMappingURL=index.d.ts.map