i_view.dart 574 B

123456789101112131415161718192021
  1. import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
  2. import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
  3. import 'package:dartz/dartz.dart';
  4. typedef ViewUpdatedCallback = void Function(Either<View, WorkspaceError>);
  5. abstract class IView {
  6. View get view;
  7. Future<Either<Unit, WorkspaceError>> delete();
  8. Future<Either<View, WorkspaceError>> rename(String newName);
  9. Future<Either<Unit, WorkspaceError>> duplicate();
  10. }
  11. abstract class IViewListener {
  12. void start({ViewUpdatedCallback? updatedCallback});
  13. Future<void> stop();
  14. }