20 lines
528 B
Dart
Raw Normal View History

2021-07-24 09:57:17 +08:00
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
2021-07-23 23:56:59 +08:00
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
2021-07-24 09:57:17 +08:00
import 'package:dartz/dartz.dart';
2021-07-23 23:56:59 +08:00
2021-09-07 17:12:03 +08:00
typedef ViewUpdatedCallback = void Function(Either<View, WorkspaceError>);
2021-07-23 23:56:59 +08:00
2021-07-24 09:57:17 +08:00
abstract class IView {
View get view;
Future<Either<Unit, WorkspaceError>> pushIntoTrash();
2021-10-12 14:55:54 +08:00
Future<Either<View, WorkspaceError>> rename(String newName);
2021-07-24 09:57:17 +08:00
}
abstract class IViewListener {
void start({ViewUpdatedCallback? updatedCallback});
2021-07-23 22:42:44 +08:00
Future<void> stop();
2021-07-23 22:42:44 +08:00
}