How To Create A Callback Function In Typescript