import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(
  PigeonOptions(
    dartOut: 'lib/pigeons/core_api.g.dart',
    kotlinOut: 'android/app/src/main/kotlin/com/flashlink/vpn/CoreApi.g.kt',
    swiftOut: 'ios/Runner/CoreApi.g.swift',
    dartPackageName: 'com.flashlink.vpn', // 👈 关键
  ),
)
@HostApi()
abstract class CoreApi {
  @async
  String? getApps();
  String? getSystemLocale();
  bool? connect(
    String sessionId,
    int socksPort,
    String tunnelConfig,
    String configJson,
    int remainTime,
    bool isCountdown,
    List<String> allowVpnApps,
    List<String> disallowVpnApps,
    String accessToken,
    String aesKey,
    String aesIv,
    int locationId,
    String locationCode,
    List<String> baseUrls,
    String params,
    int peekTimeInterval,
  );
  bool? disconnect();
  String? getRemoteIp();
  String? getAdvertisingId();
  bool? moveTaskToBack();
  bool? isConnected();
  String? getSimInfo();
  String? getChannel();
  void openPackage(String packageName);
}

// 如果你需要让原生通知 Flutter 事件变化，可用 EventChannelApi
@EventChannelApi()
abstract class CoreChangeEventApi {
  String onEventChange();
}
