I'm playing around with TypeScript and export/import.
I simply want to have a file-structure like in C#. I want to nest a helper-class whic only contains some constant string-properties. This is what the file ~/Scripts/Helper/UrlHelper.ts looks like:
module Helper.UrlHelper {
abstract class Controller {
protected static readonly controllerName: string;
}
export abstract class Account extends Controller {
static controllerName: string = "Account";
static readonly loginGet: string = [Account.controllerName, "Login"].join("/");
static readonly loginPost: string = [Account.controllerName, "Login"].join("/");
}
}
My goal is to use the values e.g. Helper.UrlHelper.Account.loginPost. But I don't get the import/export to work.
My last try was to add export * from "./Helper/UrlHelper" and use the import import {Account} from "../Helper/UrlHelper";
This leads to the error:
Module '".../Scripts/Helper/UrlHelper"' has no exported member 'Account'
I tried nearly everything from here, but nothing worked. What am I doing wrong?