import 'dart:typed_data';

/// Cross-platform "save a file / open a file" boundary, so everything above
/// it (services, tests) stays free of platform channels. Implementations must
/// never leave plaintext temp copies behind — bytes go straight between
/// memory and the destination the user picked (security-privacy.md).
abstract class FileService {
  /// Asks the user where to save [bytes] (suggesting [suggestedName]) and
  /// writes them there. Returns the chosen path, or null if they cancelled.
  Future<String?> saveFile({
    required String suggestedName,
    required Uint8List bytes,
  });

  /// Asks the user to pick a file (optionally restricted to
  /// [allowedExtensions], without dots) and returns its bytes, or null if
  /// they cancelled.
  Future<Uint8List?> pickFileBytes({List<String>? allowedExtensions});
}
