Normally, we’d be able to export a type definition of a module, which would allow whatever scripts that require it to use that type as well. For example:
export type MyType = "foo" | "bar"
local module = {}
...
return module
And the requiring script:
local module = require(<path.to.module>)
local var: MyType = "foo"
Ok, that works without issue. Here’s the thing, though: what if the requiring script is a module script itself, and we want scripts that require it to also be able to use the type?
When you import the type from module 1 into the module 2, you would also have to export it from module 2 after you import it. There’s no other way as far as I’m aware to propagate it in that manner.
I like to have one module dedicated exclusively to types and then requite it for anything that involves them.