I have to admit this is an interesting question considering a variety of responses raised here:
Personally the version that deem to be more accurate is
The text “typing…” appears specifically under the name of the
person sending you a message when that person starts typing a
message to you
The exact instance at which it appears raises debates, but from several chat applications I've used (currently Disa), the occurence is when the keyboard appears and occasionally vanishes if no key is tapped after a few seconds.
To support this sometimes when the chat window goes out of focus, and then reopened the typing status reappears when the keyboard pops up again (with or without key press)