I am trying to create custom element in jointjs, bu. I don't know how to extend namespaces / interfaces exported by the library so I can easly create a new jointjs element.
The error I am getting is:
Element implicitly has an 'any' type because expression of type '"html"' can't be used to index type 'typeof shapes'. Property 'html' does not exist on type 'typeof shapes'
ERROR > joint.shapes['html'] = {};
import * as joint from 'jointjs';
const BeerObject = (graph: joint.dia.Graph) => {
joint.shapes['html'] = {};
joint.shapes['html'].Element = joint.shapes.basic.Rect.extend({
defaults: joint.util.deepSupplement({
type: 'html.Element',
attrs: {
rect: { stroke: 'none', 'fill-opacity': 0 }
}
}, joint.shapes.basic.Rect.prototype.defaults)
});
};
export default BeerObject;