import axios , { AxiosInstance } from 'axios' ; import * as NatureRemo from './interfaces' ; export class Local { private readonly instance : AxiosInstance ; constructor ( address ) { this . instance = axios . create ( { baseURL : address , headers : { 'Content-Type' : 'application/x-www-form-urlencoded; charset=utf-8' , } , timeout : 5000 , } ) ; } /**
     * Fetch the newest received IR signal
     */ public async fetchReceivedSignal ( ) { const response = await this . instance . get ( '/messages' ) ; return response . data ; } /**
     * Send a signal
     */ public async sendSignal ( signal ) { const response = await this . instance . post ( '/messages' , signal ) ; return response . data ; } }