@m430/capacitor-label-printer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/API.md +218 -0
  2. package/LICENSE +21 -0
  3. package/M430CapacitorLabelPrinter.podspec +21 -0
  4. package/README.md +190 -0
  5. package/android/build.gradle +46 -0
  6. package/android/libs/.gitkeep +1 -0
  7. package/android/libs/fat-generic-tspl-bluetooth-classic-0.1.16-GA.jar +0 -0
  8. package/android/src/main/AndroidManifest.xml +12 -0
  9. package/android/src/main/java/com/m430/capacitor/labelprinter/.gitkeep +1 -0
  10. package/android/src/main/java/com/m430/capacitor/labelprinter/AndroidPrinterManager.java +132 -0
  11. package/android/src/main/java/com/m430/capacitor/labelprinter/AndroidStatusMapper.java +54 -0
  12. package/android/src/main/java/com/m430/capacitor/labelprinter/LabelPrinterPlugin.java +273 -0
  13. package/android/src/main/java/com/m430/capacitor/labelprinter/VendorAndroidDeviceCatalog.java +81 -0
  14. package/android/src/main/java/com/m430/capacitor/labelprinter/VendorAndroidPrinterSession.java +189 -0
  15. package/capacitor-label-printer.podspec +21 -0
  16. package/dist/docs.json +443 -0
  17. package/dist/esm/cpcl/builder.d.ts +10 -0
  18. package/dist/esm/cpcl/builder.js +35 -0
  19. package/dist/esm/definitions.d.ts +107 -0
  20. package/dist/esm/definitions.js +1 -0
  21. package/dist/esm/errors.d.ts +1 -0
  22. package/dist/esm/errors.js +1 -0
  23. package/dist/esm/index.d.ts +9 -0
  24. package/dist/esm/index.js +11 -0
  25. package/dist/esm/tspl/builder.d.ts +13 -0
  26. package/dist/esm/tspl/builder.js +45 -0
  27. package/dist/esm/tspl/helpers.d.ts +2 -0
  28. package/dist/esm/tspl/helpers.js +6 -0
  29. package/dist/esm/types.d.ts +12 -0
  30. package/dist/esm/types.js +1 -0
  31. package/dist/esm/web.d.ts +21 -0
  32. package/dist/esm/web.js +34 -0
  33. package/dist/plugin.cjs.js +143 -0
  34. package/dist/plugin.cjs.js.map +1 -0
  35. package/dist/plugin.js +136 -0
  36. package/dist/plugin.js.map +1 -0
  37. package/ios/Plugin/.gitkeep +1 -0
  38. package/ios/Plugin/IOSPrinterManager.swift +230 -0
  39. package/ios/Plugin/IOSStatusMapper.swift +57 -0
  40. package/ios/Plugin/LabelPrinterPlugin.swift +141 -0
  41. package/ios/VendorFrameworks/.gitkeep +1 -0
  42. package/ios/VendorFrameworks/adapter.framework/Headers/BasedOtherConnectedDevice.h +17 -0
  43. package/ios/VendorFrameworks/adapter.framework/Headers/ConnectedDevice.h +213 -0
  44. package/ios/VendorFrameworks/adapter.framework/Headers/IPRTBlueToothBaseDef.h +22 -0
  45. package/ios/VendorFrameworks/adapter.framework/Headers/KeepStateConnectedDevice.h +18 -0
  46. package/ios/VendorFrameworks/adapter.framework/Headers/QueueConfig.h +18 -0
  47. package/ios/VendorFrameworks/adapter.framework/Headers/ReadOptions.h +22 -0
  48. package/ios/VendorFrameworks/adapter.framework/Headers/WroteReporter.h +23 -0
  49. package/ios/VendorFrameworks/adapter.framework/Headers/adapter.h +18 -0
  50. package/ios/VendorFrameworks/adapter.framework/Info.plist +0 -0
  51. package/ios/VendorFrameworks/adapter.framework/Modules/module.modulemap +6 -0
  52. package/ios/VendorFrameworks/adapter.framework/adapter +0 -0
  53. package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/Info.plist +0 -0
  54. package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/_CodeSignature/CodeResources +101 -0
  55. package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/adapter +0 -0
  56. package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Frameworks/adapter.framework/Info.plist +0 -0
  57. package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Frameworks/adapter.framework/adapter +0 -0
  58. package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Info.plist +0 -0
  59. package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/_CodeSignature/CodeResources +132 -0
  60. package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/ibridge +0 -0
  61. package/ios/VendorFrameworks/appleble.framework/Headers/AppleBle.h +25 -0
  62. package/ios/VendorFrameworks/appleble.framework/Info.plist +0 -0
  63. package/ios/VendorFrameworks/appleble.framework/Modules/module.modulemap +6 -0
  64. package/ios/VendorFrameworks/appleble.framework/_CodeSignature/CodeResources +252 -0
  65. package/ios/VendorFrameworks/appleble.framework/appleble +0 -0
  66. package/ios/VendorFrameworks/father.framework/Frameworks/adapter.framework/Info.plist +0 -0
  67. package/ios/VendorFrameworks/father.framework/Frameworks/adapter.framework/adapter +0 -0
  68. package/ios/VendorFrameworks/father.framework/Headers/Appendat.h +28 -0
  69. package/ios/VendorFrameworks/father.framework/Headers/Arg.h +22 -0
  70. package/ios/VendorFrameworks/father.framework/Headers/BasicBatteryVolumeArg.h +16 -0
  71. package/ios/VendorFrameworks/father.framework/Headers/BinaryCommand.h +17 -0
  72. package/ios/VendorFrameworks/father.framework/Headers/CPCLCommand.h +10 -0
  73. package/ios/VendorFrameworks/father.framework/Headers/CallbackData.h +26 -0
  74. package/ios/VendorFrameworks/father.framework/Headers/Checker.h +16 -0
  75. package/ios/VendorFrameworks/father.framework/Headers/Command.h +25 -0
  76. package/ios/VendorFrameworks/father.framework/Headers/CommandClause.h +33 -0
  77. package/ios/VendorFrameworks/father.framework/Headers/Commander.h +31 -0
  78. package/ios/VendorFrameworks/father.framework/Headers/DataWriteOperation.h +42 -0
  79. package/ios/VendorFrameworks/father.framework/Headers/DefaultCommand.h +16 -0
  80. package/ios/VendorFrameworks/father.framework/Headers/EasyArg.h +16 -0
  81. package/ios/VendorFrameworks/father.framework/Headers/FastBinary.h +20 -0
  82. package/ios/VendorFrameworks/father.framework/Headers/HexOutput.h +19 -0
  83. package/ios/VendorFrameworks/father.framework/Headers/IDataWriteCallback.h +25 -0
  84. package/ios/VendorFrameworks/father.framework/Headers/Lifecycle.h +21 -0
  85. package/ios/VendorFrameworks/father.framework/Headers/NewLineArg.h +15 -0
  86. package/ios/VendorFrameworks/father.framework/Headers/OnlyBinaryHeaderArg.h +15 -0
  87. package/ios/VendorFrameworks/father.framework/Headers/OnlyTextHeaderArg.h +16 -0
  88. package/ios/VendorFrameworks/father.framework/Headers/PImageTool.h +22 -0
  89. package/ios/VendorFrameworks/father.framework/Headers/PReplaceKit.h +16 -0
  90. package/ios/VendorFrameworks/father.framework/Headers/PSDK.h +60 -0
  91. package/ios/VendorFrameworks/father.framework/Headers/PVariableKit.h +18 -0
  92. package/ios/VendorFrameworks/father.framework/Headers/PsdkConst.h +33 -0
  93. package/ios/VendorFrameworks/father.framework/Headers/Raw.h +22 -0
  94. package/ios/VendorFrameworks/father.framework/Headers/SimpleCheck.h +16 -0
  95. package/ios/VendorFrameworks/father.framework/Headers/SingleCommand.h +32 -0
  96. package/ios/VendorFrameworks/father.framework/Headers/TSPLCommand.h +10 -0
  97. package/ios/VendorFrameworks/father.framework/Headers/WriteControl.h +12 -0
  98. package/ios/VendorFrameworks/father.framework/Headers/WriteOptions.h +28 -0
  99. package/ios/VendorFrameworks/father.framework/Headers/father.h +21 -0
  100. package/ios/VendorFrameworks/father.framework/Info.plist +0 -0
  101. package/ios/VendorFrameworks/father.framework/Modules/module.modulemap +6 -0
  102. package/ios/VendorFrameworks/father.framework/father +0 -0
  103. package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Frameworks/adapter.framework/Info.plist +0 -0
  104. package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Frameworks/adapter.framework/adapter +0 -0
  105. package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Info.plist +0 -0
  106. package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/father +0 -0
  107. package/ios/VendorFrameworks/tspl.framework/Headers/BasicTSPL.h +146 -0
  108. package/ios/VendorFrameworks/tspl.framework/Headers/BasicTSPLArg.h +17 -0
  109. package/ios/VendorFrameworks/tspl.framework/Headers/GenericTSPL.h +16 -0
  110. package/ios/VendorFrameworks/tspl.framework/Headers/TBar.h +30 -0
  111. package/ios/VendorFrameworks/tspl.framework/Headers/TBarCode.h +54 -0
  112. package/ios/VendorFrameworks/tspl.framework/Headers/TBatteryVolume.h +19 -0
  113. package/ios/VendorFrameworks/tspl.framework/Headers/TBox.h +32 -0
  114. package/ios/VendorFrameworks/tspl.framework/Headers/TCircle.h +26 -0
  115. package/ios/VendorFrameworks/tspl.framework/Headers/TCleanBmpFlash.h +20 -0
  116. package/ios/VendorFrameworks/tspl.framework/Headers/TClear.h +20 -0
  117. package/ios/VendorFrameworks/tspl.framework/Headers/TCut.h +21 -0
  118. package/ios/VendorFrameworks/tspl.framework/Headers/TDensity.h +21 -0
  119. package/ios/VendorFrameworks/tspl.framework/Headers/TDirection.h +51 -0
  120. package/ios/VendorFrameworks/tspl.framework/Headers/TDmatrix.h +29 -0
  121. package/ios/VendorFrameworks/tspl.framework/Headers/TDownloadBmpFlash.h +16 -0
  122. package/ios/VendorFrameworks/tspl.framework/Headers/TGap.h +21 -0
  123. package/ios/VendorFrameworks/tspl.framework/Headers/TImage.h +36 -0
  124. package/ios/VendorFrameworks/tspl.framework/Headers/TLine.h +34 -0
  125. package/ios/VendorFrameworks/tspl.framework/Headers/TMddle.h +16 -0
  126. package/ios/VendorFrameworks/tspl.framework/Headers/TPage.h +22 -0
  127. package/ios/VendorFrameworks/tspl.framework/Headers/TPrint.h +21 -0
  128. package/ios/VendorFrameworks/tspl.framework/Headers/TQRCode.h +35 -0
  129. package/ios/VendorFrameworks/tspl.framework/Headers/TReadState.h +16 -0
  130. package/ios/VendorFrameworks/tspl.framework/Headers/TReverse.h +27 -0
  131. package/ios/VendorFrameworks/tspl.framework/Headers/TSN.h +19 -0
  132. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLCodeType.h +53 -0
  133. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLCorrectLevel.h +21 -0
  134. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLFont.h +83 -0
  135. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLImageMode.h +30 -0
  136. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLLineMode.h +37 -0
  137. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLLineType.h +21 -0
  138. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLOutDirection.h +27 -0
  139. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLRotation.h +36 -0
  140. package/ios/VendorFrameworks/tspl.framework/Headers/TSPLShowType.h +36 -0
  141. package/ios/VendorFrameworks/tspl.framework/Headers/TSPL_.h +18 -0
  142. package/ios/VendorFrameworks/tspl.framework/Headers/TSpeed.h +20 -0
  143. package/ios/VendorFrameworks/tspl.framework/Headers/TText.h +38 -0
  144. package/ios/VendorFrameworks/tspl.framework/Headers/TTextBox.h +44 -0
  145. package/ios/VendorFrameworks/tspl.framework/Headers/TVersion.h +19 -0
  146. package/ios/VendorFrameworks/tspl.framework/Headers/tspl.h +45 -0
  147. package/ios/VendorFrameworks/tspl.framework/Info.plist +0 -0
  148. package/ios/VendorFrameworks/tspl.framework/Modules/module.modulemap +6 -0
  149. package/ios/VendorFrameworks/tspl.framework/tspl +0 -0
  150. package/package.json +95 -0
