immich/mobile/pigeon/background_worker_api.dart

50 lines
1.4 KiB
Dart
Raw Normal View History

import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/platform/background_worker_api.g.dart',
swiftOut: 'ios/Runner/Background/BackgroundWorker.g.swift',
swiftOptions: SwiftOptions(includeErrorClass: false),
kotlinOut: 'android/app/src/main/kotlin/app/alextran/immich/background/BackgroundWorker.g.kt',
kotlinOptions: KotlinOptions(package: 'app.alextran.immich.background'),
dartOptions: DartOptions(),
dartPackageName: 'immich_mobile',
),
)
@HostApi()
abstract class BackgroundWorkerFgHostApi {
void enableSyncWorker();
void enableUploadWorker();
// Disables the background upload service
void disableUploadWorker();
}
@HostApi()
abstract class BackgroundWorkerBgHostApi {
// Called from the background flutter engine when it has bootstrapped and established the
// required platform channels to notify the native side to start the background upload
void onInitialized();
void close();
}
@FlutterApi()
abstract class BackgroundWorkerFlutterApi {
// Android & iOS: Called when the local sync is triggered
@async
void onLocalSync(int? maxSeconds);
// iOS Only: Called when the iOS background upload is triggered
@async
void onIosUpload(bool isRefresh, int? maxSeconds);
// Android Only: Called when the Android background upload is triggered
@async
void onAndroidUpload();
@async
void cancel();
}