Incompatible TypeScript definitions in jointjs 2.0.1
See original GitHub issueSame issue as #582
The issue #582 is closed, but I still get the same error when using the NPM package jointjs@2.0.1
I copied the code of the example http://resources.jointjs.com/demos/devs
If I ignore the TypeScript compilation errors, this code works.
import { dia, shapes } from 'jointjs'
const graph = new dia.Graph()
const paper = new dia.Paper({
el : document.getElementById('paper'), // <- ERROR 1
width : 800,
height : 400,
gridSize : 1,
model : graph, // <- ERROR 2
snapLinks : true,
linkPinning : false,
embeddingMode: true,
highlighting : {
'default' : {
name : 'stroke',
options: { // <- ERROR 3
padding: 6,
},
},
'embedding': {
name : 'addClass',
options: { // <- ERROR 3 bis
className: 'highlighted-parent',
},
},
},
validateEmbedding: function (childView, parentView) {
return parentView.model instanceof shapes.devs.Coupled // <- ERROR 4
},
validateConnection: function (sourceView, sourceMagnet, targetView, targetMagnet) {
return sourceMagnet !== targetMagnet
},
})
// ... some code without errors ...
const c1 = new shapes.devs.Coupled({
position: {
x: 230,
y: 50,
},
size : {
width : 300,
height: 300,
},
})
c1.set('inPorts', ['in']) // <- ERROR 5
c1.set('outPorts', ['out 1', 'out 2']) // <- ERROR 5 bis
- Error 1:
Object literal may only specify known properties, and 'el' does not exist in type 'Options'.
- Error 2:
Object literal may only specify known properties, and 'model' does not exist in type 'Options'.
- Error 3:
Object literal may only specify known properties, and 'options' does not exist in type 'GenericHighlighterJSON<HighlighterType>'.
- Error 4:
Property 'model' does not exist on type 'ElementView'.
- Error 5:
Property 'set' does not exist on type 'Coupled'.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Jointjs type definition - javascript - Stack Overflow
The JointJS library comes with the type definitions so you don't have to install separate typings, just npm install --save jointjs will be ......
Read more >Policy Suite - Cisco
This document contains licenses and notices for open source software used in this product.
Read more >Web Libraries in Jars - WebJars
angular-datetime, org.webjars, angular-datetime, 2.0.1 ... ng-codemirror-dictionary-hint, org.webjars.bower, github-com-amarnus-ng-codemirror-dictionary- ...
Read more >Acknowledgments and License Agreements - TechDocs
The terms contained in the CA license agreement are offered by CA and not by the third party licensors ... awesome-typescript-loader 3.5.0 ......
Read more >1368855 – Review Request: radare2 - Red Hat Bugzilla
Doc Type: If docs needed, set a value ... I know that some upstream do that, but that mean this will be broken...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kumilingus Thanks .
npm install @types/backbone --save-dev
solves the issue. You can close it
Installing the Backbone typings
npm install --save-dev @types/backbone
seems to solve the problem. I’ll continue my test, and close this issue if it solves all the problem.