25 lines
761 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);
typedef AppCreateViewCallback = void Function(
Either<List<View>, WorkspaceError> viewsOrFailed);
typedef AppDeleteViewCallback = void Function(
2021-07-21 22:41:44 +08:00
Either<List<View>, WorkspaceError> viewsOrFailed);
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
Future<Either<View, WorkspaceError>> createView(
2021-07-22 17:06:53 +08:00
{required String name, String? desc, required ViewType viewType});
}
2021-07-21 22:41:44 +08:00
abstract class IAppWatch {
2021-07-21 22:41:44 +08:00
void startWatching(
{AppCreateViewCallback? addViewCallback,
2021-07-21 22:41:44 +08:00
AppUpdatedCallback? updatedCallback});
Future<void> stopWatching();
2021-07-21 15:43:05 +08:00
}