import 'package:guru_utils/database/database.dart';
import 'package:guru_utils/property/app_property.dart';

/// Created by Haoyi on 2022/8/24

mixin PropertyStorage {
  Future<bool> setProperty(PropertyKey key, String value);

  Future<String?> getProperty(PropertyKey key);

  Future<String?> getOrCreateProperty(PropertyKey key, {String? Function()? ifAbsent});

  Future<Map<PropertyKey, String>> getProperties(List<PropertyKey> keys);

  Future<bool> setProperties(Map<PropertyKey, String> kv);

  Future<Map<PropertyKey, String>> getPropertiesByTag(String tag);

  Future<Map<PropertyKey, String>> getPropertiesByUsage(int usage);

  Future<bool> removeProperty(PropertyKey key);

  Future<List<PropertyKey>> removeAllWithTag(String tag);

  Future<Map<PropertyKey, String>> loadAllProperties();
}
