Typescript - Encapsulating module/classes so it's not accessible from the browser -


i'm looking way write typescript classes in way provide want provide browser (global scope), this:

mymodule.api

where api contain public functions executed browser, relaying on other functions written other classes within same module or sub-modules.

i need these classes use each other, wouldn't usable browser global scope, through api.

what's way go that? couldn't figure out how reuse classes other classes without exposing them browser directly using export keyword.

but wouldn't usable browser

if want transcend file boundaries need export file.

however if keep on single file don't need use export.

module mymodule.api{     var notexported = 0;     export function exported(){         return notexported + 1;     } } 

i point out when using external modules each file own module , not exported browser i.e. window : https://www.youtube.com/watch?v=kdrwlmuy0r0


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -