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
ExampleA
intest.ts
, the generated file will attempt to importStatus
fromtest.ts
instead ofcommon.ts
. If we instead importedStatus
directly fromcommon.ts
it would correctly importStatus
fromcommon.ts
.