class ServiceEmitter {

    public void emitTypescriptInterface() {
        Set<String> endpointsToWarnAboutDuplicateNames = Sets.newHashSet();
        if (!this.settings.emitDuplicateJavaMethodNames()) {
            endpointsToWarnAboutDuplicateNames = getDuplicateEndpointNames();
        }

        writer.writeLine("");
        writer.writeLine("export interface " + settings.getSettings().addTypeNamePrefix + model.name() + " {");
        writer.increaseIndent();

        for (InnerServiceModel innerServiceModel : model.innerServiceModels()) {
            if (model.innerServiceModels().size() > 1) {
                writer.writeLine("");
                writer.writeLine("// endpoints for service class: " + innerServiceModel.name());
            }

            for (ServiceEndpointModel endpointModel: innerServiceModel.endpointModels()) {
                if (!endpointsToWarnAboutDuplicateNames.contains(endpointModel.endpointName())) {
                    String line = endpointModel.endpointName() + "(";
                    line += getEndpointParametersString(endpointModel);
                    line += String.format("): " + settings.genericEndpointReturnType(), endpointModel.tsReturnType().toString()) + ";";
                    writer.writeLine(line);
                }
            }
        }
        if (!endpointsToWarnAboutDuplicateNames.isEmpty()) {
            writer.writeLine("");
        }
        for (String endpointName : endpointsToWarnAboutDuplicateNames) {
            writer.writeLine(String.format("// WARNING: not creating method declaration, java service has multiple methods with the name %s", endpointName));
        }

        writer.decreaseIndent();
        writer.writeLine("}");
    }

    public  ServiceEmitter(ServiceModel model, TypescriptServiceGeneratorConfiguration settings, IndentedOutputWriter writer);

}