I am facing a challenge in adding an event handler for jointjs paper using TypeScript. I have been unable to find a way to implement it with the joint.js definition file.
private paper = new joint.dia.Paper({
el: $('#paper'),
width: 650,
height: 400,
gridSize: 20,
model: this.graph,
markAvailable: true,
linkConnectionPoint: joint.util.shapePerimeterConnectionPoint,
snapLinks: true
});
this.paper.on('mouseclick', () => {
console.log('Congratulations, you clicked the mouse!');
});
I encountered an error message:
TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
Can anyone advise on how to add event handlers for rectangles and lines using TypeScript?