i_app.dart 716 B

123456789101112131415161718192021222324
  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 AppAddViewCallback = void Function(
  5. Either<List<View>, WorkspaceError> viewsOrFailed);
  6. abstract class IApp {
  7. Future<Either<List<View>, WorkspaceError>> getViews({required String appId});
  8. Future<Either<View, WorkspaceError>> createView(
  9. {required String appId,
  10. required String name,
  11. String? desc,
  12. required ViewType viewType});
  13. }
  14. abstract class IAppWatch {
  15. void startWatching(
  16. {AppAddViewCallback? addViewCallback,
  17. AppUpdatedCallback? updatedCallback});
  18. Future<void> stopWatching();
  19. }