# Typescript functions called in Cpp

**URL:** https://forum.makecode.com/t/typescript-functions-called-in-cpp/4401
**Category:** micro:bit
**Created:** [November 13, 2020, 1:49am UTC](https://forum.makecode.com/t/typescript-functions-called-in-cpp/4401 "2020-11-13T01:49:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![joshkeys19](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/joshkeys19/32/2182_2.png) [@joshkeys19](https://forum.makecode.com/u/joshkeys19)
#### Post date: [November 13, 2020, 1:49am UTC](https://forum.makecode.com/t/typescript-functions-called-in-cpp/4401/1 "2020-11-13T01:49:57Z")

</div>

Hi everyone,

Looking through the forums I’m not quite sure if this has been answered or not. I’m looking to call a .ts function from Cpp. I see mention of using shim:: when going the opposite way, but not sure about going from ts to Cpp. Simple example:

foo.ts has function  
`
namespace tsFunction
{
export fooBar(something:number)
{
…
…
}
}`

`
`

fib.cpp has function  
`
namespace cppFunction {`

`
`

`void fib()
{
fooBar(11);
}
}
`  
How can I make this possible? I’ve tried doing something like:  
`
//% shim=tsFunction::fooBar
`

Any help appreciated.

Thanks,  
Josh
