question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible TypeScript definitions in jointjs 2.0.1

See original GitHub issue

Same 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Siddharth-dubeycommented, May 16, 2018

@kumilingus Thanks .

npm install @types/backbone --save-dev

solves the issue. You can close it

3reactions
noemi-salauncommented, Jan 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found