Imports using entire module imports (using import * as ...) cause runtyping to import the types from the file that contains the import and not the file that is exporting.
Example:
common.ts
export enum Status {
Paused,
Running
}
test.ts
import * as common from "./common";
export interface ExampleA {
status: common.Status;
}
If runtypes are generated for ExampleA in test.ts, the generated file
will attempt to import Status from test.ts instead of common.ts. If we
instead imported Status directly from common.ts it would correctly import
Status from common.ts.
Imports using entire module imports (using
import * as ...) cause runtyping to import the types from the file that contains the import and not the file that is exporting.Example:
common.ts
test.ts
If runtypes are generated for
ExampleAintest.ts, the generated filewill attempt to import
Statusfromtest.tsinstead ofcommon.ts. If weinstead imported
Statusdirectly fromcommon.tsit would correctly importStatusfromcommon.ts.