// VENDORED from @dynamic-labs-sdk/client (src/turboModules/NativeScreenshotProtection.ts). // See NativeDynamicWebView.ts in this directory for why the spec is carried here. // Keep byte-identical to the source spec in @dynamic-labs-sdk/client. // // The `interface`, `default export`, and the `react-native` import are hard // requirements of the codegen parser and intentionally deviate from the // project's conventions. Codegen discovers specs by the `Native*` filename // prefix, so this file cannot be renamed to `.native.ts`. import { type TurboModule, TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { /** * Toggles window-level screenshot/screen-recording protection on the * foreground window while a sensitive surface (e.g. the private-key export * display) is visible. * * Android applies `FLAG_SECURE` on the current Activity window when `enabled` * is `true` and clears it when `false` (only if it set the flag itself, so a * host app's own `FLAG_SECURE` is never cleared). iOS reparents the key * window under a `secureTextEntry` field's canvas so captures render blank. * The protection is window-level and independent of any WebView, so it works * regardless of how the protected UI is rendered. */ setEnabled(enabled: boolean): void; } // eslint-disable-next-line import/no-default-export export default TurboModuleRegistry.get('DynamicClientScreenshotProtection');