コード例 #1
0
 public void ObjectType(Action <TSObjectType> objectTypeAction)
 {
     SetCurrentState(State.TypeDeclaration);
     builder.Line("{");
     builder.IncreaseIndent();
     objectTypeAction?.Invoke(new TSObjectType(builder));
     builder.DecreaseIndent();
     builder.Text("}");
 }
コード例 #2
0
 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(";");
 }