-
-
Notifications
You must be signed in to change notification settings - Fork 412
Closed
Description
I see some type annotations using # and some not. Also even the wiki https://luals.github.io/wiki/annotations/ sometimes uses it and sometimes not. Is it good style? Is it more portable?
---@alias DeviceSide
---| '"left"' # The left side of the device
---| '"right"' # The right side of the device
---| '"top"' # The top side of the device
---| '"bottom"' # The bottom side of the device
---| '"front"' # The front side of the device
---| '"back"' # The back side of the device
---@param side DeviceSide
local function checkSide(side) end---
---Gets the current running version of LÖVE.
---
---
---[Open in Browser](https://love2d.org/wiki/love.getVersion)
---
---@return number major # The major version of LÖVE, i.e. 0 for version 0.9.1.
---@return number minor # The minor version of LÖVE, i.e. 9 for version 0.9.1.
---@return number revision # The revision version of LÖVE, i.e. 1 for version 0.9.1.
---@return string codename # The codename of the current version, i.e. 'Baby Inspector' for version 0.9.1.
function love.getVersion() endOr here one from the wiki without hashtags in the "Simple Documentation of a Class" example
---@class Person
---@field height number The height of this person in cm
---@field weight number The weight of this person in kg
---@field firstName string The first name of this person
---@field lastName? string The last name of this person
---@field age integer The age of this person
---@param person Person
local function hire(person) endI understand it starts the description. But I don't understand when its needed and if I should use it or not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels