nss-superapp-libs
TypeScript icon, indicating that this package has built-in type declarations

1.0.16 • Public • Published

React Support

SuperApp.setReactSupport();

Intial(In root container)

SuperApp.loadedEventListener = () =>{
  SuperApp.initial("[mykey]");
  /* Action with SuperApp after this */
}

MiniApp

MiniAppA -> miniAppB SuperApp.MiniApp.open(miniAppId,miniAppVersion,data) //Ex miniAppId = 'sale' ,miniAppVersion = 0 (<1 = latest version),data = "{"barcode":"12345678"}" //* use location:miniAppA

SuperApp.MiniApp.getData():String //return "{"barcode":"12345678"}" //* use location:miniAppB

SuperApp.MiniApp.finish(data) //Ex data = "{"result":"success"}" //* use location:miniAppB

SuperApp.MiniApp.callbackEventListener = function(miniAppId,data) //Ex data = "{"result":"success"}" //* use location:miniAppA

SuperApp.MiniApp.broadcastEventListener = function(data){} //Ex data = "{"data":"somedata"}" //* use location:miniAppB

SQLite Database

SuperApp.MiniApp.execSQLCommand(databaseName,command)
//Ex databaseName = 'sample.db',command = 'select * from sample limit 1'

CashDrawer

SuperApp.Device.CashDrawer.open(123456)
SuperApp.Device.CashDrawer.setCashDrawerEventListener((action,requestId)=>{})

Printer

SuperApp.Device.Printer.print(data,(action)=>{})

Customer Display

 SuperApp.MiniApp.showOnCustomerDisplay(miniAppId:string,htmlPath:string,displayIndex:CustomerDisplayIndex,flag:CustomerDisplayFlag)
       //Ex. miniAppId = self ,htmlPath = index.html?p=1,displayIndex = CustomerDisplayIndex.DISPLAY_INDEX_LEFT,flag=CustomerDisplayFlag.FLAG_MODE_USE_CURRENT
 SuperApp.MiniApp.setCustomerDisplayFlag(flag:CustomerDisplayFlag)
        //Ex.flag=CustomerDisplayFlag.FLAG_MODE_FULL
 SuperApp.MiniApp.broadcastDataToCustomerDisplay(data:string,displayIndex:CustomerDisplayIndex)
 SuperApp.MiniApp.broadcastDataToMiniApp(data:string)

Readme

Keywords

Package Sidebar

Install

npm i nss-superapp-libs

Weekly Downloads

14

Version

1.0.16

License

ISC

Unpacked Size

18.7 kB

Total Files

9

Last publish

Collaborators

  • tirapongboo