import * as joint from 'jointjs'; import { ActionElementTypeName } from 'src/app/common/constants/app-constants'; /** * 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 = '100%'; const rectHeight = '100%'; // custom element implementation // https://resources.jointjs.com/tutorials/joint/tutorials/custom-elements.html#markup const ActionElement = joint.shapes.standard.Rectangle.define(ActionElementTypeName, { size: {width: rectWidth, height: rectHeight} }, { markup: ` ` }); Object.assign(joint.shapes, { app: { ActionElement } });