import clone from 'lodash.clone' ; import type { SendOptions } from '../client' ; import type Device from '.' ; export default class Netif { constructor ( readonly device , readonly apiModuleName ) { } param refresh param timeoutInSeconds returns throws ResponseError async getScanInfo ( refresh = false , timeoutInSeconds = 10 , sendOptions ? ) { const sendOptionsWithTimeout = clone ( sendOptions || { } ) ; if ( sendOptionsWithTimeout . timeout == null ) { sendOptionsWithTimeout . timeout = timeoutInSeconds * 1000 * 2 + ( this . device . defaultSendOptions . timeout || 5000 ) ; } return this . device . sendCommand ( { [ this . apiModuleName ] : { get_scaninfo : { refresh : refresh ? 1 : 0 , timeout : timeoutInSeconds , } , } , } , undefined , sendOptions ) ; } }