Implement constructors
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
---@diagnostic disable: missing-return
|
||||
{{range .Fields -}}
|
||||
---@field {{.Name}} {{.Type}} {{.Comment}}
|
||||
{{end}}
|
||||
{{end -}}
|
||||
{{range .Constructors -}}
|
||||
---@overload fun({{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param.Name}}: {{$param.Type}}{{end}}): {{$.ClassName}}
|
||||
{{end -}}
|
||||
---@class {{.ClassName}}
|
||||
{{.ClassName}} = {
|
||||
{{$n := len .Methods -}}
|
||||
{{$methods := len .Methods -}}
|
||||
@@ -19,5 +23,6 @@
|
||||
{{end}}{{end}}
|
||||
}
|
||||
|
||||
---@type ({{$.ClassName}} | fun(): {{$.ClassName}})
|
||||
---@type {{$.ClassName}}
|
||||
-- Define class globally so it's "available" to other files
|
||||
{{$.ClassName}} = nil
|
Reference in New Issue
Block a user