Search code examples
javascriptangularjstypescriptjointjstype-definition

Jointjs type definition


I'm newbe in typescript and trying to use jointjs definition file with typescript 2.2.

this is definition file in github. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jointjs/index.d.ts

to import jointjs to my typescript file i use

import { joint } from 'jointjs';

How can I call classes and functions from index.d.ts file?


Solution

  • The JointJS library comes with the type definitions so you don't have to install separate typings, just npm install --save jointjs will be enough. And then you can use import and use the library like:

    import * as joint from 'jointjs';
    
    let circle = new joint.shapes.basic.Circle();