mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
62374b9b53
* WIP * Generation of index.js * Add RelativeToCwd * Add JSDoc comments * Convert to ES6 syntax * Fix typo * Initial generation of typescript declarations * Typescript improvements * Improved @returns jsdoc * Improved declaration files * Simplified output * Rename file * Tidy up * Revert "Simplified output" This reverts commit 15cdf7382b21a15a36616adbca13c9b034a1907b. * Now parsing actual code * Support Array types * Reimagined parser * Wrap parsing in Parser * Rewritten module generator (TS Only) * Final touches * Slight refactor to improve output * Struct comments. External struct literal binding * Reworked project parser *working* * remove debug info * Refactor of parser * remove the spew * Better Ts support * Better project generation logic * Support local functions in bind() * JS Object generation. Linting. * Support json tags in module generation * Updated mod files * Support vscode file generation * Better global.d.ts * add ts-check to templates * Support TS declaration files * improved 'generate' command for module
43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
// @ts-check
|
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
// This file is automatically generated. DO NOT EDIT
|
|
|
|
{{- range .Structs}}
|
|
{{- if .IsBound}}
|
|
export namespace {{.Name}} {
|
|
{{- range .Methods}}
|
|
{{- if .Comments }}
|
|
{{range .Comments}}
|
|
// {{ . }}{{end}}
|
|
{{- end}}
|
|
function {{.Name}}({{.InputsAsTSText $.Name}}): Promise<{{.OutputsAsTSDeclarationText $.Name}}>;
|
|
{{- end}}
|
|
}
|
|
{{- end}}
|
|
{{- if .IsUsedAsData}}
|
|
{{if .Comments }}
|
|
/**
|
|
{{range .Comments}} *{{ . }}{{end}}
|
|
*/
|
|
export type {{.Name}} = {
|
|
{{- range .Fields}}
|
|
{{- if not .Ignored}}
|
|
{{- if .Comments }}{{range .Comments}}
|
|
//{{ . }}{{end}}{{- end}}
|
|
{{ .AsTSDeclaration $.Name}}; {{- end}}
|
|
{{- end}}
|
|
};
|
|
|
|
/**
|
|
{{if .Comments }}{{range .Comments}} *{{ . }}{{end}}{{end}}
|
|
* @typedef {object} {{.Name}}
|
|
{{- range .Fields}}{{- if not .JSONOptions.Ignored }}
|
|
* @property {{"{"}}{{.TypeForPropertyDoc}}{{"}"}} {{.NameForPropertyDoc}} {{- if .Comments}} - {{- range .Comments}}{{ . }}{{- end}}{{- end}}{{- end}}
|
|
{{- end}}
|
|
*/
|
|
export var {{.Name}}: any;
|
|
|
|
{{- end}}
|
|
{{- end}}
|
|
{{- end}}
|