Is it possible to use the functions of Plotly modules?

I’m working on my drawing bar, at first I thought about controlling it with my own functions but then I thought why not use the plotly functions better I guess if there is a button in the modebar to delete shapes then there must be a function to do it and instead to make mine because I use that and possibly other functions; I found the function but I don’t know how to import it, I still don’t understand this module thing very well, this is the line of code I added to try to use it which I saw in another plotly file but when I try to use it I get this error: “eraseActiveShape is not a function”

var eraseActiveShape = require('../node_modules/plotly.js/src/components/shapes/draw').eraseActiveShape;

I am using modules from other libraries which I import in the same way using require and I have no problems with those, I guess I am omitting something to be able to use the plotly modules, by the way I am using electron with node

It was not necessary to import the function with the require since it is located in the Plotly object in the following way

Plotly.deleteActiveShape("layer")

The strange thing is that it is not documented like many other functions

Many of the functions and properties that Plotly uses internally can be accessed from the Plotly object (deleteActiveShape, setPlotConfig), the layer (emit), _fullLayout (_deactiveShape, _reDrag), especially the latter has many functions and properties, the problem is that it is not documented its use, I would like this post to help people try these functions and explain them here so that others can use them, hopefully it is possible since there are many doubts in this forum and few answers