import { MirrorWhiteboard } from '../src/whiteboard/MirrorWhiteboard/index' ; import { Whiteboard } from '../src/whiteboard/Whiteboard/index' ; import { EventHub } from './../src/event/EventHub' ; import { SyncEvent } from './../src/event/SyncEvent' ; let whiteboard ; const events = [ ] ; const eventHub = new EventHub ( ) ; eventHub . on ( 'sync' , ( changeEv ) => { if ( changeEv . event !== 'borderSnap' ) { events . push ( changeEv ) ; } if ( changeEv . event === 'finish' ) { whiteboard . destroy ( ) ; } } ) ; const images = [ 'https://i.postimg.cc/RZwf0MRw/image.png' , 'https://i.postimg.cc/YjK6XjRq/image.png' , 'https://i.postimg.cc/VN6K0rH3/image.png' , ] ; whiteboard = new Whiteboard ( document . getElementById ( 'root' ) as HTMLDivElement , { sources : images , eventHub , onlyEmitSnap : false , allowRollback : true , } ) ; whiteboard . open ( ) ; const mirrorWhiteboard = new MirrorWhiteboard ( document . getElementById ( 'root-mirror' ) as HTMLDivElement , { sources : images , eventHub , } ) ; mirrorWhiteboard . open ( ) ;