Support json tags in module generation

This commit is contained in:
Lea Anthony
2020-11-11 17:31:26 +11:00
parent 6d3f4c06f1
commit 75d1fa51a2
5 changed files with 179 additions and 19 deletions

View File

@@ -1,24 +1,27 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
{{- if .DeclarationReferences }}
{{range .DeclarationReferences}}
const {{.}} = require('./_{{.}}');{{end}}{{- end}}
{{- range $struct := .Structs }}
{{- if .IsUsedAsData }}
/**
{{if .Comments }}{{range .Comments}} *{{ . }}{{end}}{{end}}
* @typedef {object} {{.Name}}
{{range .Fields}} * @property {{"{"}}{{.JSType}}{{"}"}} {{.Name}}
{{- if .Comments}} - {{- range .Comments}}{{ . }}{{- end}}{{- end}}
{{end}} *
*/
export const {{.Name}} = {
{{- range .Fields}}
{{.Name}},
{{- range .Fields}}{{- if not .JSONOptions.Ignored }}
* @property {{"{"}}{{.TypeForPropertyDoc}}{{"}"}} {{.NameForPropertyDoc}} {{- if .Comments}} - {{- range .Comments}}{{ . }}{{- end}}{{- end}}{{- end}}
{{- end}}
}
*/
export var {{.Name}};
{{- end}}
{{- if .IsBound }}
{{if .Methods }}
{{- if .Methods }}
{{if .Comments }}{{range .Comments}}// {{ . }}{{end}}{{end}}
export const {{.Name}} = {
{{range .Methods }}
@@ -35,9 +38,7 @@ export const {{.Name}} = {
},
{{end}}
}
{{end}}
{{- end}}
{{- end}}
{{- end}}