fix: support web

This commit is contained in:
Lethe 2026-01-24 18:13:35 +09:00
parent fe7520bde9
commit ff9c4424ad
2 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "react-native-capture-protection",
"version": "2.4.0",
"version": "2.4.1",
"description": "🛡️ A React Native library to prevent and detect for screen capture, screenshots and app switcher for enhanced security. Fully compatible with both Expo and CLI.",
"main": "./lib/commonjs/index.js",
"module": "./lib/module/index.js",

View File

@ -0,0 +1,16 @@
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
allow: () => Promise<void>;
prevent: () => Promise<void>;
hasListener: () => Promise<boolean>;
protectionStatus: () => Promise<boolean>;
isScreenRecording: () => Promise<boolean | undefined>;
requestPermission: () => Promise<boolean>;
checkPermission: () => Promise<boolean>;
addListener: (eventName: string) => void;
removeListeners: (count: number) => void;
}
export default TurboModuleRegistry.getEnforcing<Spec>('CaptureProtection');