import * as joint from 'jointjs'; /** * please refer to documentation in file palette.function.element.ts to get more details * about how to create new element type and define it in typescript */ declare module 'jointjs' { namespace shapes { // add new module called "app" under the already existing "shapes" modeule inside jointjs export namespace app { class ActionElement extends joint.shapes.standard.Rectangle { } } } } const rectWidth = 616; const rectHeight = 381; // custom element implementation // https://resources.jointjs.com/tutorials/joint/tutorials/custom-elements.html#markup const ActionElement = joint.shapes.standard.Rectangle.define('app.ActionElement', { size: {width: rectWidth, height: rectHeight} }, { markup: ` Action 1 ` }); Object.assign(joint.shapes, { app: { ActionElement } });