#import <Foundation/Foundation.h>
#if __has_include(<TencentQianWebView/TQSignResult.h>)
#import <TencentQianWebView/TQSignResult.h>
#else
#import "TQSignResult.h"
#endif
#if __has_include(<TencentQianWebView/TQSdkEvent.h>)
#import <TencentQianWebView/TQSdkEvent.h>
#else
#import "TQSdkEvent.h"
#endif

NS_ASSUME_NONNULL_BEGIN

typedef void (^TQOnSignResultBlock)(TQSignResult *result);
typedef void (^TQOnEventBlock)(id<TQSdkEvent> event);

/// 业务回调对。
///
/// **派发线程**:SDK 内部保证 callback 始终在主线程触发。
@interface TQSignCallbacks : NSObject

/// 签署结果回调。H5 通过 `qianapp://` 协议通知签署完成/拒签等结果时触发。
@property (nonatomic, copy, nullable) TQOnSignResultBlock onSignResult;

/// SDK 内部事件回调。页面生命周期、权限、网络错误等非协议性观测点通过此 block 上报。
@property (nonatomic, copy, nullable) TQOnEventBlock onEvent;

/// 空回调对(便利构造方法)。
+ (instancetype)callbacks;

/// 指定回调的便利构造。
+ (instancetype)callbacksWithOnSignResult:(nullable TQOnSignResultBlock)onSignResult
                                  onEvent:(nullable TQOnEventBlock)onEvent;

@end

NS_ASSUME_NONNULL_END
