protect-scr
Version:
Comprehensive client-side security protection for React applications against screenshots, printing, and unauthorized access
41 lines • 1.31 kB
TypeScript
export interface SecurityConfig {
disableRightClick?: boolean;
disableTextSelection?: boolean;
disableKeyboardShortcuts?: boolean;
preventScreenshots?: boolean;
preventPrinting?: boolean;
preventPDFGeneration?: boolean;
preventDevTools?: boolean;
blurOnFocusLoss?: boolean;
showWarningOnProtectedAction?: boolean;
redirectOnDevToolsDetection?: string;
customWarningMessage?: string;
watermark?: {
enabled?: boolean;
text?: string;
opacity?: number;
fontSize?: number;
color?: string;
rotation?: number;
};
devToolsDetectionSensitivity?: 'low' | 'medium' | 'high';
onProtectedActionAttempt?: (action: string) => void;
onDevToolsDetected?: () => void;
onScreenshotAttempt?: () => void;
}
export interface RouteSecurityConfig extends SecurityConfig {
routes?: string[];
excludeRoutes?: string[];
}
export interface SecurityManagerInstance {
enable: () => void;
disable: () => void;
updateConfig: (config: Partial<SecurityConfig>) => void;
isEnabled: () => boolean;
getConfig: () => SecurityConfig;
}
export type SecurityLevel = 'basic' | 'standard' | 'maximum';
export interface PresetConfigs {
[key: string]: SecurityConfig;
}
//# sourceMappingURL=index.d.ts.map