Skip to content

Latest commit

 

History

History
875 lines (473 loc) · 19.9 KB

_index_d_.starprnt.md

File metadata and controls

875 lines (473 loc) · 19.9 KB

@ionic-native/star-prnt > "index.d" > StarPRNT

Class: StarPRNT

name: StarPRNT

description: * Ionic Native wrappers for the starprnt cordova plugin for Star Micronics Bluetooth/LAN printers

usage: import { StarPRNT } from '@ionic-native/star-prnt';

constructor(private starprnt: StarPRNT) { }

...


this.starprnt.portDiscovery('all')
  .then((res: any) => console.log(res))
  .catch((error: any) => console.error(error));

Hierarchy

IonicNativePlugin

↳ StarPRNT

Index

Properties

Methods


Properties

AlignmentPosition

● AlignmentPosition: object

Defined in index.d.ts:690

Constant for possible AlignmentPosition

Type declaration

Center: string

Left: string

Right: string


BarcodeSymbology

● BarcodeSymbology: object

Defined in index.d.ts:707

Constant for possible BarcodeSymbology

Type declaration

Code128: string

Code39: string

Code93: string

ITF: string

JAN13: string

JAN8: string

NW7: string

UPCA: string

UPCE: string


BarcodeWidth

● BarcodeWidth: object

Defined in index.d.ts:721

Constant for possible BarcodeWidth

Type declaration

Mode1: string

Mode2: string

Mode3: string

Mode4: string

Mode5: string

Mode6: string

Mode7: string

Mode8: string

Mode9: string


BitmapConverterRotation

● BitmapConverterRotation: object

Defined in index.d.ts:751

Constant for possible BitmapConverterRotation

Type declaration

Left90: string

Normal: string

Right90: string

Rotate180: string


BlackMarkType

● BlackMarkType: object

Defined in index.d.ts:682

Constant for possible BlackMarkType

Type declaration

Invalid: string

Valid: string

ValidWithDetection: string


CodePageType

● CodePageType: object

Defined in index.d.ts:601

CodePageType constants

Type declaration

Blank: string

CP1001: string

CP1250: string

CP1251: string

CP1252: string

CP2001: string

CP3001: string

CP3002: string

CP3011: string

CP3012: string

CP3021: string

CP3041: string

CP3840: string

CP3841: string

CP3843: string

CP3845: string

CP3846: string

CP3847: string

CP3848: string

CP737: string

CP772: string

CP774: string

CP851: string

CP852: string

CP855: string

CP857: string

CP858: string

CP860: string

CP861: string

CP862: string

CP863: string

CP864: string

CP865: string

CP869: string

CP874: string

CP928: string

CP932: string

CP999: string

UTF8: string


CutPaperAction

● CutPaperAction: object

Defined in index.d.ts:673

Constant for possible CutPaperAction

Type declaration

FullCut: string

FullCutWithFeed: string

PartialCut: string

PartialCutWithFeed: string


Emulation

● Emulation: object

Defined in index.d.ts:577

Constant for Emulation

Type declaration

EscPos: string

EscPosMobile: string

StarDotImpact: string

StarGraphic: string

StarLine: string

StarPRNT: string

StarPRNTL: string


Encoding

● Encoding: object

Defined in index.d.ts:589

Constant for possible Encoding

Type declaration

Big5: string

GB2312: string

ShiftJIS: string

USASCII: string

UTF8: string

Windows1251: string

Windows1252: string


FontStyleType

● FontStyleType: object

Defined in index.d.ts:666

Constant for possible FontStyleType

Type declaration

A: string

B: string


InternationalType

● InternationalType: object

Defined in index.d.ts:645

Constant for possible InternationalType

Type declaration

Denmark: string

Denmark2: string

France: string

Germany: string

Ireland: string

Italy: string

Japan: string

Korea: string

LatinAmerica: string

Legal: string

Norway: string

Spain: string

Spain2: string

Sweden: string

UK: string

USA: string


LogoSize

● LogoSize: object

Defined in index.d.ts:698

Constant for possible LogoSize

Type declaration

DoubleHeight: string

DoubleWidth: string

DoubleWidthDoubleHeight: string

Normal: string


QrCodeLevel

● QrCodeLevel: object

Defined in index.d.ts:742

Constant for possible QrCodeLevel

Type declaration

H: string

L: string

M: string

Q: string


QrCodeModel

● QrCodeModel: object

Defined in index.d.ts:735

Constant for possible QrCodeModel

Type declaration

No1: string

No2: string


<Static> install

● install: string

Inherited from IonicNativePlugin.install

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:7


<Static> platforms

● platforms: string[]

Inherited from IonicNativePlugin.platforms

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:6


<Static> plugin

● plugin: string

Inherited from IonicNativePlugin.plugin

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:4


<Static> pluginName

● pluginName: string

Inherited from IonicNativePlugin.pluginName

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:2


<Static> pluginRef

● pluginRef: string

Inherited from IonicNativePlugin.pluginRef

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:3


<Static> repo

● repo: string

Inherited from IonicNativePlugin.repo

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:5


Methods

checkStatus

checkStatus(port: string, emulation: string): Promise.<PrinterStatus>

Defined in index.d.ts:769

Checks the status of the printer

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"

Returns: Promise.<PrinterStatus> Returns a promise that resolves with the PrinterStatus object


connect

connect(port: string, emulation: string): Observable.<any>

Defined in index.d.ts:815

Allows you to connect to the printer, keep the connection alive and receive status updates through an observable

Parameters:

Param Type Description
port string printer name i.e BT:StarMicronics.
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"

Returns: Observable.<any> Success! if connected or error message string returned by the SDK.


disconnect

disconnect(): Promise.<any>

Defined in index.d.ts:826

Allows to disconnect (close the connection to the peripherals), this is useful to avoid keeping alive a connection when not in the app to save device battery (energy consumption). You should call this function when the app is paused or closed.

Returns: Promise.<any> Success! if connected or error message string returned by the SDK.


getStatus

getStatus(): Observable.<any>

Defined in index.d.ts:820

Returns an observable with the device status events. Only fires when a printer is connnected through the connect() function

Returns: Observable.<any> dataType: printerOnline, printerOffline, printerImpossible, printerPaperEmpty, printerPaperNearEmpty, printerPaperReady, printerCoverOpen, printerCoverClose, cashDrawerOpen, cashDrawerClose


openCashDrawer

openCashDrawer(port: string, emulation: string): Promise.<any>

Defined in index.d.ts:800

sends an appendPeripheral command to the printer for channels No1 and No2

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"

Returns: Promise.<any> Success! if opened or error message string returned by the SDK.


portDiscovery

portDiscovery(type: string): Promise.<Printers>

Defined in index.d.ts:762

Find available printers

Parameters:

Param Type Description
type string Interface Type: All, LAN, Bluetooth, USB

Returns: Promise.<Printers> Returns a promise that resolves with an array of printers


print

print(port: string, emulation: string, commandsArray: CommandsArray): Promise.<any>

Defined in index.d.ts:808

Sends an Array of commands to the command buffer using the Android ICommandBuilderInterface or iOS ISCBBuilderInterface

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
commandsArray CommandsArray each command in the array should be an instance of the PrintCommand object. Example [{append:"text"}, {"openCashDrawer: 1"}]

Returns: Promise.<any> Success! if printed correctly or error message string returned by the SDK.


printImage

printImage(port: string, emulation: string, imageObj: ImageObj): Promise.<any>

Defined in index.d.ts:793

Gets an image from a string URI and converts it to bitmap to send it to the printer

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
imageObj ImageObj uri:string, paperWidth?:number, cutReceipt?:boolean, openCashDrawer?:boolean

Returns: Promise.<any> Success! if printed correctly or error message string returned by the SDK.


printRasterReceipt

printRasterReceipt(port: string, emulation: string, rasterObj: RasterObj): Promise.<any>

Defined in index.d.ts:785

Converts the text into a bitmap image and sends it to the printer

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
rasterObj RasterObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean, fontSize:number, paperWidth:number

Returns: Promise.<any> Success! if printed correctly or error message string returned by the SDK.


printRawText

printRawText(port: string, emulation: string, printObj: PrintObj): Promise.<any>

Defined in index.d.ts:777

Prints plain text

Parameters:

Param Type Description
port string Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
emulation string StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
printObj PrintObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean

Returns: Promise.<any> Success! if printed correctly or error message string returned by the SDK.


<Static> getPlugin

getPlugin(): any

Inherited from IonicNativePlugin.getPlugin

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:16

Returns the original plugin object

Returns: any


<Static> getPluginInstallName

getPluginInstallName(): string

Inherited from IonicNativePlugin.getPluginInstallName

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:28

Returns the plugin's install name

Returns: string


<Static> getPluginName

getPluginName(): string

Inherited from IonicNativePlugin.getPluginName

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:20

Returns the plugin's name

Returns: string


<Static> getPluginRef

getPluginRef(): string

Inherited from IonicNativePlugin.getPluginRef

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:24

Returns the plugin's reference

Returns: string


<Static> getSupportedPlatforms

getSupportedPlatforms(): string[]

Inherited from IonicNativePlugin.getSupportedPlatforms

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:32

Returns the plugin's supported platforms

Returns: string[]


<Static> installed

installed(): boolean

Inherited from IonicNativePlugin.installed

Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:12

Returns a boolean that indicates whether the plugin is installed

Returns: boolean