Skip to content

Updated meta files#12

Open
farooqkz wants to merge 1 commit intoLuaCATS:mainfrom
farooqkz:main
Open

Updated meta files#12
farooqkz wants to merge 1 commit intoLuaCATS:mainfrom
farooqkz:main

Conversation

@farooqkz
Copy link
Copy Markdown

I don't think it needs much explaination. It was outdated :)

Copy link
Copy Markdown
Member

@carsakiller carsakiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for taking the time to contribute.

There are quite a few places where a more specific/informational type like string[] or love.RecordingDevices[] was replaced with just table, or similar. It would be best to keep the specific types as they are much more useful.

There were also a few changes that seem to disagree with the official documentation, but other than those, it is mainly small tweaks and typos.

Comment thread library/love/audio.lua
---[Open in Browser](https://love2d.org/wiki/love.audio.getActiveEffects)
---
---@return string[] effects # The list of the names of the currently enabled effects.
---@return table effects # The list of the names of the currently enabled effects.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the table returned not a string[]? The official documentation doesn't seem to offer any insight into the table's contents, but it seems from the description that it would be an "array" of strings.

Comment thread library/love/audio.lua
Comment on lines +82 to +87
---@return number fx # Forward vector of the listener orientation.
---@return number fy # Forward vector of the listener orientation.
---@return number fz # Forward vector of the listener orientation.
---@return number ux # Up vector of the listener orientation.
---@return number uy # Up vector of the listener orientation.
---@return number uz # Up vector of the listener orientation.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the current and incoming documentation contain useful information.

I think they should be combined.

Suggested change
---@return number fx # Forward vector of the listener orientation.
---@return number fy # Forward vector of the listener orientation.
---@return number fz # Forward vector of the listener orientation.
---@return number ux # Up vector of the listener orientation.
---@return number uy # Up vector of the listener orientation.
---@return number uz # Up vector of the listener orientation.
---@return number fx # Forward vector x component of the listener orientation.
---@return number fy # Forward vector y component of the listener orientation.
---@return number fz # Forward vector z component of the listener orientation.
---@return number ux # Up vector x component of the listener orientation.
---@return number uy # Up vector y component of the listener orientation.
---@return number uz # Up vector z component of the listener orientation.

Comment thread library/love/audio.lua
---[Open in Browser](https://love2d.org/wiki/love.audio.getRecordingDevices)
---
---@return love.RecordingDevice[] devices # The list of connected recording devices.
---@return table devices # The list of connected recording devices.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overwriting the love.RecordingDevice[] type with a less descriptive and helpful table type, effectively losing a bunch of helpful type information.

Comment thread library/love/audio.lua
---@overload fun(source: love.Source, ...)
---@overload fun(sources: table)
---@return love.Source[] Sources # A table containing a list of Sources that were paused by this call.
---@return table Sources # A table containing a list of Sources that were paused by this call.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread library/love/graphics.lua
---@overload fun(coloredtext: table, transform: love.Transform)
---@overload fun(text: string, font: love.Font, transform: love.Transform)
---@overload fun(text: number, transform: love.Transform)
---@overload fun(test: number, font: love.Font, transform: love.Transform)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little typo

Suggested change
---@overload fun(test: number, font: love.Font, transform: love.Transform)
---@overload fun(text: number, font: love.Font, transform: love.Transform)

Comment thread library/love/graphics.lua
Comment on lines +2395 to +2396
---@param quad2 love.Quad # The second Quad to use.
function ParticleSystem:setQuads(quad1, quad2) end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to require at least 2 args, but can be given more: https://www.love2d.org/wiki/ParticleSystem:setQuads

Suggested change
---@param quad2 love.Quad # The second Quad to use.
function ParticleSystem:setQuads(quad1, quad2) end
---@param quad2 love.Quad # The second Quad to use.
---@param ... love.Quad # Additional Quads
function ParticleSystem:setQuads(quad1, quad2, ...) end

Comment thread library/love/graphics.lua
Comment on lines +2574 to +2575
---@param sw number # The reference width, the width of the Image. (Must be greater than 0.)
---@param sh number # The reference height, the height of the Image. (Must be greater than 0.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the official documentation, the previous documentation seems correct, with sw and sh being optional.

Comment thread library/love/math.lua
---
---@overload fun(x1: number, y1: number, x2: number, y2: number, ...):boolean
---@param vertices number[] # The vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):boolean
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many more args are possible.

Suggested change
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):boolean
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, ...: number):boolean

Comment thread library/love/math.lua
---
---@overload fun(x1: number, y1: number, x2: number, y2: number, ...):love.BezierCurve
---@param vertices number[] # The vertices of the control polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):love.BezierCurve
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):love.BezierCurve
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, ...: number):love.BezierCurve

Comment thread library/love/thread.lua
Comment on lines +121 to +124
---@param arg1 any # Additional arguments that the given function will receive when it is called.
---@vararg any # Additional arguments that the given function will receive when it is called.
---@return any ret1 # The first return value of the given function (if any.)
function Channel:performAtomic(func, ...) end
function Channel:performAtomic(func, arg1, ...) end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional arguments are both numerous and optional so it would probably be best to do the following:

Suggested change
---@param arg1 any # Additional arguments that the given function will receive when it is called.
---@vararg any # Additional arguments that the given function will receive when it is called.
---@return any ret1 # The first return value of the given function (if any.)
function Channel:performAtomic(func, ...) end
function Channel:performAtomic(func, arg1, ...) end
---@param ... any # Additional arguments that the given function will
---@return any ret1 # The first return value of the given function (if any.)
function Channel:performAtomic(func, ...) end

@farooqkz
Copy link
Copy Markdown
Author

hmm sorry I didn't know I have to update the things by hand. I just ran update.sh. Have I done it wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants