File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
src/GraphODataTemplateWriter/CodeHelpers/TypeScript Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1010 var enumTypes = model.GetEnumTypes();
1111 var complexTypes = model.GetComplexTypes();
1212#>
13+ // Type definitions for the Microsoft Graph API
14+ // Project: https://github.com/microsoftgraph/msgraph-typescript-typings
15+ // Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph>
16+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
17+
1318<#= writer.WriteHeader() #>
14- declare namespace MicrosoftGraph {
1519
20+ declare module MicrosoftGraph {
1621<# foreach(var enumType in enumTypes) { #>
1722 type <#= writer.UpperCaseFirstChar(enumType.Name) #> = <#= enumType.GetEnumValues() #>
1823<# } #>
@@ -27,7 +32,7 @@ declare namespace MicrosoftGraph {
2732 <#= prop.Name #>?: <#= prop.GetTypeString() #>
2833<# } #>
2934 }
30- <#
35+ <#
3136 }
3237#>
3338<#
@@ -43,6 +48,6 @@ declare namespace MicrosoftGraph {
4348<# } #>
4449}
4550
46- declare module "msgraph " {
51+ declare module "MicrosoftGraph " {
4752 export = MicrosoftGraph;
4853}
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ public CodeWriterTypeScript(OdcmModel model) : base(model) { }
1313
1414 public override String WriteOpeningCommentLine ( )
1515 {
16- return "/**************************************************************************** " + this . NewLineCharacter ;
16+ return "// " + this . NewLineCharacter ;
1717 }
1818
1919 public override String WriteClosingCommentLine ( )
2020 {
21- return "***************************************************************************** /" + this . NewLineCharacter ;
21+ return "/ /" + this . NewLineCharacter ;
2222 }
2323
2424 public override string WriteInlineCommentChar ( )
Original file line number Diff line number Diff line change @@ -45,8 +45,10 @@ public static string GetTypeString(this OdcmProperty prop)
4545 case "String" :
4646 typeStr = "string" ; //lowercase
4747 break ;
48- case "DateTimeOffset" :
49- typeStr = "Date" ;
48+ // all dates need to be of type string so they can be wrapped in new Date(___)
49+ case "DateTimeOffset" : // ISO 8601 format in UTC time, ex 2014-01-01T00:00:00Z
50+ case "Date" :
51+ typeStr = "string" ;
5052 break ;
5153 case "Boolean" :
5254 typeStr = "boolean" ;
You can’t perform that action at this time.
0 commit comments