Overview
@return declares the type or types a function returns. Lua functions can return multiple values, so add one @return line for each return value.
Syntax
Basic usage
Multiple return values
Optional return values
? shorthand:
Default return values
You can specify a default value for a return type using the=value syntax:
Generic return values
Return from string-template generic capture
`T` for string-literal class names. Plain T captures value type (string), not class type.
Quick rule:
Treturns value-based types ("x"->string)`T`returns class/type names from string literals ("sent_npc"->sent_npc)
Function return values
(instance) modifier
This annotation is for internal use. Most projects do not need this modifier.
(instance), GLuaLS keeps fields and methods on that returned variable. It does not add them to the global class:
(definition) modifier
This annotation is for internal use. Most projects do not need this modifier.
(definition), GLuaLS registers fields on the returned variable as global class fields: