@mambasdk/api
v0.0.5
Published
API for accessing Mamba features in a javascript environment
Downloads
15
Readme
@mambasdk/api
@mambasdk/api/system
interface System {
beep: (tone: Tones, duration: number) => void
hasEthernet: () => boolean
hasWifi: () => boolean
hasGprs: () => boolean
isBatteryPresent: () => boolean
getPowerSupply: () => PowerSupply
getTimeFromBoot: () => number
getSerialNumber: () => string
getBatteryStatus: () => BatteryStatus
getBatteryLevel: () => number
Tones: Tones
PowerSupply: PowerSupply
BatteryStatus: BatteryStatus
}
enum Tones {
TONE1,
TONE2,
TONE3,
TONE4,
TONE5,
TONE6,
TONE7,
}
enum PowerSupply {
ADAPTER,
BATTERY,
USB,
}
enum BatteryStatus {
CHECK_NOT_SUPPORTED,
IN_CHARGE,
CHARGE_COMPLETE,
DISCHARGE,
ABSENT,
}
@mambasdk/api/payment
interface Payment {
pay: (params: PaymentOptions, onPayCallback: Function) => void
getAmountAuthorized: () => number
enableCardEvent: () => void
disableCardEvent: () => void
isPaying: () => boolean
failedPaying: () => boolean
getCardHolderName: () => string
getAtk: () => string
getItk: () => string
getAuthorizationDateTime: () => Date
getBrand: () => string
getOrderId: () => string
getAuthorizationCode: () => string
getInstallmentCount: () => number
getPan: () => string
getType: () => string
}
interface PaymentOptions {
amount: number
editable_amount: boolean
}
@mambasdk/api/cookie
class Cookie {
set(key: string, value: string): true
get(key: string): string
clear(): true
}
@mambasdk/api/keyboard
interface Keyboard {
setKeyboardAsNumeric: () => void
setKeyboardAsAlphanumeric: () => void
getKeyCode: (keyName: string) => number
getKeyName: (keyCode: number) => string
isNumericKey: (keyCode: number) => boolean
isActionKey: (keyCode: number) => boolean
isBackspaceEnabled(): () => boolean
disableBackspace: () => void
enableBackspace: () => void
}
@mambasdk/api/merchant
interface Merchant {
getStoneCode: () => string
}