18 lines
625 B
Dart
Raw Normal View History

2021-07-21 15:43:05 +08:00
import 'package:flowy_sdk/protobuf/flowy-workspace/protobuf.dart';
import 'package:dartz/dartz.dart';
2021-07-21 22:41:44 +08:00
typedef AppUpdatedCallback = void Function(String name, String desc);
2021-10-13 23:11:45 +08:00
typedef AppViewsChangeCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
2021-07-21 22:41:44 +08:00
2021-07-21 15:43:05 +08:00
abstract class IApp {
2021-07-22 17:06:53 +08:00
Future<Either<List<View>, WorkspaceError>> getViews();
2021-07-21 15:43:05 +08:00
2021-10-11 13:15:41 +08:00
Future<Either<View, WorkspaceError>> createView({required String name, String? desc, required ViewType viewType});
}
2021-07-21 22:41:44 +08:00
2021-10-11 13:15:41 +08:00
abstract class IAppListenr {
2021-10-13 23:11:45 +08:00
void start({AppViewsChangeCallback? viewsChangeCallback, AppUpdatedCallback? updatedCallback});
2021-07-21 22:41:44 +08:00
2021-10-11 13:15:41 +08:00
Future<void> stop();
2021-07-21 15:43:05 +08:00
}