import * as joint from 'jointjs'; declare module 'jointjs' { namespace shapes { // add new module called "app" under the already existing "shapes" modeule inside jointjs export namespace board { class FunctionElement extends joint.shapes.standard.Rectangle { } } } } const rectWidth = 260; const rectHeight = 150; const FunctionElement = joint.shapes.standard.Rectangle.define('board.FunctionElement', { size: { width: rectWidth, height: rectHeight }, attrs: { icon: { 'xlink:href': 'http://placehold.it/16x16' }, type: '' } }, { markup: ` execute ` }); Object.assign(joint.shapes, { board: { FunctionElement } });