import 'dart:async';

import 'app_property.dart';

/// Created by Haoyi on 2022/2/26

abstract class PropertyDelegate {
  FutureOr setDouble(PropertyKey key, double value);

  FutureOr setInt(PropertyKey key, int value);

  FutureOr setBool(PropertyKey key, bool value);

  FutureOr setString(PropertyKey key, String value);

  FutureOr<double?> getDoubleOrNull(PropertyKey key, {double? defValue});

  FutureOr<int?> getIntOrNull(PropertyKey key, {int? defValue});

  FutureOr<bool?> getBoolOrNull(PropertyKey key, {bool? defValue});

  FutureOr<String?> getStringOrNull(PropertyKey key, {String? defValue});

  FutureOr<double> getDouble(PropertyKey key, {required double defValue});

  FutureOr<int> getInt(PropertyKey key, {required int defValue});

  FutureOr<bool> getBool(PropertyKey key, {required bool defValue});

  FutureOr<String> getString(PropertyKey key, {required String defValue});

  FutureOr remove(PropertyKey key);

  FutureOr removeAllWithTag(String tag);

  FutureOr<PropertyBundle> loadValuesByTag(String tag);

  FutureOr<PropertyBundle> loadValuesByUsage(int usage);
}
