i_app.dart 717 B

12345678910111213141516171819
  1. import 'package:flowy_sdk/protobuf/flowy-workspace/protobuf.dart';
  2. import 'package:dartz/dartz.dart';
  3. typedef AppUpdatedCallback = void Function(String name, String desc);
  4. typedef AppCreateViewCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
  5. typedef AppDeleteViewCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
  6. abstract class IApp {
  7. Future<Either<List<View>, WorkspaceError>> getViews();
  8. Future<Either<View, WorkspaceError>> createView({required String name, String? desc, required ViewType viewType});
  9. }
  10. abstract class IAppListenr {
  11. void start({AppCreateViewCallback? addViewCallback, AppUpdatedCallback? updatedCallback});
  12. Future<void> stop();
  13. }