Export Type Definition


#1

Does someone have a way/snippet to export one or more C3 types in a CSV like structure (type name, field name, field type)


#2

The following should work.

var typ = c3Type("<typeName>");
var columnAry = [];

_.each(typ.fieldTypes(), function(ft) { 
  if (!ft.valueType().isMethod())  {
    valueType = ft.valueType().toString();

    if (valueType !== null) 
      columnAry.push({"type":typ.typeName(),"fieldName":ft.name(), "fieldType":valueType });

  }
})

c3CSV(columnAry);

#3

Here is a reference link.