@import { ConstructorModel } from "../types";
@import { makeFieldInputLine, makeFieldInput } from "../makeFieldInputLine";
@define constructor(type: ConstructorModel)

// constructor for @type.name
@{const inputLine = makeFieldInputLine(type.fields);}
@if(inputLine.length + (type.constructorName.length * 2)  < 110){
export function @(type.constructorName)(@inputLine): @type.name {
} else {
export function @(type.constructorName)(
  @for(let field of type.fields){
  @makeFieldInput(field),
  }
  ): @type.name {
}
  return {
  @for(let field of type.fields){
    @field.name,
  }
  };
}
