import { BluetoothSerial } from '@ionic-native/bluetooth-serial' ; import { Observable } from 'rxjs/Observable' ; import { Observer } from 'rxjs/Observer' ; export class BluetoothSerialMock extends BluetoothSerial { param { string } macAddress_or_uuid returns { Observable < any > } connect ( macAddress_or_uuid ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } param { string } macAddress returns { Observable < any > } connectInsecure ( macAddress ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } returns { Promise < any > } disconnect ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } param { any } data returns { Promise < any > } write ( data ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } available ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } read ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } param { string } delimiter returns { Promise < any > } readUntil ( delimiter ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } param { string } delimiter returns { Observable < any > } subscribe ( delimiter ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } returns { Observable < any > } subscribeRawData ( ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } returns { Promise < any > } clear ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } list ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } isEnabled ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } isConnected ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } readRSSI ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } showBluetoothSettings ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } enable ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } discoverUnpaired ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Observable < any > } setDeviceDiscoveredListener ( ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } param { string } newName setName ( newName ) { } ; param { number } discoverableDuration setDiscoverable ( discoverableDuration ) { } ; }