import { BrowserExtensionsMainTransport , listen } from 'data-transport' ; import { BackgroundToClient , ClientToBackground , PopupToBackground , } from '../../interface' ; class BackgroundTransport extends BrowserExtensionsMainTransport < BackgroundToClient > implements ClientToBackground , PopupToBackground { showText ( ) { return this . emit ( 'changeTextDisplay' , { status : true } ) ; } @ listen async toggleText ( options ) { return { status : ! options . status , } ; } @ listen async openClient ( options ) { window . open ( options . path , '' , options . features ) ; } } const backgroundTransport = new BackgroundTransport ( ) ; ( window as any ) . backgroundTransport = backgroundTransport ;