Skip to content

Commit 765abaf

Browse files
authored
Automatic definition updates (#8)
* Added script to automatically update definitions * Updated meta files * Updated meta files * Added stylua
1 parent 98f7684 commit 765abaf

File tree

12 files changed

+84
-58
lines changed

12 files changed

+84
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lua-language-server

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# LÖVE Definitions
2+
3+
Definitions for the LÖVE 2D game framework, generated from
4+
[love-api](https://github.com/love2d-community/love-api) using
5+
[LLSs meta build script](https://github.com/LuaLS/lua-language-server/blob/master/tools/build-3rd-meta.lua)
6+
7+
## Usage
8+
9+
Run [`update.sh`](update.sh) to update, commit, and push changes.

library/love/audio.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ love.audio = {}
1515
---
1616
---[Open in Browser](https://love2d.org/wiki/love.audio.getActiveEffects)
1717
---
18-
---@return table effects # The list of the names of the currently enabled effects.
18+
---@return string[] effects # The list of the names of the currently enabled effects.
1919
function love.audio.getActiveEffects() end
2020

2121
---
@@ -79,12 +79,12 @@ function love.audio.getMaxSourceEffects() end
7979
---
8080
---[Open in Browser](https://love2d.org/wiki/love.audio.getOrientation)
8181
---
82-
---@return number fx # Forward vector of the listener orientation.
83-
---@return number fy # Forward vector of the listener orientation.
84-
---@return number fz # Forward vector of the listener orientation.
85-
---@return number ux # Up vector of the listener orientation.
86-
---@return number uy # Up vector of the listener orientation.
87-
---@return number uz # Up vector of the listener orientation.
82+
---@return number fx # Forward x of the listener orientation.
83+
---@return number fy # Forward y of the listener orientation.
84+
---@return number fz # Forward z of the listener orientation.
85+
---@return number ux # Up x of the listener orientation.
86+
---@return number uy # Up y of the listener orientation.
87+
---@return number uz # Up z of the listener orientation.
8888
function love.audio.getOrientation() end
8989

9090
---
@@ -108,7 +108,7 @@ function love.audio.getPosition() end
108108
---
109109
---[Open in Browser](https://love2d.org/wiki/love.audio.getRecordingDevices)
110110
---
111-
---@return table devices # The list of connected recording devices.
111+
---@return love.RecordingDevice[] devices # The list of connected recording devices.
112112
function love.audio.getRecordingDevices() end
113113

114114
---
@@ -178,7 +178,7 @@ function love.audio.newSource(filename, type) end
178178
---
179179
---@overload fun(source: love.Source, ...)
180180
---@overload fun(sources: table)
181-
---@return table Sources # A table containing a list of Sources that were paused by this call.
181+
---@return love.Source[] Sources # A table containing a list of Sources that were paused by this call.
182182
function love.audio.pause() end
183183

184184
---
@@ -416,7 +416,7 @@ function Source:clone() end
416416
---
417417
---[Open in Browser](https://love2d.org/wiki/Source:getActiveEffects)
418418
---
419-
---@return table effects # A list of the source's active effect names.
419+
---@return string[] effects # A list of the source's active effect names.
420420
function Source:getActiveEffects() end
421421

422422
---

library/love/filesystem.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function love.filesystem.getCRequirePath() end
7676
---
7777
---@overload fun(dir: string, callback: function):table
7878
---@param dir string # The directory.
79-
---@return table files # A sequence with the names of all files and subdirectories as strings.
79+
---@return string[] files # A sequence with the names of all files and subdirectories as strings.
8080
function love.filesystem.getDirectoryItems(dir) end
8181

8282
---

library/love/graphics.lua

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,12 @@ function love.graphics.present() end
945945
---
946946
---[Open in Browser](https://love2d.org/wiki/love.graphics.print)
947947
---
948-
---@overload fun(text: string, transform: love.Transform)
949-
---@overload fun(text: string, font: love.Font, transform: love.Transform)
950-
---@overload fun(text: number, transform: love.Transform)
951-
---@overload fun(test: number, font: love.Font, transform: love.Transform)
952948
---@overload fun(coloredtext: table, x?: number, y?: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
949+
---@overload fun(text: string, transform: love.Transform)
953950
---@overload fun(coloredtext: table, transform: love.Transform)
951+
---@overload fun(text: string, font: love.Font, transform: love.Transform)
954952
---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform)
955-
---@param text string|number # The text to draw.
953+
---@param text string # The text to draw.
956954
---@param x? number # The position to draw the object (x-axis).
957955
---@param y? number # The position to draw the object (y-axis).
958956
---@param r? number # Orientation (radians).
@@ -981,14 +979,11 @@ function love.graphics.print(text, x, y, r, sx, sy, ox, oy, kx, ky) end
981979
---@overload fun(text: string, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
982980
---@overload fun(text: string, transform: love.Transform, limit: number, align?: love.AlignMode)
983981
---@overload fun(text: string, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
984-
---@overload fun(text: number, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
985-
---@overload fun(text: number, transform: love.Transform, limit: number, align?: love.AlignMode)
986-
---@overload fun(text: number, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
987982
---@overload fun(coloredtext: table, x: number, y: number, limit: number, align: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
988983
---@overload fun(coloredtext: table, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
989984
---@overload fun(coloredtext: table, transform: love.Transform, limit: number, align?: love.AlignMode)
990985
---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
991-
---@param text string|number # A text string.
986+
---@param text string # A text string.
992987
---@param x number # The position on the x-axis.
993988
---@param y number # The position on the y-axis.
994989
---@param limit number # Wrap the line after this many horizontal pixels.
@@ -1443,7 +1438,8 @@ function Canvas:newImageData() end
14431438
---[Open in Browser](https://love2d.org/wiki/Canvas:renderTo)
14441439
---
14451440
---@param func function # A function performing drawing operations.
1446-
function Canvas:renderTo(func) end
1441+
---@vararg any # Additional arguments to call the function with.
1442+
function Canvas:renderTo(func, ...) end
14471443

14481444
---
14491445
---Superclass for all things that can be drawn on screen. This is an abstract type that can't be created directly.
@@ -1562,7 +1558,7 @@ function Font:getLineHeight() end
15621558
---
15631559
---[Open in Browser](https://love2d.org/wiki/Font:getWidth)
15641560
---
1565-
---@param text string|number # A string or number.
1561+
---@param text string # A string.
15661562
---@return number width # The width of the text.
15671563
function Font:getWidth(text) end
15681564

@@ -1577,7 +1573,7 @@ function Font:getWidth(text) end
15771573
---@param text string # The text that will be wrapped.
15781574
---@param wraplimit number # The maximum width in pixels of each line that ''text'' is allowed before wrapping.
15791575
---@return number width # The maximum width of the wrapped text.
1580-
---@return table wrappedtext # A sequence containing each line of text that was wrapped.
1576+
---@return string[] wrappedtext # A sequence containing each line of text that was wrapped.
15811577
function Font:getWrap(text, wraplimit) end
15821578

15831579
---
@@ -1792,7 +1788,7 @@ function Mesh:getVertexFormat() end
17921788
---
17931789
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertexMap)
17941790
---
1795-
---@return table map # A table containing the list of vertex indices used when drawing.
1791+
---@return number[] map # A table containing the list of vertex indices used when drawing.
17961792
function Mesh:getVertexMap() end
17971793

17981794
---
@@ -2082,7 +2078,7 @@ function ParticleSystem:getPosition() end
20822078
---
20832079
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getQuads)
20842080
---
2085-
---@return table quads # A table containing the Quads used.
2081+
---@return love.Quad[] quads # A table containing the Quads used.
20862082
function ParticleSystem:getQuads() end
20872083

20882084
---
@@ -2264,20 +2260,13 @@ function ParticleSystem:setBufferSize(size) end
22642260
---
22652261
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setColors)
22662262
---
2267-
---@overload fun(self: love.ParticleSystem, rgba1: table, rgba2: table, rgba8: table)
2263+
---@overload fun(self: love.ParticleSystem, rgba1: table, ...)
22682264
---@param r1 number # First color, red component (0-1).
22692265
---@param g1 number # First color, green component (0-1).
22702266
---@param b1 number # First color, blue component (0-1).
22712267
---@param a1? number # First color, alpha component (0-1).
2272-
---@param r2? number # Second color, red component (0-1).
2273-
---@param g2? number # Second color, green component (0-1).
2274-
---@param b2? number # Second color, blue component (0-1).
2275-
---@param a2? number # Second color, alpha component (0-1).
2276-
---@param r8? number # Eighth color, red component (0-1).
2277-
---@param g8? number # Eighth color, green component (0-1).
2278-
---@param b8? number # Eighth color, blue component (0-1).
2279-
---@param a8? number # Eighth color, alpha component (0-1).
2280-
function ParticleSystem:setColors(r1, g1, b1, a1, r2, g2, b2, a2, r8, g8, b8, a8) end
2268+
---@vararg number # Additional colors.
2269+
function ParticleSystem:setColors(r1, g1, b1, a1, ...) end
22812270

22822271
---
22832272
---Sets the direction the particles will be emitted in.
@@ -2392,8 +2381,8 @@ function ParticleSystem:setPosition(x, y) end
23922381
---
23932382
---@overload fun(self: love.ParticleSystem, quads: table)
23942383
---@param quad1 love.Quad # The first Quad to use.
2395-
---@param quad2 love.Quad # The second Quad to use.
2396-
function ParticleSystem:setQuads(quad1, quad2) end
2384+
---@vararg love.Quad # Additional Quads to use.
2385+
function ParticleSystem:setQuads(quad1, ...) end
23972386

23982387
---
23992388
---Set the radial acceleration (away from the emitter).
@@ -2571,8 +2560,8 @@ function Quad:getViewport() end
25712560
---@param y number # The top-left corner along the y-axis.
25722561
---@param w number # The width of the viewport.
25732562
---@param h number # The height of the viewport.
2574-
---@param sw number # The reference width, the width of the Image. (Must be greater than 0.)
2575-
---@param sh number # The reference height, the height of the Image. (Must be greater than 0.)
2563+
---@param sw? number # Optional new reference width, the width of the Texture. Must be greater than 0 if set.
2564+
---@param sh? number # Optional new reference height, the height of the Texture. Must be greater than 0 if set.
25762565
function Quad:setViewport(x, y, w, h, sw, sh) end
25772566

25782567
---
@@ -2663,8 +2652,8 @@ function Shader:send(name, number, ...) end
26632652
---[Open in Browser](https://love2d.org/wiki/Shader:sendColor)
26642653
---
26652654
---@param name string # The name of the color extern variable to send to in the shader.
2666-
---@param color table # A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
2667-
---@vararg table # Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).
2655+
---@param color number[] # A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
2656+
---@vararg number[] # Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).
26682657
function Shader:sendColor(name, color, ...) end
26692658

26702659
---

library/love/joystick.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function love.joystick.getJoystickCount() end
3636
---
3737
---[Open in Browser](https://love2d.org/wiki/love.joystick.getJoysticks)
3838
---
39-
---@return table joysticks # The list of currently connected Joysticks.
39+
---@return love.Joystick[] joysticks # The list of currently connected Joysticks.
4040
function love.joystick.getJoysticks() end
4141

4242
---

library/love/math.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ function love.math.getRandomState() end
9292
---
9393
---[Open in Browser](https://love2d.org/wiki/love.math.isConvex)
9494
---
95-
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):boolean
96-
---@param vertices table # The vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
95+
---@overload fun(x1: number, y1: number, x2: number, y2: number, ...):boolean
96+
---@param vertices number[] # The vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
9797
---@return boolean convex # Whether the given polygon is convex.
9898
function love.math.isConvex(vertices) end
9999

@@ -127,8 +127,8 @@ function love.math.linearToGamma(lr, lg, lb) end
127127
---
128128
---[Open in Browser](https://love2d.org/wiki/love.math.newBezierCurve)
129129
---
130-
---@overload fun(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number):love.BezierCurve
131-
---@param vertices table # The vertices of the control polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
130+
---@overload fun(x1: number, y1: number, x2: number, y2: number, ...):love.BezierCurve
131+
---@param vertices number[] # The vertices of the control polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.
132132
---@return love.BezierCurve curve # A Bézier curve object.
133133
function love.math.newBezierCurve(vertices) end
134134

@@ -330,7 +330,7 @@ function BezierCurve:removeControlPoint(index) end
330330
---[Open in Browser](https://love2d.org/wiki/BezierCurve:render)
331331
---
332332
---@param depth? number # Number of recursive subdivision steps.
333-
---@return table coordinates # List of x,y-coordinate pairs of points on the curve.
333+
---@return number[] coordinates # List of x,y-coordinate pairs of points on the curve.
334334
function BezierCurve:render(depth) end
335335

336336
---
@@ -346,7 +346,7 @@ function BezierCurve:render(depth) end
346346
---@param startpoint number # The starting point along the curve. Must be between 0 and 1.
347347
---@param endpoint number # The end of the segment to render. Must be between 0 and 1.
348348
---@param depth? number # Number of recursive subdivision steps.
349-
---@return table coordinates # List of x,y-coordinate pairs of points on the specified part of the curve.
349+
---@return number[] coordinates # List of x,y-coordinate pairs of points on the specified part of the curve.
350350
function BezierCurve:renderSegment(startpoint, endpoint, depth) end
351351

352352
---

library/love/physics.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ function Body:getAngularVelocity() end
491491
---
492492
---[Open in Browser](https://love2d.org/wiki/Body:getContacts)
493493
---
494-
---@return table contacts # A list with all contacts associated with the Body.
494+
---@return love.Contact[] contacts # A list with all contacts associated with the Body.
495495
function Body:getContacts() end
496496

497497
---
@@ -500,7 +500,7 @@ function Body:getContacts() end
500500
---
501501
---[Open in Browser](https://love2d.org/wiki/Body:getFixtures)
502502
---
503-
---@return table fixtures # A sequence with all fixtures.
503+
---@return love.Fixture[] fixtures # A sequence with all fixtures.
504504
function Body:getFixtures() end
505505

506506
---
@@ -529,7 +529,7 @@ function Body:getInertia() end
529529
---
530530
---[Open in Browser](https://love2d.org/wiki/Body:getJoints)
531531
---
532-
---@return table joints # A sequence with the Joints attached to the Body.
532+
---@return love.Joint[] joints # A sequence with the Joints attached to the Body.
533533
function Body:getJoints() end
534534

535535
---
@@ -2989,7 +2989,7 @@ function World:destroy() end
29892989
---
29902990
---[Open in Browser](https://love2d.org/wiki/World:getBodies)
29912991
---
2992-
---@return table bodies # A sequence with all bodies.
2992+
---@return love.Body[] bodies # A sequence with all bodies.
29932993
function World:getBodies() end
29942994

29952995
---
@@ -3037,7 +3037,7 @@ function World:getContactFilter() end
30373037
---
30383038
---[Open in Browser](https://love2d.org/wiki/World:getContacts)
30393039
---
3040-
---@return table contacts # A sequence with all Contacts.
3040+
---@return love.Contact[] contacts # A sequence with all Contacts.
30413041
function World:getContacts() end
30423042

30433043
---
@@ -3065,7 +3065,7 @@ function World:getJointCount() end
30653065
---
30663066
---[Open in Browser](https://love2d.org/wiki/World:getJoints)
30673067
---
3068-
---@return table joints # A sequence with all joints.
3068+
---@return love.Joint[] joints # A sequence with all joints.
30693069
function World:getJoints() end
30703070

30713071
---

library/love/thread.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ function Channel:peek() end
118118
---[Open in Browser](https://love2d.org/wiki/Channel:performAtomic)
119119
---
120120
---@param func function # The function to call, the form of function(channel, arg1, arg2, ...) end. The Channel is passed as the first argument to the function when it is called.
121-
---@param arg1 any # Additional arguments that the given function will receive when it is called.
122121
---@vararg any # Additional arguments that the given function will receive when it is called.
123122
---@return any ret1 # The first return value of the given function (if any.)
124-
function Channel:performAtomic(func, arg1, ...) end
123+
function Channel:performAtomic(func, ...) end
125124

126125
---
127126
---Retrieves the value of a Channel message and removes it from the message queue.

library/love/touch.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ function love.touch.getPressure(id) end
3636
---
3737
---[Open in Browser](https://love2d.org/wiki/love.touch.getTouches)
3838
---
39-
---@return table touches # A list of active touch-press id values, which can be used with love.touch.getPosition.
39+
---@return lightuserdata[] touches # A list of active touch-press id values, which can be used with love.touch.getPosition.
4040
function love.touch.getTouches() end

0 commit comments

Comments
 (0)