public void ObjectType(Action <TSObjectType> objectTypeAction) { SetCurrentState(State.TypeDeclaration); builder.Line("{"); builder.IncreaseIndent(); objectTypeAction?.Invoke(new TSObjectType(builder)); builder.DecreaseIndent(); builder.Text("}"); }
public void Property(string propertyName, Action <TSIntersectionType> intersectionTypeAction, bool optional = false) { SetCurrentState(State.PropertyDeclaration); builder.Text($"{propertyName}{(optional ? "?" : "")}: "); builder.IncreaseIndent(); intersectionTypeAction?.Invoke(new TSIntersectionType(builder)); builder.DecreaseIndent(); builder.Line(";"); }