As I wrote in this (possibly duplicate) question
The inputType event property is used to determine the kind of change that was performed, since the input event is triggered after the change has taken place.
Notice, it is not allowed to set the inputType as an event detail on a system event, but this work-around seems to work in my own tests.
const inpType = "insertText";
const evt = new Event('input', { bubbles: true, cancelable: true })
evt.inputType = inpType;
inputField.dispatchEvent(evt);
Please read this documentation (and try the sample within) on Mozilla.org
Here are the behaviors triggering the various inputType enums: w3c.org