i_app.dart 774 B

12345678910111213141516171819202122
  1. import 'package:flowy_sdk/protobuf/flowy-folder-data-model/protobuf.dart';
  2. import 'package:dartz/dartz.dart';
  3. import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
  4. typedef AppUpdatedCallback = void Function(App app);
  5. typedef AppViewsChangeCallback = void Function(Either<List<View>, FlowyError> viewsOrFailed);
  6. abstract class IApp {
  7. Future<Either<List<View>, FlowyError>> getViews();
  8. Future<Either<View, FlowyError>> createView({required String name, String? desc, required ViewType viewType});
  9. Future<Either<Unit, FlowyError>> delete();
  10. Future<Either<Unit, FlowyError>> rename(String newName);
  11. }
  12. abstract class IAppListenr {
  13. void start({AppViewsChangeCallback? viewsChangeCallback, AppUpdatedCallback? updatedCallback});
  14. Future<void> stop();
  15. }