# Is there a way to get a typedef from a String of it's package?

**URL:** https://community.haxe.org/t/is-there-a-way-to-get-a-typedef-from-a-string-of-its-package/3708
**Category:** Haxe
**Tags:** haxe-cpp, typedef
**Created:** [October 4, 2022, 6:06pm UTC](https://community.haxe.org/t/is-there-a-way-to-get-a-typedef-from-a-string-of-its-package/3708 "2022-10-04T18:06:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sirox228](https://community.haxe.org/user_avatar/community.haxe.org/sirox228/32/1994_2.png) [@Sirox228](https://community.haxe.org/u/Sirox228)
#### Post date: [October 4, 2022, 6:06pm UTC](https://community.haxe.org/t/is-there-a-way-to-get-a-typedef-from-a-string-of-its-package/3708/1 "2022-10-04T18:06:38Z")

</div>

i was making some hscript api for my app, it have a function that uses `Type.resolveClass($class);` and `Type.resolveEnum($enum);` to get the class/enum and then sets it to hscript Interp, but the problem is not about hscript at all. it seems that neither or those 2 functions can return typedef, is there any way to get typedef like that?

---

<div class="post-metadata">

### Author: ![filt3rek](https://community.haxe.org/user_avatar/community.haxe.org/filt3rek/32/2613_2.png) [@filt3rek](https://community.haxe.org/u/filt3rek)
#### Post date: [October 5, 2022, 9:10am UTC](https://community.haxe.org/t/is-there-a-way-to-get-a-typedef-from-a-string-of-its-package/3708/2 "2022-10-05T09:10:04Z")

</div>

Hej,

These functions return a class or an enum, so they can’t return a typedef.  
But maybe I understand badly your question and you want a function that acts like resolveClass or resolveEnum but for typedef, which will return a typedef but in that case it’s impossible since typedef is a compile-time feature and it doesn’t exist at runtime.
