AIInfoManager.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // AIInfoManager.h
  3. // PDF Reader Pro Edition
  4. //
  5. // Created by Niehaoyu on 2024/1/24.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "VerificationManager.h"
  9. #define kDeviceAIStatusChangeNotification @"kDeviceAIStatusChangeNotification"
  10. #define kAIIconShowStateChangeNotification @"kAIIconShowStateChangeNotification"
  11. #define kAIIconShowIdentifyKey @"kAIIconShowIdentifyKey"
  12. NS_ASSUME_NONNULL_BEGIN
  13. typedef void(^AIActivityComplention)(NSDictionary *info, NSError *error);
  14. @class AIInfo;
  15. @interface AIInfoManager : NSObject
  16. + (AIInfoManager *)defaultManager;
  17. @property (nonatomic, assign) BOOL showAIIcon;
  18. @property (nonatomic, readonly) BOOL aiInfoValid;
  19. @property (nonatomic, strong) AIInfo *aiInfo;
  20. - (void)activateAIWithInfo:(NSDictionary *)info
  21. complention:(AIActivityComplention)complention;
  22. - (void)fetchAIInfoWithComplention:(AIActivityComplention)complention;
  23. - (void)restoreAIWithInfo:(NSDictionary *)info
  24. complention:(AIActivityComplention)complention;
  25. @end
  26. @interface AIInfo : NSObject
  27. - (id)initWithDict:(NSDictionary *)dict;
  28. @property (nonatomic, readonly) NSDictionary *infoDict;
  29. @property (nonatomic, readonly) BOOL validAIFunction;
  30. @property (nonatomic, readonly) NSString *cdKey;
  31. @property (nonatomic, readonly) int totalToken;
  32. @property (nonatomic, readonly) int usedTimes;
  33. @property (nonatomic, readonly) NSDate *startDate;
  34. @property (nonatomic, readonly) NSDate *endDate;
  35. @property (nonatomic, readonly) int remainingDays;
  36. @property (nonatomic, readonly) int pre_creditToken;
  37. @end
  38. #if DEBUG
  39. @interface AIInfoManager (KMTest)
  40. @end
  41. #endif
  42. NS_ASSUME_NONNULL_END