@@ -0,0 +1,42 @@
1
+ //
2
+ // DataWriteOperation.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/11/8.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "WriteControl.h"
10
+ #import <adapter/ConnectedDevice.h>
11
+ #import "WriteOptions.h"
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+ typedef NS_ENUM (NSUInteger , ESCPrinter){
15
+ ESCPrinter_GENERIC,
16
+ ESCPrinter_BY426BT,
17
+ ESCPrinter_QR285A,
18
+ ESCPrinter_L12
19
+ };
20
+
21
+ typedef NS_ENUM (NSUInteger , CPCLPrinter){
22
+ CPCLPrinter_GENERIC,
23
+ CPCLPrinter_QR365_COMPRESS
24
+ };
25
+
26
+ typedef NS_ENUM (NSUInteger , TSPLPrinter){
27
+ TSPLPrinter_GENERIC
28
+ };
29
+
30
+ typedef enum {
31
+ Raw_TEXT,
32
+ Raw_BINARY
33
+ } RawMode;
34
+
35
+ @interface DataWriteOperation : NSObject
36
+
37
+ -(instancetype)initWithOptions:(WriteOptions *)options binary:(NSData *)binary connectedDevice:(ConnectedDevice *)connectedDevice;
38
+ -(WroteReporter *)write;
39
+
40
+ @end
41
+
42
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,16 @@
1
+ //
2
+ // NewDefaultCommand.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/12/7.
6
+ //
7
+
8
+ #import <father/Command.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface DefaultCommand : Command
13
+ -(instancetype)initWithClauses:(NSArray <CommandClause *> *)clauses andVariable:(NSDictionary *)variable;
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,16 @@
1
+ //
2
+ // EasyArg.h
3
+ // FatherFramework
4
+ //
5
+ // Created by IPRT on 2022/10/6.
6
+ //
7
+
8
+ #import <father/Arg.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface EasyArg : Arg
13
+
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,20 @@
1
+ //
2
+ // FastBinary.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/10/13.
6
+ //
7
+ #import "PsdkConst.h"
8
+ #import <Foundation/Foundation.h>
9
+ NS_ASSUME_NONNULL_BEGIN
10
+
11
+ @interface FastBinary : NSObject
12
+ +(instancetype)make;
13
+ @property(nonatomic, readonly) FastBinary *(^appendData)(NSData *data);
14
+ @property(nonatomic, readonly) FastBinary *(^appendString)(NSString *string);
15
+ @property(nonatomic, readonly) FastBinary *(^appendNumber)(int num);
16
+ @property(nonatomic, readonly) FastBinary *(^appendArgWithEncoding)(NSString *arg,NSStringEncoding encoding);
17
+ -(NSData *)output;
18
+ @end
19
+
20
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,19 @@
1
+ //
2
+ // HexOutput.h
3
+ // Father
4
+ //
5
+ // Created by aiyin on 2022/4/11.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface HexOutput : NSObject
13
+ - (NSString *)format:(NSData *)bytes;
14
+ @property(nonatomic , readonly)HexOutput *(^enableFormat)(BOOL isEnableFormat);
15
+ @property(nonatomic , readonly)HexOutput *(^enableSpacing)(BOOL isEnableSpacing);
16
+ @property(nonatomic , readonly)HexOutput *(^maxLengthOfLine)(int lengthOfLine);
17
+ @end
18
+
19
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,25 @@
1
+ //
2
+ // IDataWriteCallback.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/10/25.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import<father/WriteControl.h>
10
+ #import <father/CallbackData.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ typedef void (^successHandler)(DataWrite *datawrite);
15
+ typedef void (^failedHandler)(DataWrite *datawrite, NSException *error);
16
+
17
+ @interface IDataWriteCallback : NSObject
18
+
19
+ @property(nonatomic , readonly)WriteControl (^success)(CallbackData * data);
20
+ @property(nonatomic , readonly)void (^failed)(CallbackData *data,NSException *exception);
21
+ -(void)failed:(failedHandler)failed;
22
+
23
+ @end
24
+
25
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,21 @@
1
+ //
2
+ // Lifecycle.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/11/8.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <adapter/ConnectedDevice.h>
10
+ #import <adapter/QueueConfig.h>
11
+ #import <father/PsdkConst.h>
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface Lifecycle : NSObject
15
+ @property(nonatomic , readonly)Lifecycle *(^connectedDevice)(ConnectedDevice *device);
16
+ @property(nonatomic , readonly)Lifecycle *(^enableAutoNewLine)(BOOL enable);
17
+ -(ConnectedDevice *)getConnectedDevice;
18
+ @property (nonatomic , strong)QueueConfig *queueConfig;
19
+ @end
20
+
21
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,15 @@
1
+ //
2
+ // NewLineArg.h
3
+ // FatherFramework
4
+ //
5
+ // Created by IPRT on 2022/10/6.
6
+ //
7
+
8
+ #import "EasyArg.h"
9
+ NS_ASSUME_NONNULL_BEGIN
10
+
11
+ @interface NewLineArg : EasyArg
12
+
13
+ @end
14
+
15
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,15 @@
1
+ //
2
+ // OnlyBinaryHeaderArg.h
3
+ // FatherFramework
4
+ //
5
+ // Created by IPRT on 2022/10/6.
6
+ //
7
+
8
+ #import "EasyArg.h"
9
+ NS_ASSUME_NONNULL_BEGIN
10
+
11
+ @interface OnlyBinaryHeaderArg : EasyArg
12
+
13
+ @end
14
+
15
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,16 @@
1
+ //
2
+ // OnlyTextHeaderArg.h
3
+ // FatherFramework
4
+ //
5
+ // Created by IPRT on 2022/10/6.
6
+ //
7
+
8
+ #import "EasyArg.h"
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface OnlyTextHeaderArg : EasyArg
13
+
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,22 @@
1
+ //
2
+ // PImageTool.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/12/7.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <UIKit/UIkit.h>
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface PImageTool : NSObject
13
+ + (NSData *)Beeprt_DrawPic_pdfByImg:(UIImage*)img Size:(CGSize) targetSize compress:(BOOL)isCompress reverse:(BOOL)isReverse;
14
+ + (NSData *)codeBy:(NSData *)source;
15
+ + (UIImage *)imageByScalingBy:(UIImage *)sourceImage ToSize:(CGSize)targetSize;
16
+ + (UIImage *)addImageBy:(UIImage*)img;
17
+ + (UIImage *)changeGrayImage:(UIImage *)oldImage ;
18
+ + (UIImage *)inverColorImage:(UIImage *)image;
19
+
20
+ @end
21
+
22
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,16 @@
1
+ //
2
+ // PReplaceKit.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/10/11.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface PReplaceKit : NSObject
13
+ +(NSString *)replaceQuote:(NSString *)text;
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,60 @@
1
+ //
2
+ // PSDK.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/11/8.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <adapter/ConnectedDevice.h>
10
+ #import <father/Command.h>
11
+ #import <father/Commander.h>
12
+ #import <father/PsdkConst.h>
13
+ #import <father/WriteOptions.h>
14
+ #import <father/Raw.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+
18
+ typedef void (^DiscoverBle)(CBPeripheral* peripheral, NSNumber *RSSI);
19
+ typedef void (^DidConnectPeripheral)(CBPeripheral* peripheral);
20
+ typedef void (^DidConnectPeripheral)(CBPeripheral* peripheral);
21
+ typedef void (^DidFailToConnectPeripheral)(CBPeripheral* peripheral,NSError *error);
22
+ typedef void (^DidDisconnectPeripheral)(CBPeripheral* peripheral,NSError *error);
23
+ typedef void (^DidStart)(BOOL result);
24
+
25
+ @interface PSDK : NSObject
26
+
27
+ -(ConnectedDevice *)connectedDevice;
28
+ -(NSString *)sversion;
29
+ -(NSArray *)authors;
30
+ @property(nonatomic , readonly)PSDK *(^raw)(Raw*r);
31
+ @property(nonatomic , readonly)PSDK *(^variable)(NSString *name, id value);
32
+ -(Command *)command;
33
+ @property(nonatomic , readonly)PSDK *(^clear)(void);
34
+ @property(nonatomic , copy)ReceivedData read;
35
+ @property (nonatomic ,readonly)WroteReporter *(^write)(void);
36
+ -(WroteReporter *)write:(WriteOptions *)options;
37
+ @property(nonatomic , copy) DiscoverBle discoverBle;
38
+ @property(nonatomic , copy) DidConnectPeripheral bleDidConnectPeripheral;
39
+ @property(nonatomic , copy) DidFailToConnectPeripheral bleDidFailToConnectPeripheral;
40
+ @property(nonatomic , copy) DidDisconnectPeripheral bleDidDisconnectPeripheral;
41
+ @property(nonatomic , copy) DidStart didStart;
42
+ @property(nonatomic , readonly)PSDK *(^pushArg)(Arg *arg);
43
+ @property(nonatomic , readonly)PSDK *(^pushArgs)(NSArray<Arg *>*args);
44
+ -(void)pushArg:(Arg *)arg;
45
+ -(Commander *)commander;
46
+ /**
47
+ * 开始扫描打印机设备
48
+ */
49
+ -(void)startScanPrinters;
50
+ /**
51
+ * 停止扫描打印机设备
52
+ */
53
+ -(void)stopScanPrinters;
54
+ -(void)read:(ReadOptions *)options;
55
+ //@property(nonatomic , readonly)PSDK *(^line)(LineArg *arg);
56
+ //@property(nonatomic , readonly)PSDK *(^batteryVolume)(BatteryArg * arg);
57
+
58
+ @end
59
+
60
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,18 @@
1
+ //
2
+ // PVariableKit.h
3
+ // Father
4
+ //
5
+ // Created by aiyin on 2022/4/13.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface PVariableKit : NSObject
13
+
14
+ + (NSString *)replaceText:(NSString *)text;
15
+
16
+ @end
17
+
18
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,33 @@
1
+ //
2
+ // PsdkConst.h
3
+ // Father
4
+ //
5
+ // Created by aiyin on 2022/4/11.
6
+ //
7
+ #import <Foundation/Foundation.h>
8
+
9
+ @interface PsdkConst : NSObject
10
+
11
+ + (NSString *)CR;
12
+ + (NSString *)LF;
13
+ + (NSString *)CRLF;
14
+
15
+ + (NSStringEncoding)DEF_CHARSET;
16
+ + (NSData *)DEF_NEWLINE_BINARY;
17
+ + (NSArray<NSString *> *)DEF_AUTHORS;
18
+ + (BOOL)DEF_ENABLED_NEWLINE;
19
+ + (int)DEF_WRITE_CHUNK_SIZE;
20
+ + (NSData *)EMPTY_BYTES;
21
+
22
+ @end
23
+
24
+
25
+ //FOUNDATION_EXPORT NSStringEncoding gbkEncoding;
26
+
27
+
28
+ //FOUNDATION_EXPORT BOOL DEF_ENABLED_NEWLINE;
29
+
30
+
31
+ //FOUNDATION_EXPORT NSData * const EMPTY_BYTES;
32
+
33
+
@@ -0,0 +1,22 @@
1
+ //
2
+ // Raw.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/11/10.
6
+ //
7
+
8
+ #import "EasyArg.h"
9
+ #import "DataWriteOperation.h"
10
+ #import "PsdkConst.h"
11
+ NS_ASSUME_NONNULL_BEGIN
12
+ @class Builder;
13
+ @interface Raw : EasyArg
14
+ +(Raw *)createWithText:(NSString *)text;
15
+ +(Raw *)createWithBinary:(NSData *)binary;
16
+ +(Raw *)createWithText:(NSString *)text encoding:(CFStringEncodings)charset;
17
+ @property(nonatomic , strong) Raw *(^newline)(BOOL isNewline);
18
+ -(BOOL)getNewline;
19
+ +(Raw *)make;
20
+
21
+ @end
22
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,16 @@
1
+ //
2
+ // SimpleCheck.h
3
+ // father
4
+ //
5
+ // Created by IPRT on 2022/11/16.
6
+ //
7
+
8
+ #import "Checker.h"
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface SimpleCheck : Checker
13
+ @property(nonatomic , readonly)SimpleCheck *(^allowedNames)(NSArray< NSString *> *names);
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,32 @@
1
+ //
2
+ // SingleCommand.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/9/22.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <father/Appendat.h>
10
+ #import <father/CommandClause.h>
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @interface SingleCommand<T> : NSObject
14
+ @property (nonatomic , strong) NSString *symbolAfterHeader;
15
+ @property (nonatomic , strong) NSString *symbolBetweenArguments;
16
+
17
+ @property (nonatomic , strong) T header;
18
+ @property (nonatomic , readonly) SingleCommand *(^append)(id appender);
19
+ @property (nonatomic , readonly) SingleCommand *(^appendNumber)(int number);
20
+ @property (nonatomic , readonly) SingleCommand *(^appendText)(NSString *text);
21
+ -(instancetype)initWithHeader:(T)header andSymbolAfterHeader:(NSString *)symbolAfterHeader andSymbolBetweenArguments:(NSString *)symbolBetweenArguments;
22
+ -(void)append:(Appendat*)appendat;
23
+ @end
24
+ @interface BasicStringSingleCommand : SingleCommand<NSString *>
25
+ @property (nonatomic , copy) void (^callback)(id _Nullable object);
26
+
27
+ -(NSString *)getOutput;
28
+ -(CommandClause *)clause;
29
+
30
+
31
+ @end
32
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,10 @@
1
+
2
+ #import "SingleCommand.h"
3
+
4
+ NS_ASSUME_NONNULL_BEGIN
5
+
6
+ @interface TSPLCommand : BasicStringSingleCommand
7
+ - (instancetype)initWithHeader:(NSString *)header;
8
+ @end
9
+
10
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,12 @@
1
+ //
2
+ // WriteControl.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/10/25.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ typedef NS_ENUM (NSUInteger , WriteControl){
10
+ CONTINUE,
11
+ STOP
12
+ };
@@ -0,0 +1,28 @@
1
+ //
2
+ // WriteOptions.h
3
+ // Father
4
+ //
5
+ // Created by IPRT on 2022/10/25.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "IDataWriteCallback.h"
10
+ #import "CallbackData.h"
11
+
12
+ typedef void (^callbackData)(CallbackData *datawrite);
13
+
14
+ NS_ASSUME_NONNULL_BEGIN
15
+
16
+ @interface WriteOptions : NSObject
17
+
18
+ @property (nonatomic , readonly) WriteOptions * (^enableChunkWrite)(BOOL isEnableChunkWrite);
19
+ @property (nonatomic , readonly) WriteOptions * (^chunkSize)(int chunkSize);
20
+ @property (nonatomic , readonly) WriteOptions * (^callback)(IDataWriteCallback *cback);
21
+ @property (nonatomic , strong)NSData *writeData;
22
+ -(BOOL)getEnableChunkWrite;
23
+ -(int)getChunkSize;
24
+ -(IDataWriteCallback *)getCallback;
25
+
26
+ @end
27
+
28
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,21 @@
1
+ //
2
+ // father.h
3
+ // father
4
+ //
5
+ // Created by aiyin on 2022/10/30.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <father/PSDK.h>
10
+ #import <father/Lifecycle.h>
11
+ #import <father/DataWriteOperation.h>
12
+ #import <father/EasyArg.h>
13
+ //! Project version number for father.
14
+ FOUNDATION_EXPORT double fatherVersionNumber;
15
+
16
+ //! Project version string for father.
17
+ FOUNDATION_EXPORT const unsigned char fatherVersionString[];
18
+
19
+ // In this header, you should import all the public headers of your framework using statements like #import <father/PublicHeader.h>
20
+
21
+
@@ -0,0 +1,6 @@
1
+ framework module father {
2
+ umbrella header "father.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }