@munchi_oy/react-native-epson-printer 1.0.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 (87) hide show
  1. package/README.md +223 -0
  2. package/android/build.gradle +34 -0
  3. package/android/consumer-rules.pro +0 -0
  4. package/android/libs/ePOS2.jar +0 -0
  5. package/android/src/main/AndroidManifest.xml +17 -0
  6. package/android/src/main/java/com/munchiepsonprinter/MunchiEpsonModule.java +1212 -0
  7. package/android/src/main/java/com/munchiepsonprinter/MunchiPrinterPackage.java +24 -0
  8. package/android/src/main/jniLibs/arm64-v8a/libepos2.so +0 -0
  9. package/android/src/main/jniLibs/armeabi-v7a/libepos2.so +0 -0
  10. package/android/src/main/jniLibs/x86/libepos2.so +0 -0
  11. package/android/src/main/jniLibs/x86_64/libepos2.so +0 -0
  12. package/dist/config.d.ts +14 -0
  13. package/dist/config.d.ts.map +1 -0
  14. package/dist/epson/constants.d.ts +124 -0
  15. package/dist/epson/constants.d.ts.map +1 -0
  16. package/dist/epson/discovery.d.ts +14 -0
  17. package/dist/epson/discovery.d.ts.map +1 -0
  18. package/dist/epson/driver.d.ts +26 -0
  19. package/dist/epson/driver.d.ts.map +1 -0
  20. package/dist/epson/errors.d.ts +8 -0
  21. package/dist/epson/errors.d.ts.map +1 -0
  22. package/dist/epson/eventRouter.d.ts +23 -0
  23. package/dist/epson/eventRouter.d.ts.map +1 -0
  24. package/dist/epson/mapper.d.ts +22 -0
  25. package/dist/epson/mapper.d.ts.map +1 -0
  26. package/dist/epson/modelUtils.d.ts +16 -0
  27. package/dist/epson/modelUtils.d.ts.map +1 -0
  28. package/dist/epson/native.d.ts +21 -0
  29. package/dist/epson/native.d.ts.map +1 -0
  30. package/dist/epson/payloadMapper.d.ts +7 -0
  31. package/dist/epson/payloadMapper.d.ts.map +1 -0
  32. package/dist/epson/queueController.d.ts +15 -0
  33. package/dist/epson/queueController.d.ts.map +1 -0
  34. package/dist/epson/recoveryController.d.ts +15 -0
  35. package/dist/epson/recoveryController.d.ts.map +1 -0
  36. package/dist/epson/sessionManager.d.ts +11 -0
  37. package/dist/epson/sessionManager.d.ts.map +1 -0
  38. package/dist/errorResolver.d.ts +15 -0
  39. package/dist/errorResolver.d.ts.map +1 -0
  40. package/dist/errors.d.ts +23 -0
  41. package/dist/errors.d.ts.map +1 -0
  42. package/dist/index.d.ts +15 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +11 -0
  45. package/dist/index.mjs +11 -0
  46. package/dist/react/PrinterProvider.d.ts +19 -0
  47. package/dist/react/PrinterProvider.d.ts.map +1 -0
  48. package/dist/react/usePrinterStatus.d.ts +12 -0
  49. package/dist/react/usePrinterStatus.d.ts.map +1 -0
  50. package/dist/types.d.ts +123 -0
  51. package/dist/types.d.ts.map +1 -0
  52. package/dist/utils/errorUtils.d.ts +3 -0
  53. package/dist/utils/errorUtils.d.ts.map +1 -0
  54. package/dist/version.d.ts +2 -0
  55. package/dist/version.d.ts.map +1 -0
  56. package/ios/MunchiPrinter-Bridging-Header.h +4 -0
  57. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/Info.plist +48 -0
  58. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/_CodeSignature/CodeDirectory +0 -0
  59. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/_CodeSignature/CodeRequirements +0 -0
  60. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  61. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/_CodeSignature/CodeResources +398 -0
  62. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/_CodeSignature/CodeSignature +0 -0
  63. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/dSYMs/libepos2.framework.dSYM/Contents/Info.plist +20 -0
  64. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/dSYMs/libepos2.framework.dSYM/Contents/Resources/DWARF/libepos2 +0 -0
  65. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/dSYMs/libepos2.framework.dSYM/Contents/Resources/Relocations/aarch64/libepos2.yml +5177 -0
  66. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/Headers/ePOS2.h +1809 -0
  67. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/Headers/libepos2.h +13 -0
  68. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/Info.plist +0 -0
  69. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/Modules/module.modulemap +6 -0
  70. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/PrivacyInfo.xcprivacy +31 -0
  71. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64/libepos2.framework/libepos2 +0 -0
  72. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/dSYMs/libepos2.framework.dSYM/Contents/Info.plist +20 -0
  73. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/dSYMs/libepos2.framework.dSYM/Contents/Resources/DWARF/libepos2 +0 -0
  74. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/dSYMs/libepos2.framework.dSYM/Contents/Resources/Relocations/aarch64/libepos2.yml +5177 -0
  75. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/dSYMs/libepos2.framework.dSYM/Contents/Resources/Relocations/x86_64/libepos2.yml +5062 -0
  76. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/Headers/ePOS2.h +1809 -0
  77. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/Headers/libepos2.h +13 -0
  78. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/Info.plist +0 -0
  79. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/Modules/module.modulemap +6 -0
  80. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/PrivacyInfo.xcprivacy +31 -0
  81. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/_CodeSignature/CodeResources +146 -0
  82. package/ios/Vendors/Epson/Frameworks/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.framework/libepos2 +0 -0
  83. package/ios/Vendors/Epson/MunchiEpsonModule.m +35 -0
  84. package/ios/Vendors/Epson/MunchiEpsonModule.swift +455 -0
  85. package/munchi-printer.podspec +22 -0
  86. package/package.json +59 -0
  87. package/react-native.config.js +12 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,11 @@
1
+ var w={},L=t=>{w.logger=t},U=()=>w.logger;var D=(u=>(u.CONNECTION_FAILED="CONNECTION_FAILED",u.PRINT_FAILED="PRINT_FAILED",u.DISCOVERY_FAILED="DISCOVERY_FAILED",u.TIMEOUT="TIMEOUT",u.NATIVE_MODULE_MISSING="NATIVE_MODULE_MISSING",u.UNKNOWN="UNKNOWN",u))(D||{}),M=(u=>(u.ERR_PRINTER_OFFLINE="printer.error.offline",u.ERR_PRINTER_BUSY="printer.error.busy",u.ERR_PRINTER_COVER_OPEN="printer.error.cover_open",u.ERR_PRINTER_PAPER_EMPTY="printer.error.paper_empty",u.ERR_CONNECTION_TIMEOUT="printer.error.connection_timeout",u.ERR_UNKNOWN="printer.error.unknown",u))(M||{}),g=class t extends Error{constructor(n,r,o,s){super(o);this.code=n;this.translationCode=r;this.originalError=s;this.name="MunchiPrinterError",Object.setPrototypeOf(this,t.prototype)}};var j=t=>{if(!t||typeof t!="object")return"";let e=t.code;return typeof e=="string"?e:""},k=t=>{if(t instanceof Error)return t.message;if(t&&typeof t=="object"){let e=t.message;if(typeof e=="string")return e}return String(t)},l=(t,e,n)=>t.includes(n)||e===n||e.includes(n),P=t=>{if(t instanceof g)return t;let e=k(t),n=j(t),r=e.toUpperCase(),o=n.toUpperCase();return r.includes("ERROR CODE: 4")?new g("PRINT_FAILED","printer.error.cover_open","Printer cover is open",t):r.includes("ERROR CODE: 3")?new g("PRINT_FAILED","printer.error.busy","Printer is performing auto-recovery",t):r.includes("ERROR CODE: 7")?new g("PRINT_FAILED","printer.error.paper_empty","Printer paper is empty",t):l(r,o,"TARGET_IN_USE")||l(r,o,"BUSY")||l(r,o,"IN_USE")||l(r,o,"PRINT_BUSY")||l(r,o,"DISCOVERY_BUSY")?new g("TIMEOUT","printer.error.busy","Printer is busy",t):l(r,o,"TIMEOUT")||l(r,o,"ERR_TIMEOUT")||l(r,o,"PRINT_TIMEOUT")?new g("TIMEOUT","printer.error.connection_timeout","Operation timed out",t):l(r,o,"PERMISSION_DENIED")||l(r,o,"LOCATION_DISABLED")||l(r,o,"BLUETOOTH_DISABLED")?new g("CONNECTION_FAILED","printer.error.offline",e,t):l(r,o,"DISCOVERY_ERROR")||r.includes("DISCOVERY")?new g("DISCOVERY_FAILED","printer.error.unknown",e,t):l(r,o,"PRINTER_OFFLINE")||l(r,o,"SESSION_ERROR")||l(r,o,"STATUS_ERROR")||l(r,o,"INIT_ERROR")||l(r,o,"PRINT_CANCELED")||l(r,o,"DISCONNECT")||l(r,o,"ERR_DISCONNECT")||r.includes("PRINTER NOT CONNECTED")||r.includes("OFFLINE")?new g("CONNECTION_FAILED","printer.error.offline",r.includes("OFFLINE")?e:"Printer disconnected",t):l(r,o,"CONNECT_ERROR")||r.includes("FAILED TO CONNECT")||l(r,o,"ERR_CONNECT")?new g("CONNECTION_FAILED","printer.error.offline","Failed to connect to printer",t):l(r,o,"PRINT_ERROR")||l(r,o,"PRINT_FAILURE")?new g("PRINT_FAILED","printer.error.unknown",e,t):new g("UNKNOWN","printer.error.unknown",e,t)};var v=(r=>(r.Small="Small",r.Medium="Medium",r.Large="Large",r))(v||{});var F=t=>{let e=[];if(t.settings?.fontSize){let n="Medium";t.settings.fontSize==="Small"&&(n="Small"),t.settings.fontSize==="Large"&&(n="Large"),e.push({type:"fontSize",size:n})}t.settings?.fontStyle==="Bold"&&e.push({type:"bold",value:!0}),e.push({type:"align",align:"center"}),t.tbl&&e.push({type:"text",text:`Table: ${t.tbl}
2
+ `,bold:!0,size:"double-height"}),e.push({type:"text",text:`Order: ${t.id}
3
+ `,bold:!0}),e.push({type:"text",text:`${t.ts}
4
+ `}),e.push({type:"text",text:`--------------------------------
5
+ `}),e.push({type:"align",align:"left"});for(let n of t.lines){let r=n.t,o=n.s,s=n.i||0,R=`${" ".repeat(s)}${r}`;if(o==="C"){if(r.includes("---")){e.push({type:"text",text:`--------------------------------
6
+ `,align:"center"});continue}e.push({type:"text",text:R+`
7
+ `,align:"center",bold:!0})}else o==="B"?e.push({type:"text",text:R+`
8
+ `,bold:!0}):o==="R"?e.push({type:"text",text:R+`
9
+ `,bold:!0}):e.push({type:"text",text:R+`
10
+ `,align:"left"})}return e.push({type:"feed",lines:3}),e.push({type:"cut"}),{commands:e}};var E=class t extends g{constructor(n,r,o,s,u){super(r,o,s,u);this.isHardwareError=n;this.name="PrinterError",Object.setPrototypeOf(this,t.prototype)}},x=t=>{if(t instanceof E)return t.isHardwareError;let e=String(t.message||t).toUpperCase();return e.includes("ERR_OFF_LINE")||e.includes("ERR_COVER_OPEN")||e.includes("ERR_PAPER_OUT")||e.includes("ERR_FAILURE")||e.includes("DISCONNECT")||e.includes("PRINT_TIMEOUT")||e.includes("ERROR CODE: 4")||e.includes("ERROR CODE: 7")||e.includes("ERROR CODE: 3")},B=t=>{if(t instanceof E)return t;let e=P(t),n=x(t);return new E(n,e.code,e.translationCode,e.message,e.originalError)};var Z=(t,e=!1)=>{let n={Small:{normal:{width:1,height:1},item:{width:1,height:1}},Medium:{normal:{width:2,height:2},item:{width:2,height:2}},Large:{normal:{width:2,height:2},item:{width:3,height:3}}},r=e?"item":"normal";return n[t]?.[r]??n.Small.normal},Y=t=>{if(typeof t!="object"||t===null)return null;let e=t;return{target:String(e.target||""),name:String(e.name||""),macAddress:e.macAddress?String(e.macAddress):void 0,ipAddress:e.ipAddress?String(e.ipAddress):void 0,bdAddress:e.bdAddress?String(e.bdAddress):void 0,type:"EPSON"}},V=t=>t.commands.map(e=>{switch(e.type){case"text":return{cmd:"addText",data:e.text,align:e.align,bold:e.bold,underline:e.underline,size:e.size};case"align":return{cmd:"addTextAlign",align:e.align};case"bold":return{cmd:"addTextStyle",bold:e.value};case"fontSize":{let n=Z(e.size,e.isItemName);return{cmd:"addTextSize",width:n.width,height:n.height}}case"newline":return{cmd:"addFeedLine",line:e.lines||1};case"separator":return{cmd:"addText",data:`------------------
11
+ `};case"textLang":return{cmd:"addTextLang",lang:e.lang};case"textFont":return{cmd:"addTextFont",font:e.font};case"image":return{cmd:"addImage",data:e.base64,width:e.width};case"cut":return{cmd:"addCut"};case"drawer":return{cmd:"addPulse"};case"barcode":return{cmd:"addBarcode",data:e.data,type:e.system,width:e.width,height:e.height};case"qr":return{cmd:"addSymbol",data:e.data,type:"QRCODE_MODEL_2",level:e.errorCorrection||"M",width:e.size||3};case"feed":return{cmd:"addFeedLine",line:e.lines};default:return null}}).filter(e=>e!==null);var z=(c=>(c[c.ONLINE=0]="ONLINE",c[c.OFFLINE=1]="OFFLINE",c[c.POWER_OFF=2]="POWER_OFF",c[c.COVER_CLOSE=3]="COVER_CLOSE",c[c.COVER_OPEN=4]="COVER_OPEN",c[c.PAPER_OK=5]="PAPER_OK",c[c.PAPER_NEAR_END=6]="PAPER_NEAR_END",c[c.PAPER_EMPTY=7]="PAPER_EMPTY",c[c.DRAWER_HIGH=8]="DRAWER_HIGH",c[c.DRAWER_LOW=9]="DRAWER_LOW",c[c.BATTERY_ENOUGH=10]="BATTERY_ENOUGH",c[c.BATTERY_EMPTY=11]="BATTERY_EMPTY",c[c.AUTO_RECOVER_ERROR=20]="AUTO_RECOVER_ERROR",c[c.AUTO_RECOVER_OK=21]="AUTO_RECOVER_OK",c[c.UNRECOVERABLE_ERROR=22]="UNRECOVERABLE_ERROR",c))(z||{}),ee=(r=>(r[r.RECONNECTING=0]="RECONNECTING",r[r.RECONNECT=1]="RECONNECT",r[r.DISCONNECT=2]="DISCONNECT",r))(ee||{}),te=(a=>(a[a.SUCCESS=0]="SUCCESS",a[a.ERR_PARAM=1]="ERR_PARAM",a[a.ERR_CONNECT=2]="ERR_CONNECT",a[a.ERR_TIMEOUT=3]="ERR_TIMEOUT",a[a.ERR_MEMORY=4]="ERR_MEMORY",a[a.ERR_ILLEGAL=5]="ERR_ILLEGAL",a[a.ERR_PROCESSING=6]="ERR_PROCESSING",a[a.ERR_NOT_FOUND=7]="ERR_NOT_FOUND",a[a.ERR_IN_USE=8]="ERR_IN_USE",a[a.ERR_TYPE_INVALID=9]="ERR_TYPE_INVALID",a[a.ERR_DISCONNECT=10]="ERR_DISCONNECT",a[a.ERR_ALREADY_OPENED=11]="ERR_ALREADY_OPENED",a[a.ERR_ALREADY_USED=12]="ERR_ALREADY_USED",a[a.ERR_BOX_COUNT_OVER=13]="ERR_BOX_COUNT_OVER",a[a.ERR_BOX_CLIENT_OVER=14]="ERR_BOX_CLIENT_OVER",a[a.ERR_UNSUPPORTED=15]="ERR_UNSUPPORTED",a[a.ERR_DEVICE_BUSY=16]="ERR_DEVICE_BUSY",a[a.ERR_RECOVERY_FAILURE=17]="ERR_RECOVERY_FAILURE",a[a.ERR_FAILURE=255]="ERR_FAILURE",a))(te||{}),re=(m=>(m[m.SUCCESS=0]="SUCCESS",m[m.ERR_TIMEOUT=1]="ERR_TIMEOUT",m[m.ERR_NOT_FOUND=2]="ERR_NOT_FOUND",m[m.ERR_AUTORECOVER=3]="ERR_AUTORECOVER",m[m.ERR_COVER_OPEN=4]="ERR_COVER_OPEN",m[m.ERR_CUTTER=5]="ERR_CUTTER",m[m.ERR_MECHANICAL=6]="ERR_MECHANICAL",m[m.ERR_EMPTY=7]="ERR_EMPTY",m[m.ERR_UNRECOVERABLE=8]="ERR_UNRECOVERABLE",m[m.ERR_SYSTEM=9]="ERR_SYSTEM",m[m.ERR_PORT=10]="ERR_PORT",m[m.ERR_FAILURE=255]="ERR_FAILURE",m))(re||{}),q=(d=>(d[d.EN=0]="EN",d[d.JA=1]="JA",d[d.ZH_CN=2]="ZH_CN",d[d.ZH_TW=3]="ZH_TW",d[d.KO=4]="KO",d[d.TH=5]="TH",d[d.VI=6]="VI",d[d.MULTI=7]="MULTI",d))(q||{}),ne=(s=>(s[s.FONT_A=0]="FONT_A",s[s.FONT_B=1]="FONT_B",s[s.FONT_C=2]="FONT_C",s[s.FONT_D=3]="FONT_D",s[s.FONT_E=4]="FONT_E",s))(ne||{}),H=(i=>(i[i.TM_M10=0]="TM_M10",i[i.TM_M30=1]="TM_M30",i[i.TM_P20=2]="TM_P20",i[i.TM_P60=3]="TM_P60",i[i.TM_P60II=4]="TM_P60II",i[i.TM_P80=5]="TM_P80",i[i.TM_T20=6]="TM_T20",i[i.TM_T60=7]="TM_T60",i[i.TM_T70=8]="TM_T70",i[i.TM_T81=9]="TM_T81",i[i.TM_T82=10]="TM_T82",i[i.TM_T83=11]="TM_T83",i[i.TM_T88=12]="TM_T88",i[i.TM_T90=13]="TM_T90",i[i.TM_T90KP=14]="TM_T90KP",i[i.TM_U220=15]="TM_U220",i[i.TM_U330=16]="TM_U330",i[i.TM_L90=17]="TM_L90",i[i.TM_H6000=18]="TM_H6000",i[i.TM_T83III=19]="TM_T83III",i[i.TM_T100=20]="TM_T100",i[i.TM_M30II=21]="TM_M30II",i[i.TM_M50=23]="TM_M50",i[i.TM_T88VII=24]="TM_T88VII",i[i.TM_L90LFC=25]="TM_L90LFC",i[i.TM_L100=26]="TM_L100",i[i.TM_P20II=27]="TM_P20II",i[i.TM_P80II=28]="TM_P80II",i[i.TM_M30III=29]="TM_M30III",i[i.TM_M50II=30]="TM_M50II",i[i.TM_M55=31]="TM_M55",i[i.TM_U220II=32]="TM_U220II",i))(H||{});import{NativeEventEmitter as ie,NativeModules as oe}from"react-native";var T=oe.MunchiEpsonModule,A=()=>T?new ie(T):null,se=t=>new Promise(e=>setTimeout(e,t)),ae=t=>{if(!t||typeof t!="object")return"";let e=t.code;return typeof e=="string"?e.toUpperCase():""},ue=t=>{if(t instanceof Error)return t.message.toUpperCase();if(t&&typeof t=="object"){let e=t.message;if(typeof e=="string")return e.toUpperCase()}return String(t).toUpperCase()},f=(t,e,n)=>t.includes(n)||e===n||e.includes(n),N=async(t,e=3,n=500)=>{try{return await t()}catch(r){if(e<=1)throw r;let o=ue(r),s=ae(r);if(f(o,s,"TARGET_IN_USE"))throw r;if(f(o,s,"BUSY")||f(o,s,"IN_USE")||f(o,s,"ERR_IN_USE")||f(o,s,"PRINT_BUSY")||f(o,s,"ERR_CONNECT")||f(o,s,"CONNECT_ERROR")||f(o,s,"ERR_TIMEOUT")||f(o,s,"PRINT_TIMEOUT"))return await se(n),N(t,e-1,n);throw r}};var h=class{constructor(e){this.logger=e}sessionId=null;sessionInitPromise=null;getSessionId(){return this.sessionId}async ensureSession(){if(!T)throw new Error("Native module not found");return this.sessionId?this.sessionId:this.sessionInitPromise?this.sessionInitPromise:(this.sessionInitPromise=T.initSession().then(e=>(this.sessionId=e,e)).finally(()=>{this.sessionInitPromise=null}),this.sessionInitPromise)}async disposeSession(){if(!T||!this.sessionId){this.sessionId=null;return}let e=this.sessionId;this.sessionId=null;try{await T.disposeSession(e)}catch(n){this.logger?.error("[EpsonPrinter] Dispose session failed",n)}}};var C=class{constructor(e){this.logger=e}queue=Promise.resolve();isQueuePaused=!1;resumeQueueResolver=null;isPaused(){return this.isQueuePaused}pause(){this.isQueuePaused=!0}resume(){this.isQueuePaused&&(this.isQueuePaused=!1,this.resumeQueueResolver&&(this.resumeQueueResolver(),this.resumeQueueResolver=null))}async waitUntilResumed(){if(this.isQueuePaused)return new Promise(e=>{let n=this.resumeQueueResolver;this.resumeQueueResolver=()=>{n&&n(),e()}})}enqueue(e){return new Promise((n,r)=>{let o=async()=>{this.isQueuePaused&&(this.logger?.info?.("[EpsonPrinter] Queue is PAUSED. Waiting for resume..."),await this.waitUntilResumed(),this.logger?.info?.("[EpsonPrinter] Queue RESUMED."));try{let s=await e();n(s)}catch(s){r(s)}};this.queue=this.queue.then(o,o)})}enqueueBackground(e){this.queue=this.queue.then(e,e)}};var I=class{constructor(e){this.config=e}recoveryTimer=null;start(){this.recoveryTimer||(this.config.logger?.info?.("[EpsonPrinter] Starting recovery polling..."),this.recoveryTimer=setInterval(async()=>{try{let e=await this.config.getStatus();if(e.online&&!e.coverOpen&&e.errorStatus==="NONE")this.config.logger?.info?.("[EpsonPrinter] Poller detected healthy status. Requesting queue resume."),this.config.onRecovered();else{let r=`[EpsonPrinter] Polling... Status: Online=${e.online}, Cover=${e.coverOpen}, Err=${e.errorStatus}`;this.config.logger?.info?.(r)}}catch(e){this.config.logger?.error("[EpsonPrinter] Recovery poll failed",e)}},2e3))}stop(){this.recoveryTimer&&(this.config.logger?.info?.("[EpsonPrinter] Stopping recovery polling."),clearInterval(this.recoveryTimer),this.recoveryTimer=null)}};var ce=new Set([0,3,5,21]),_=class{constructor(e){this.config=e}statusSubscription=null;connectionSubscription=null;connectionCallbacks=new Set;emitStatus(e){for(let n of this.connectionCallbacks)n(e)}ensureStatusListener(){if(this.statusSubscription)return;let e=A();e&&(this.config.logger?.info?.("[EpsonPrinter] Starting status listener for queue management"),this.statusSubscription=e.addListener("onPrinterStatusChange",n=>{if(!this.config.getSessionId()||n.sessionId!==this.config.getSessionId())return;let r=`[EpsonPrinter] Received Status Event: ${n.eventType}`;this.config.logger?.info?.(r),ce.has(n.eventType)&&this.config.onRecoveryEvent(n.eventType)}))}ensureConnectionListener(){if(this.connectionSubscription)return;let e=A();e&&(this.connectionSubscription=e.addListener("onPrinterConnectionChange",n=>{if(!this.config.getSessionId()||n.sessionId!==this.config.getSessionId())return;let r="UNKNOWN";switch(n.status){case"RECONNECTING":r="RECONNECTING";break;case"RECONNECTED":r="CONNECTED";break;case"DISCONNECTED":r="DISCONNECTED";break;default:r="UNKNOWN"}this.config.onConnectionEvent(r),this.emitStatus(r)}))}removeStatusListener(){this.statusSubscription&&(this.statusSubscription.remove(),this.statusSubscription=null)}onConnectionChange(e){return this.connectionCallbacks.add(e),e(this.config.getConnectionStatus()),this.ensureConnectionListener(),()=>{this.connectionCallbacks.delete(e),this.connectionCallbacks.size===0&&this.connectionSubscription&&(this.connectionSubscription.remove(),this.connectionSubscription=null)}}};var G={online:!1,coverOpen:!1,paperEmpty:!1,paper:"EMPTY",errorStatus:"NONE",drawerOpen:!1},O=class{disconnectTimer=null;connectionStatus="DISCONNECTED";isConnecting=!1;target=null;defaultTarget;model;lang;logger;sessionManager;queueController;recoveryController;eventRouter;constructor(e){this.logger=e.logger,this.defaultTarget=e.target??null,this.model=e.model,this.lang=e.lang??0,this.sessionManager=new h(this.logger),this.queueController=new C(this.logger),this.recoveryController=new I({logger:this.logger,getStatus:()=>this.getStatus(),onRecovered:()=>this.resumeQueue()}),this.eventRouter=new _({logger:this.logger,getSessionId:()=>this.sessionManager.getSessionId(),getConnectionStatus:()=>this.connectionStatus,onRecoveryEvent:()=>{this.queueController.isPaused()&&(this.logger?.info?.("[EpsonPrinter] Printer recovered (Event). Resuming queue..."),this.resumeQueue())},onConnectionEvent:n=>{n==="CONNECTED"&&(this.connectionStatus="CONNECTED"),n==="DISCONNECTED"&&(this.connectionStatus="DISCONNECTED")}})}resumeQueue(){if(!this.queueController.isPaused())return;this.logger?.info?.("[EpsonPrinter] Resuming queue..."),this.recoveryController.stop(),this.queueController.resume()}async connect(e,n=5e3){let r=e??this.defaultTarget;if(!r){let o=new Error("Printer target is required");throw this.logger?.error("[EpsonPrinter] Connect failed: missing target",o),o}return this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null),this.queueController.enqueue(async()=>{if(!T){this.logger?.error("[EpsonPrinter] Native module not found");return}if(this.connectionStatus==="CONNECTED"&&this.target===r)return;let o=await this.sessionManager.ensureSession();this.isConnecting=!0,this.connectionStatus="CONNECTING",this.eventRouter.emitStatus("CONNECTING");try{await N(()=>T.connect(o,r,n,this.model,this.lang)),this.target=r,this.connectionStatus="CONNECTED",this.eventRouter.emitStatus("CONNECTED"),this.isConnecting=!1,this.eventRouter.ensureStatusListener(),this.eventRouter.ensureConnectionListener()}catch(s){let u=P(s);throw this.logger?.error(`[EpsonPrinter] Connect failed for ${r}`,u),this.connectionStatus="DISCONNECTED",this.eventRouter.emitStatus("DISCONNECTED"),this.isConnecting=!1,u}})}async print(e){if(!T)return;this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null);let n=0;return this.queueController.enqueue(async()=>{let r=await this.sessionManager.ensureSession(),o=V(e);for(;;){n++,this.logger?.info?.(`[EpsonPrinter] Print attempt ${n}`);try{await N(()=>T.print(r,o));break}catch(s){let u=B(s);if(u.isHardwareError){this.queueController.pause(),this.logger?.error(`[EpsonPrinter] Hardware error on attempt ${n}. Waiting for recovery before retry...`,u),this.recoveryController.start(),await this.queueController.waitUntilResumed(),this.logger?.info?.("[EpsonPrinter] Recovery detected. Sending cut to flush partial print before retry...");try{await T.print(r,[{cmd:"addCut"}])}catch{}this.logger?.info?.("[EpsonPrinter] Retrying print job...")}else throw this.logger?.error(`[EpsonPrinter] Print failed (non-recoverable) on attempt ${n}`,u),u}}}).finally(()=>{this.disconnectTimer&&clearTimeout(this.disconnectTimer),this.disconnectTimer=setTimeout(()=>{this.performDisconnect()},5e3)})}performDisconnect(){this.queueController.enqueueBackground(async()=>{if(!this.disconnectTimer)return;let e=this.sessionManager.getSessionId();if(T&&this.connectionStatus==="CONNECTED"&&e)try{await T.disconnect(e),this.connectionStatus="DISCONNECTED",this.target=null,this.eventRouter.emitStatus("DISCONNECTED"),await this.sessionManager.disposeSession()}catch(n){this.logger?.error("[EpsonPrinter] Auto-Disconnect failed",n)}this.disconnectTimer=null})}async printEmbedded(e){try{let n=F(e);return await this.print(n)}catch(n){let r=P(n);throw String(n).includes("MunchiPrinterError")||this.logger?.error("[EpsonPrinter] Embedded print failed",r),r}}async disconnect(){return this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null),this.queueController.enqueue(async()=>{if(!T)return;let e=this.sessionManager.getSessionId();if(e)try{await T.disconnect(e),this.connectionStatus="DISCONNECTED",this.target=null,this.eventRouter.emitStatus("DISCONNECTED"),this.eventRouter.removeStatusListener(),this.recoveryController.stop()}catch(n){this.logger?.error("[EpsonPrinter] Disconnect failed",n)}finally{await this.sessionManager.disposeSession()}})}async getStatus(){if(!T)return G;let e=this.sessionManager.getSessionId();if(!e)return G;try{return await T.getStatus(e)}catch(n){throw this.logger?.error("[EpsonPrinter] GetStatus failed",n),P(n)}}async openDrawer(){let e={commands:[{type:"drawer"}]};return this.print(e)}onConnectionChange(e){return this.eventRouter.onConnectionChange(e)}};var me="1.0.0";var de=t=>{let e=P(t),n=e.message.toUpperCase(),r=t instanceof E?t.isHardwareError:x(t),o=e.translationCode==="printer.error.busy"||n.includes("BUSY")||n.includes("IN_USE")||n.includes("PRINT_BUSY"),s=e.code==="TIMEOUT"||e.translationCode==="printer.error.connection_timeout"||n.includes("TIMEOUT"),u=e.code==="CONNECTION_FAILED"||e.translationCode==="printer.error.offline",R=e.code==="DISCOVERY_FAILED",d="UNKNOWN";return r?d="HARDWARE":o?d="BUSY":s?d="TIMEOUT":u?d="CONNECTION":R?d="DISCOVERY":e.code==="PRINT_FAILED"&&(d="PRINT"),{code:e.code,translationCode:e.translationCode,message:e.message,category:d,isHardwareError:r,retryable:o||s,shouldPauseQueue:r,raw:t}},Et=t=>de(t);import le,{createContext as Te,useContext as ge,useEffect as Re,useMemo as Q,useState as Pe}from"react";var W=Te(void 0),It=({config:t,logger:e,children:n})=>{let[r,o]=Pe();Re(()=>{e&&L(e)},[e]);let s=Q(()=>{let R={...t,logger:e??t.logger};return X(R)},[t.lang,t.model,t.target,e]),u=Q(()=>({printer:s,config:t,isReady:!0,error:r}),[s,t,r]);return le.createElement(W.Provider,{value:u},n)},K=()=>{let t=ge(W);if(!t)throw new Error("usePrinter must be used within a PrinterProvider");return t};import{useEffect as $,useRef as fe,useState as b}from"react";var Ee={online:!1,coverOpen:!1,paper:"EMPTY",paperEmpty:!0,drawerOpen:!1,errorStatus:"NONE"};function St(t={}){let{pollIntervalMs:e=5e3,enabled:n=!0}=t,{printer:r}=K(),[o,s]=b("DISCONNECTED"),[u,R]=b(null),[d,y]=b(!1),p=fe(null);return $(()=>r.onConnectionChange(m=>{s(m)}),[r]),$(()=>{if(!n||o!=="CONNECTED"){p.current&&(clearInterval(p.current),p.current=null,y(!1));return}let S=async()=>{try{let m=await r.getStatus();R(m)}catch{R(Ee)}};return S(),y(!0),p.current=setInterval(S,e),()=>{p.current&&(clearInterval(p.current),p.current=null,y(!1))}},[r,o,n,e]),{connectionStatus:o,hardwareStatus:u,isPolling:d}}var pe=[[/^TM-m10/i,0],[/^TM-m30III/i,29],[/^TM-m30II/i,21],[/^TM-m30/i,1],[/^TM-m50II/i,30],[/^TM-m50/i,23],[/^TM-m55/i,31],[/^TM-P20II/i,27],[/^TM-P20/i,2],[/^TM-P60II/i,4],[/^TM-P60/i,3],[/^TM-P80II/i,28],[/^TM-P80/i,5],[/^TM-T20/i,6],[/^TM-T60/i,7],[/^TM-T70/i,8],[/^TM-T81/i,9],[/^TM-T82/i,10],[/^TM-T83III/i,19],[/^TM-T83/i,11],[/^TM-T88VII/i,24],[/^TM-T88/i,12],[/^TM-T90KP/i,14],[/^TM-T90/i,13],[/^TM-T100/i,20],[/^TM-U220II/i,32],[/^TM-U220/i,15],[/^TM-U330/i,16],[/^TM-L90LFC/i,25],[/^TM-L90/i,17],[/^TM-L100/i,26],[/^TM-H6000/i,18]],Ne=t=>{for(let[e,n]of pe)if(e.test(t))return n;return null};import{NativeModules as he}from"react-native";var J=he.MunchiEpsonModule,Ce={bluetooth:["BT:"],tcp:["TCP:","TCPS:"],usb:["USB:"]},Ie=t=>t.includes("[local_"),_e=(t,e)=>e?Ce[e].some(r=>t.startsWith(r)):!0,Oe=async t=>{if(!J)return console.warn("[EpsonDiscovery] Native module not found"),[];try{return(await J.discover({timeout:t.timeout})).map(Y).filter(n=>!n||Ie(n.target)?!1:_e(n.target,t.connectionType))}catch(e){let n=P(e);throw console.error("[EpsonDiscovery] Discovery failed",n),n}};function X(t){return new O({...t,logger:t.logger??U()})}export{re as Epos2CallbackCode,ee as Epos2ConnectionEvent,te as Epos2ErrorStatus,ne as Epos2Font,q as Epos2Lang,z as Epos2StatusEvent,H as EpsonModel,v as FontSize,g as MunchiPrinterError,E as PrinterError,D as PrinterErrorCode,It as PrinterProvider,M as PrinterTranslationCode,me as VERSION,Oe as discoverPrinters,U as getGlobalLogger,X as getPrinter,Et as resolveEpsonError,Ne as resolveModelFromBluetoothName,de as resolvePrinterError,L as setGlobalLogger,K as usePrinter,St as usePrinterStatus};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { EpsonPrinterConfig, PrinterLogger } from '../types';
3
+ import { MunchiPrinterError } from '../errors';
4
+ import { EpsonPrinter } from '../epson/driver';
5
+ interface PrinterContextValue {
6
+ printer: EpsonPrinter;
7
+ config: EpsonPrinterConfig;
8
+ isReady: boolean;
9
+ error: MunchiPrinterError | undefined;
10
+ }
11
+ export interface PrinterProviderProps {
12
+ config: EpsonPrinterConfig;
13
+ logger?: PrinterLogger;
14
+ children: React.ReactNode;
15
+ }
16
+ export declare const PrinterProvider: React.FC<PrinterProviderProps>;
17
+ export declare const usePrinter: () => PrinterContextValue;
18
+ export {};
19
+ //# sourceMappingURL=PrinterProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrinterProvider.d.ts","sourceRoot":"","sources":["../../src/react/PrinterProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,UAAU,mBAAmB;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACvC;AAID,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8B1D,CAAC;AAEF,eAAO,MAAM,UAAU,2BAMtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { PrinterConnectionStatus, PrinterStatus } from '../types';
2
+ export interface PrinterStatusState {
3
+ connectionStatus: PrinterConnectionStatus;
4
+ hardwareStatus: PrinterStatus | null;
5
+ isPolling: boolean;
6
+ }
7
+ export interface UsePrinterStatusOptions {
8
+ pollIntervalMs?: number;
9
+ enabled?: boolean;
10
+ }
11
+ export declare function usePrinterStatus(options?: UsePrinterStatusOptions): PrinterStatusState;
12
+ //# sourceMappingURL=usePrinterStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrinterStatus.d.ts","sourceRoot":"","sources":["../../src/react/usePrinterStatus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvE,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,cAAc,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,kBAAkB,CAiD1F"}
@@ -0,0 +1,123 @@
1
+ import type { Epos2Lang, Epos2Font, EpsonModel } from './epson/constants';
2
+ export interface PrinterLogger {
3
+ error(message: string, error?: unknown): void;
4
+ info?(message: string): void;
5
+ }
6
+ export interface EpsonPrinterConfig {
7
+ target?: string;
8
+ model: EpsonModel;
9
+ lang?: Epos2Lang;
10
+ logger?: PrinterLogger;
11
+ }
12
+ export interface MunchiPrinter {
13
+ target: string;
14
+ name: string;
15
+ macAddress?: string;
16
+ type: 'EPSON';
17
+ ipAddress?: string;
18
+ bdAddress?: string;
19
+ }
20
+ export interface PrinterStatus {
21
+ online: boolean;
22
+ coverOpen: boolean;
23
+ paper: 'OK' | 'NEAR_EMPTY' | 'EMPTY';
24
+ paperEmpty: boolean;
25
+ drawerOpen: boolean;
26
+ errorStatus: 'NONE' | 'MECHANICAL_ERR' | 'AUTOCUTTER_ERR';
27
+ }
28
+ export type PrintCommandType = 'text' | 'image' | 'cut' | 'drawer' | 'barcode' | 'qr' | 'feed' | 'align' | 'bold' | 'fontSize' | 'newline' | 'separator' | 'textLang' | 'textFont';
29
+ export interface BasePrintCommand {
30
+ type: PrintCommandType;
31
+ }
32
+ export interface TextCommand extends BasePrintCommand {
33
+ type: 'text';
34
+ text: string;
35
+ align?: 'left' | 'center' | 'right';
36
+ bold?: boolean;
37
+ underline?: boolean;
38
+ size?: 'normal' | 'double-width' | 'double-height' | 'double';
39
+ }
40
+ export interface ImageCommand extends BasePrintCommand {
41
+ type: 'image';
42
+ base64: string;
43
+ width: number;
44
+ }
45
+ export interface CutCommand extends BasePrintCommand {
46
+ type: 'cut';
47
+ }
48
+ export interface DrawerCommand extends BasePrintCommand {
49
+ type: 'drawer';
50
+ }
51
+ export interface BarcodeCommand extends BasePrintCommand {
52
+ type: 'barcode';
53
+ data: string;
54
+ system: 'UPC-A' | 'UPC-E' | 'EAN13' | 'EAN8' | 'CODE39' | 'ITF' | 'CODABAR';
55
+ width?: number;
56
+ height?: number;
57
+ }
58
+ export interface QrCommand extends BasePrintCommand {
59
+ type: 'qr';
60
+ data: string;
61
+ size?: number;
62
+ errorCorrection?: 'L' | 'M' | 'Q' | 'H';
63
+ }
64
+ export interface FeedCommand extends BasePrintCommand {
65
+ type: 'feed';
66
+ lines: number;
67
+ }
68
+ export interface EmbeddedLine {
69
+ t: string;
70
+ s?: 'L' | 'R' | 'C' | 'B';
71
+ i?: number;
72
+ }
73
+ export interface MunchiEmbeddedSettings {
74
+ fontSize?: 'Small' | 'Normal' | 'Large';
75
+ fontStyle?: 'Normal' | 'Bold';
76
+ paperWidth?: 58 | 80;
77
+ }
78
+ export interface MunchiEmbeddedPayload {
79
+ id: string;
80
+ ts: string;
81
+ tbl?: string;
82
+ settings?: MunchiEmbeddedSettings;
83
+ lines: EmbeddedLine[];
84
+ }
85
+ export interface PrintJob {
86
+ commands: PrintCommand[];
87
+ }
88
+ export type PrinterConnectionStatus = 'CONNECTING' | 'CONNECTED' | 'DISCONNECTING' | 'DISCONNECTED' | 'RECONNECTING' | 'UNKNOWN';
89
+ export declare enum FontSize {
90
+ Small = "Small",
91
+ Medium = "Medium",
92
+ Large = "Large"
93
+ }
94
+ export interface AlignCommand extends BasePrintCommand {
95
+ type: 'align';
96
+ align: 'left' | 'center' | 'right';
97
+ }
98
+ export interface BoldCommand extends BasePrintCommand {
99
+ type: 'bold';
100
+ value: boolean;
101
+ }
102
+ export interface FontSizeCommand extends BasePrintCommand {
103
+ type: 'fontSize';
104
+ size: FontSize;
105
+ isItemName?: boolean;
106
+ }
107
+ export interface NewlineCommand extends BasePrintCommand {
108
+ type: 'newline';
109
+ lines?: number;
110
+ }
111
+ export interface SeparatorCommand extends BasePrintCommand {
112
+ type: 'separator';
113
+ }
114
+ export interface TextLangCommand extends BasePrintCommand {
115
+ type: 'textLang';
116
+ lang: Epos2Lang;
117
+ }
118
+ export interface TextFontCommand extends BasePrintCommand {
119
+ type: 'textFont';
120
+ font: Epos2Font;
121
+ }
122
+ export type PrintCommand = TextCommand | ImageCommand | CutCommand | DrawerCommand | BarcodeCommand | QrCommand | FeedCommand | AlignCommand | BoldCommand | FontSizeCommand | NewlineCommand | SeparatorCommand | TextLangCommand | TextFontCommand;
123
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { MunchiPrinterError } from '../errors';
2
+ export declare const normalizeError: (error: unknown) => MunchiPrinterError;
3
+ //# sourceMappingURL=errorUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../../src/utils/errorUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA4C,MAAM,WAAW,CAAC;AAuCzF,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,kBAoJ/C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "1.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //
4
+ #import <ePOS2.h>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libepos2.framework/libepos2</string>
10
+ <key>DebugSymbolsPath</key>
11
+ <string>dSYMs</string>
12
+ <key>LibraryIdentifier</key>
13
+ <string>ios-arm64</string>
14
+ <key>LibraryPath</key>
15
+ <string>libepos2.framework</string>
16
+ <key>SupportedArchitectures</key>
17
+ <array>
18
+ <string>arm64</string>
19
+ </array>
20
+ <key>SupportedPlatform</key>
21
+ <string>ios</string>
22
+ </dict>
23
+ <dict>
24
+ <key>BinaryPath</key>
25
+ <string>libepos2.framework/libepos2</string>
26
+ <key>DebugSymbolsPath</key>
27
+ <string>dSYMs</string>
28
+ <key>LibraryIdentifier</key>
29
+ <string>ios-arm64_x86_64-simulator</string>
30
+ <key>LibraryPath</key>
31
+ <string>libepos2.framework</string>
32
+ <key>SupportedArchitectures</key>
33
+ <array>
34
+ <string>arm64</string>
35
+ <string>x86_64</string>
36
+ </array>
37
+ <key>SupportedPlatform</key>
38
+ <string>ios</string>
39
+ <key>SupportedPlatformVariant</key>
40
+ <string>simulator</string>
41
+ </dict>
42
+ </array>
43
+ <key>CFBundlePackageType</key>
44
+ <string>XFWK</string>
45
+ <key>XCFrameworkFormatVersion</key>
46
+ <string>1.0</string>
47
+ </dict>
48
+ </plist>