Hello not sure if I missed the documentation or if it's not an available feature but I would like to have something like an import as feature for getting specific objects from a module, in TypeScript I can do:
import { SimpleTime as st } from './utils/SimpleTime';
// st is now the alias for the object pulled from the module which was previously named SimpleTime
I tried the alias argument in box but it just sets the results of the module to a variable name; I will try to illustrate with code:
Hello not sure if I missed the documentation or if it's not an available feature but I would like to have something like an
import as feature
for getting specific objects from a module, inTypeScript
I can do:I tried the alias argument in
box
but it just sets the results of themodule
to a variable name; I will try to illustrate with code:Module code:
Different imports and expected results:
Now I found this syntax to simplify it and import
SimpleTime
directly (I would like to do this but with an alias):Then I tried this:
My expected result is to be able to use it as such directly:
Is there a way to do this that I missed or could this be an added feature? If it doesn't exist may I suggest the syntax: