In below example, I want export merged class ConsoleCommandsParser
and namespace ConsoleCommandParserTypes
as ConsoleCommandsParser
. Easy, it both declared in one file, but here is other case.
import ConsoleCommandParserTypes from "./ConsoleCommandParserTypes";
export abstract class ConsoleCommandsParser {
public static parse(arrayedConsoleCommand: Array<string>): void {
// not implemented yet
}
}
// Invalid syntax
export namespace ConsoleCommandParserTypes as ConsoleCommandParser;
// Namespace can not be used as value
export ConsoleCommandParser = ConsoleCommandParserTypes
// Invalid syntax
export namespace ConsoleCommandParser = ConsoleCommandParserTypes;
Try the below code, I have tested it in my type script file
Let me know if this will not work for you.