Lets say I have a typescript file Utils with a bunch of exported functions:
export function utilOne(){}
export function utilTwo(){}
I added index.d.ts file to this folder where I export * from the Utils file:
export * from './Utils';
In my other classes I'd like to access functions utilOne and utilTwo via utils namespace, like:
utils.utilOne();
I know that I can import it like this:
import * as utils from "./Utils";
However, as I will be using utils a lot, I would like to be able to export utils in a namespace, something like:
export {* as utils} from './Utils'; // this doesn't work
and then use:
import * from "./Utils";
However the export {* as utils} doesn't work. I could put all the functions of Utils to a module "utils" and export it, but I am not sure if this is a good practice. Is there a proper way to do this?