import{puzzle}from'jigsaw-puzzle'constp=awaitpuzzle({element: '#app',image: 'image.jpg',/* ...optionalParameters */})constoptionalParameters={pieces: {x: 6,y: 4},attraction: 5,// distance to snap piecesaligned: true,// don't overlap pieces on startzoom: 0.5,// initial zoom of contextbeforeInit: canvas=>{},onInit: state=>{},onChange: state=>{},onComplete: state=>{}}p.newGame()// start overletstate=p.getState()// save gamep.setState(state)// load gamep.destroy()// kill puzzlep.getZoom()// current zoomp.setZoom()// set zoomp.centralize()// pan to center