export default class AddressResolver { _cfg = { ttyUrl : null , ttyParams : { } } ; constructor ( cfg ) { this . _cfg = { ... cfg , } ; } getConnStr ( w , h ) { const { ttyParams , ttyUrl } = this . _cfg ; const params = JSON . stringify ( { ... ttyParams , term : { h , w } } ) ; const encoded = window . encodeURI ( params ) ; return ttyUrl . replace ( ':params' , encoded ) ; } }