public string GetTypeLocation(ITypeInfo type) { if (InternalApiTypeBuildingContext.Accept(type)) { return(InternalApiTypeBuildingContext.GetApiName(type)); } return(type.IsGenericType ? new Regex("`.*$").Replace(type.Name, "") : type.Name); }
public ITypeBuildingContext ResolveType(string initialUnitPath, ITypeGenerator typeGenerator, ITypeInfo type, ITypeScriptUnitFactory unitFactory) { if (type.Equals(TypeInfo.From <TimeGuid>())) { return(TypeBuilding.RedirectToType("TimeGuid", @"..\DataTypes\TimeGuid", type)); } if (type.Equals(TypeInfo.From <Timestamp>())) { return(TypeBuilding.RedirectToType("Timestamp", @"..\DataTypes\Timestamp", type)); } if (type.Equals(TypeInfo.From <TimestampRange>())) { return(TypeBuilding.RedirectToType("DateTimeRange", @"..\DataTypes\DateTimeRange", type)); } if (InternalApiTypeBuildingContext.Accept(type)) { return(new InternalApiTypeBuildingContext(unitFactory.GetOrCreateTypeUnit(initialUnitPath), type)); } return(null); }