Open
Description
Type generator is trying to be reliable through not being too smart about your project code base. This also reduces the configuration required for the tool to start generating effective code.
One example of the trade offs made is that all the type aliases used in the source file have to be exported from the same file.
Example:
// Here are the imported types
import { Type1 } from "some-lib-1";
import { Type2 } from "some-lib-2";
// Here we re-export them.
// Please note that this is a type only export.
export { type Type1, type Type2 };
export type MyType = {
field1: Type1;
field2: Type2;
};
A good side of this limitation is that there's gonna be no unexpected type leaks. Keep in mind that all the runtime type generators turn compile time only types into real JS code that gets shipped with your bundle and can be examined by others.