I have imported a module into the utility library I'm working on with the intent of augmenting and re-exporting it:
import * as ITE from "fp-ts/lib/TaskEither";
const foo = () => "foo";
export const TE = {
...ITE,
foo
};
This works really well as I can import both the things that are in ITE
and foo
from my other modules. The problem is that the imported module (ITE
) also declares an interface (TaskEither
) that somehow doesn't get into the export so when I import TE
elsewhere I can't see TE.TaskEither
.
This is a bit unexpected because before doing this augmentation I was exporting the whole module like this:
export * as TE from "fp-ts/lib/TaskEither";
to enable VS Code to automatically import TE
for me. What am I doing wrong with my current export
? Is there a way to export not only the const
s from ITE
, but also the missing interface
?
If I just re-add
export * as TE from "fp-ts/lib/TaskEither";
It fails as it conflicts with my local declaration of TE
.