import EventEmitter from '../utils/emitter' ; import { CoreMethod } from './types/core' ; /**
 * A proxy that listens/emits to events in regards to one xi view.
 * This is a simple emitter that channels core events directly to its
 * ViewController.
 */ export default class ViewProxy extends EventEmitter { id : number ; viewId : string ; sendToCore : ( method : CoreMethod , params : any ) => void ; param { Function } sendToCore param { Number } id param { CoreMethod } viewId constructor ( sendToCore , id , viewId ) { super ( ) ; this . id = id ; this . viewId = viewId ; this . sendToCore = sendToCore ; } param { CoreMethod } method param { Object } params send ( method , params = { } ) { params . view_id = this . viewId ; this . sendToCore ( method , params ) ; } }