import 'package:flutter/foundation.dart';

enum LocaleStorageTestMode { normal, sessionOnly, memoryOnly }

@immutable
class LocaleStorageDebugState {
  const LocaleStorageDebugState({
    required this.mode,
    this.localCurrent,
    this.localLegacy,
    this.sessionCurrent,
    this.sessionLegacy,
    this.memoryCurrent,
    this.memoryLegacy,
  });

  final LocaleStorageTestMode mode;
  final String? localCurrent;
  final String? localLegacy;
  final String? sessionCurrent;
  final String? sessionLegacy;
  final String? memoryCurrent;
  final String? memoryLegacy;
}

abstract interface class LocaleStorageBackend {
  String? read();

  void write(String locale);

  void setTestMode(LocaleStorageTestMode mode);

  void clearForTests();

  void seedLegacyForTests(String locale);

  LocaleStorageDebugState debugStateForTests();
}
