i_trash.dart 732 B

1234567891011121314151617181920212223
  1. import 'dart:async';
  2. import 'package:dartz/dartz.dart';
  3. import 'package:flowy_sdk/protobuf/flowy-folder-data-model/trash.pb.dart';
  4. import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
  5. abstract class ITrash {
  6. Future<Either<List<Trash>, FlowyError>> readTrash();
  7. Future<Either<Unit, FlowyError>> putback(String trashId);
  8. Future<Either<Unit, FlowyError>> deleteViews(List<Tuple2<String, TrashType>> trashList);
  9. Future<Either<Unit, FlowyError>> restoreAll();
  10. Future<Either<Unit, FlowyError>> deleteAll();
  11. }
  12. typedef TrashUpdatedCallback = void Function(Either<List<Trash>, FlowyError> trashOrFailed);
  13. abstract class ITrashListener {
  14. void start(TrashUpdatedCallback updateCallback);
  15. Future<void> stop();
  16. }