Cocos Creator: interface with native C ++ library

So I want to create a TTS module for Cocos Creator in order to make the game for the blind people. Since the engine obviously does not provide such features by default I searchedo nline and found this article which explains how to make a native plugin. So this is the method I want to incorporate into my project in order to make Windows TTS subsystems (SAPI 5 and ZDSR). However from this articlue I didn’t understand how to export callbacks? For example, I want to make the OnFinished callback which will be fired from the native side when the speech utterance is done. Where can I learn about this?

This is what you need
https://docs.cocos.com/creator/manual/en/advanced-topics/JSB2.0-learning.html
https://docs.cocos.com/creator/manual/en/advanced-topics/jsb/swig/tutorial/