// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java
// public class Module {
// 
// 	private String name;
// 
// 	private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>();
// 
// 	private Map<String, AbstractType> vars = new HashMap<String, AbstractType>();
// 
// 	public Module() {
// 	}
// 
// 	public Module(String name) {
// 		this.name = name;
// 	}
// 
// 	public Map<String, AbstractNamedType> getNamedTypes() {
// 		return namedTypes;
// 	}
// 
// 	public Map<String, AbstractType> getVars() {
// 		return vars;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void write(Writer writer) throws IOException {
// 		new InternalModuleFormatWriter().write(this, writer);
// 	}
// 
// }
// 
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java
// abstract public class AbstractNamedType extends AbstractType {
// 
// 	protected final String name;
// 
// 	public AbstractNamedType(String className) {
// 		this.name = className;
// 	}
// 
// 	@Override
// 	public void write(Writer writer) throws IOException {
// 		writer.write(name);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void writeDef(Writer writer, WriterPreferences preferences) throws IOException {
// 		if(!preferences.hasCustomWriter(this)) {
// 			writeDefInternal(writer, preferences);
// 		} else {
// 			preferences.writeDef(this, writer);
// 		}
// 	}
// 
// 	abstract public void writeDefInternal(Writer writer, WriterPreferences preferences) throws IOException;
// }


import java.io.IOException;
import java.io.Writer;
import java.util.Collection;
import java.util.Map.Entry;
import java2typescript.jackson.module.grammar.EnumType;
import java2typescript.jackson.module.grammar.Module;
import java2typescript.jackson.module.grammar.base.AbstractNamedType;
import java2typescript.jackson.module.grammar.base.AbstractType;
package java2typescript.jackson.module.writer;



/**
 * Generates TypeScript type definitions for given module in external module format
 */
public class ExternalModuleFormatWriter implements ModuleWriter {

	public WriterPreferences preferences = new WriterPreferences();

	@Override
	public void write(Module module, Writer writer) throws IOException {
		writeModuleContent(module, writer);
		writer.flush();
	}

	protected void writeModuleContent(Module module, Writer writer) throws IOException {
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java
// public class Module {
// 
// 	private String name;
// 
// 	private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>();
// 
// 	private Map<String, AbstractType> vars = new HashMap<String, AbstractType>();
// 
// 	public Module() {
// 	}
// 
// 	public Module(String name) {
// 		this.name = name;
// 	}
// 
// 	public Map<String, AbstractNamedType> getNamedTypes() {
// 		return namedTypes;
// 	}
// 
// 	public Map<String, AbstractType> getVars() {
// 		return vars;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void write(Writer writer) throws IOException {
// 		new InternalModuleFormatWriter().write(this, writer);
// 	}
// 
// }
// 
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java
// abstract public class AbstractNamedType extends AbstractType {
// 
// 	protected final String name;
// 
// 	public AbstractNamedType(String className) {
// 		this.name = className;
// 	}
// 
// 	@Override
// 	public void write(Writer writer) throws IOException {
// 		writer.write(name);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void writeDef(Writer writer, WriterPreferences preferences) throws IOException {
// 		if(!preferences.hasCustomWriter(this)) {
// 			writeDefInternal(writer, preferences);
// 		} else {
// 			preferences.writeDef(this, writer);
// 		}
// 	}
// 
// 	abstract public void writeDefInternal(Writer writer, WriterPreferences preferences) throws IOException;
// }


// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/ExternalModuleFormatWriter.java
import java.io.IOException;
import java.io.Writer;
import java.util.Collection;
import java.util.Map.Entry;
import java2typescript.jackson.module.grammar.EnumType;
import java2typescript.jackson.module.grammar.Module;
import java2typescript.jackson.module.grammar.base.AbstractNamedType;
import java2typescript.jackson.module.grammar.base.AbstractType;

package java2typescript.jackson.module.writer;



/**
 * Generates TypeScript type definitions for given module in external module format
 */
public class ExternalModuleFormatWriter implements ModuleWriter {

	public WriterPreferences preferences = new WriterPreferences();

	@Override
	public void write(Module module, Writer writer) throws IOException {
		writeModuleContent(module, writer);
		writer.flush();
	}

	protected void writeModuleContent(Module module, Writer writer) throws IOException {
		Collection<AbstractNamedType> namedTypes = module.getNamedTypes().values();