// This file is a TurboModule spec consumed by React Native codegen.
// 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<Spec>('DynamicClientScreenshotProtection');
