How do I use onDropObjectOnItem for vis timeline

I was wondering how do I use onDropObjectOnItem for vis timeline? The documentation seems to be very poor, as I’m using TypeScript. I’m trying to drag <span> elements into the timeline.

I’ve tried the official examples, but documentation is poor. I can’t provide the code I’m working on. However, this is the example that I’m working with visjs.github.io/vis-timeline/examples/timeline/other/…. The issue is that the JS code is not well documented and the official documentation does not assist either.

Here’s where I’m at:

onDropObjectOnItem: function(taskItem: HTMLElement, callback (taskItem as HTMLElement) => void) {     
    // Add item to timeline     
    this.timeline.add(taskItem);     
   
    console.log('Added item to timeline.');

    callback(taskItem);
}