There's some rough documentation at https://github.com/espruino/Espruino/blob/master/scripts/common.py#L61 and https://github.com/espruino/Espruino/blob/master/README_BuildProcess.md#wrapper-files-
Basically if you write an extension they are functions that hook into Espruino itself.
initruns when the JS environment starts (eg. power on, reset, load)
killis when is shuts down
idleis basically once every time around the event loop
Just one more thing about firing the events from the lib, like Bangle.on('mag'...)
I guess events are triggering "type" : "idle", where the associated 'C' method [like jswrap_puck_idle(), jswrap_banglejs_idle() ]checks if any event is available once every time around the event loop and call * jsiQueueObjectCallbacks();*.
Or there is something more or else that I am missing.
No, that's about it.
jswrap_puck_idlebasically checks/queues/even performs any events that are needed.
trueif the device shouldn't sleep after that iteration of the loop (eg maybe there is a queues event that should be executed)
What is the significance of the below jswrapper connect section, with type = init. Although Event and static method definitions are pretty much fine.
I am not able to find much information but this Espruino documentation page
EDIT: Similarly Type: kill/idle