1414 var maxLineLength = 180;
1515#>
1616// Type definitions for non-npm package microsoft-graph <VERSION_STRING>
17+ // Project: https://github.com/microsoftgraph/msgraph-typescript-typings
1718// Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph>
1819// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
1920// TypeScript Version: 2.1
2021
2122export as namespace microsoftgraph;
2223
2324<#
24- foreach(var enumType in enumTypes) {
25+ foreach(var enumType in enumTypes) {
26+ var enumTypeName = enumType.Name.UpperCaseFirstChar();
27+ var enumValues = enumType.GetEnumValues();
28+ var exportTypeLength = "export type".Length + enumTypeName.Length + enumValues.Length + 3;
29+ if (exportTypeLength < maxLineLength) {
2530#>
26- export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValues() #>;
31+ export type <#= enumTypeName #> = <#= enumValues #>;
2732<#
33+ } else {
34+ #>
35+ export type <#= enumTypeName #> =<#
36+ var enums = enumValues.Split('|');
37+ for(var i = 0; i < enums.Length; i++) {
38+ #>
39+
40+ | <#= enums[i].Trim() #><#
41+ }
42+ #>;
43+ <#
44+ }
2845 }
2946
3047 foreach(var entityType in entityTypes) {
3148 var propCount = entityType.Properties.ToList().Count;
32- if(propCount == 0) {
49+ var entityTypeName = entityType.Name.UpperCaseFirstChar();
50+ if(propCount == 0 && entityTypeName[0] == 'I') {
51+ #>
52+ // tslint:disable-next-line: interface-name no-empty-interface
53+ <#
54+ } else if (entityTypeName[0] == 'I') {
55+ #>
56+ // tslint:disable-next-line: interface-name
57+ <#
58+ } else if(propCount == 0) {
3359#>
3460// tslint:disable-next-line: no-empty-interface
3561<#
3662 }
3763#>
38- export interface <#= entityType.Name.UpperCaseFirstChar() #><#
64+ export interface <#= entityTypeName #><#
3965 if (entityType.Base != null) {
4066#>
4167 extends <#= entityType.Base.Name.UpperCaseFirstChar() #><#
4268 }
4369#> {<#
4470 if(propCount == 0){
45- #>}<#
71+ #>}
72+ <#
4673 } else {
4774#>
4875
4976<#
5077 foreach(var prop in entityType.Properties.ToList()) {
5178 if (prop.LongDescription != null || prop.Description != null) {
52- List<string> multiLineDescriptions = Utils.splitString(prop.GetSanitizedLongDescription(), maxLineLength);
79+ List<string> multiLineDescriptions = Utils.splitString(prop.GetSanitizedLongDescription(), maxLineLength);
80+ if(multiLineDescriptions.Count() == 1) {
81+ #>
82+ // <#= multiLineDescriptions.First() #>
83+ <#
84+ } else {
5385#>
5486 /**
5587<#
56- foreach(var descriptionLine in multiLineDescriptions) {
88+ foreach(var descriptionLine in multiLineDescriptions) {
5789#>
5890 * <#= descriptionLine #>
5991<#
60- }
92+ }
6193#>
6294 */
6395<#
96+ }
6497 }
6598#>
6699 <#= prop.Name #>?: <#= prop.GetTypeString() #>;
@@ -73,39 +106,55 @@ export interface <#= entityType.Name.UpperCaseFirstChar() #><#
73106 }
74107
75108 foreach(var complexType in complexTypes) {
76- var propCount = complexType.Properties.Count;
77- if(propCount == 0) {
109+ var propCount = complexType.Properties.ToList().Count;
110+ var complexTypeName = complexType.Name.UpperCaseFirstChar();
111+ if(propCount == 0 && complexTypeName[0] == 'I') {
112+ #>
113+ // tslint:disable-next-line: interface-name no-empty-interface
114+ <#
115+ } else if (complexTypeName[0] == 'I') {
116+ #>
117+ // tslint:disable-next-line: interface-name
118+ <#
119+ } else if(propCount == 0) {
78120#>
79121// tslint:disable-next-line: no-empty-interface
80122<#
81123 }
82124#>
83- export interface <#= complexType.Name.UpperCaseFirstChar() #><#
125+ export interface <#= complexTypeName #><#
84126 if (complexType.Base != null) {
85127#>
86128 extends <#= complexType.Base.Name.UpperCaseFirstChar() #><#
87129 }
88130#> {<#
89131 if(propCount == 0){
90- #>}<#
132+ #>}
133+ <#
91134 } else {
92135#>
93136
94137<#
95138 foreach(var prop in complexType.Properties) {
96139 if (prop.LongDescription != null || prop.Description != null) {
97- List<string> multiLineDescriptions = Utils.splitString(prop.GetSanitizedLongDescription(), maxLineLength);
140+ List<string> multiLineDescriptions = Utils.splitString(prop.GetSanitizedLongDescription(), maxLineLength);
141+ if(multiLineDescriptions.Count() == 1) {
142+ #>
143+ // <#= multiLineDescriptions.First() #>
144+ <#
145+ } else {
98146#>
99147 /**
100148<#
101- foreach(var descriptionLine in multiLineDescriptions) {
149+ foreach(var descriptionLine in multiLineDescriptions) {
102150#>
103151 * <#= descriptionLine #>
104152<#
105- }
153+ }
106154#>
107155 */
108156<#
157+ }
109158 }
110159#>
111160 <#= prop.Name #>?: <#= prop.GetTypeString() #>;
0 commit comments