import Foundation

/// 业务回调闭包对(与 Android `SignCallback` interface 等价)。
///
/// **派发线程**:SDK 内部保证 callback 始终在主线程触发。
public struct SignCallbacks {
    public typealias OnSignResult = (SignResult) -> Void
    public typealias OnEvent = (SdkEvent) -> Void

    /// 签署结果回调。H5 通过 `qianapp://` 协议通知签署完成/拒签等结果时触发。
    public let onSignResult: OnSignResult?

    /// SDK 内部事件回调。页面生命周期、权限、网络错误等非协议性观测点通过此闭包上报。
    public let onEvent: OnEvent?

    public init(onSignResult: OnSignResult? = nil, onEvent: OnEvent? = nil) {
        self.onSignResult = onSignResult
        self.onEvent = onEvent
    }
}
