2
0
Эх сурвалжийг харах

Type info for function arguments/returns;

bjorn 7 жил өмнө
parent
commit
7017e8bd24

+ 75 - 8
api/init.lua

@@ -3880,7 +3880,9 @@ return {
                 {
                   name = "iterator",
                   type = "function",
-                  description = "The iterator function, usable in a for loop."
+                  description = "The iterator function, usable in a for loop.",
+                  arguments = {},
+                  returns = {}
                 }
               }
             }
@@ -4392,7 +4394,19 @@ return {
                 {
                   name = "chunk",
                   type = "function",
-                  description = "The runnable chunk."
+                  description = "The runnable chunk.",
+                  arguments = {
+                    {
+                      name = "...",
+                      type = "*"
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "...",
+                      type = "*"
+                    }
+                  }
                 }
               }
             }
@@ -8744,7 +8758,9 @@ return {
                 {
                   name = "callback",
                   type = "function",
-                  description = "The function that will be called to render to the stencil buffer."
+                  description = "The function that will be called to render to the stencil buffer.",
+                  arguments = {},
+                  returns = {}
                 },
                 {
                   name = "action",
@@ -8772,7 +8788,9 @@ return {
                 {
                   name = "callback",
                   type = "function",
-                  description = "The function that will be called to render to the stencil buffer."
+                  description = "The function that will be called to render to the stencil buffer.",
+                  arguments = {},
+                  returns = {}
                 },
                 {
                   name = "action",
@@ -9708,7 +9726,14 @@ return {
                     {
                       name = "callback",
                       type = "function",
-                      description = "The function to use to render to the Canvas."
+                      description = "The function to use to render to the Canvas.",
+                      arguments = {
+                        {
+                          name = "...",
+                          type = "*"
+                        }
+                      },
+                      returns = {}
                     },
                     {
                       name = "...",
@@ -12430,7 +12455,9 @@ return {
                 {
                   name = "callback",
                   type = "function",
-                  description = "The function used to render.  Any functions called will render to the headset instead of to the window."
+                  description = "The function used to render.  Any functions called will render to the headset instead of to the window.",
+                  arguments = {},
+                  returns = {}
                 }
               },
               returns = {}
@@ -18522,7 +18549,9 @@ return {
                     {
                       name = "iterator",
                       type = "function",
-                      description = "A Lua iterator, usable in a for loop."
+                      description = "A Lua iterator, usable in a for loop.",
+                      arguments = {},
+                      returns = {}
                     }
                   }
                 }
@@ -18582,7 +18611,38 @@ return {
                     {
                       name = "callback",
                       type = "function",
-                      description = "The function to call when an intersection is detected."
+                      description = "The function to call when an intersection is detected.",
+                      arguments = {
+                        {
+                          name = "shape",
+                          type = "Shape"
+                        },
+                        {
+                          name = "x",
+                          type = "number"
+                        },
+                        {
+                          name = "y",
+                          type = "number"
+                        },
+                        {
+                          name = "z",
+                          type = "number"
+                        },
+                        {
+                          name = "nx",
+                          type = "number"
+                        },
+                        {
+                          name = "ny",
+                          type = "number"
+                        },
+                        {
+                          name = "nz",
+                          type = "number"
+                        }
+                      },
+                      returns = {}
                     }
                   },
                   returns = {}
@@ -18720,6 +18780,13 @@ return {
                       name = "resolver",
                       type = "function",
                       description = "The collision resolver function to use.  This will be called before updating to allow for custom collision processing.  If absent, a default will be used.",
+                      arguments = {
+                        {
+                          name = "world",
+                          type = "World"
+                        }
+                      },
+                      returns = {},
                       default = "nil"
                     }
                   },

+ 2 - 0
api/lovr/event/poll.lua

@@ -10,6 +10,8 @@ return {
     {
       name = 'iterator',
       type = 'function',
+      arguments = {},
+      returns = {},
       description = 'The iterator function, usable in a for loop.'
     }
   }

+ 12 - 0
api/lovr/filesystem/load.lua

@@ -12,6 +12,18 @@ return {
     {
       name = 'chunk',
       type = 'function',
+      arguments = {
+        {
+          name = '...',
+          type = '*'
+        }
+      },
+      returns = {
+        {
+          name = '...',
+          type = '*'
+        }
+      },
       description = 'The runnable chunk.'
     }
   },

+ 7 - 0
api/lovr/graphics/Canvas/renderTo.lua

@@ -9,6 +9,13 @@ return {
     {
       name = 'callback',
       type = 'function',
+      arguments = {
+        {
+          name = '...',
+          type = '*'
+        }
+      },
+      returns = {},
       description = 'The function to use to render to the Canvas.'
     },
     {

+ 2 - 0
api/lovr/graphics/stencil.lua

@@ -5,6 +5,8 @@ return {
   arguments = {
     callback = {
       type = 'function',
+      arguments = {},
+      returns = {},
       description = 'The function that will be called to render to the stencil buffer.'
     },
     action = {

+ 2 - 0
api/lovr/headset/renderTo.lua

@@ -15,6 +15,8 @@ return {
     {
       name = 'callback',
       type = 'function',
+      arguments = {},
+      returns = {},
       description = [[
         The function used to render.  Any functions called will render to the headset instead of to
         the window.

+ 2 - 0
api/lovr/physics/World/overlaps.lua

@@ -11,6 +11,8 @@ return {
     {
       name = 'iterator',
       type = 'function',
+      arguments = {},
+      returns = {},
       description = 'A Lua iterator, usable in a for loop.'
     }
   },

+ 31 - 0
api/lovr/physics/World/raycast.lua

@@ -38,6 +38,37 @@ return {
     {
       name = 'callback',
       type = 'function',
+      arguments = {
+        {
+          name = 'shape',
+          type = 'Shape'
+        },
+        {
+          name = 'x',
+          type = 'number'
+        },
+        {
+          name = 'y',
+          type = 'number'
+        },
+        {
+          name = 'z',
+          type = 'number'
+        },
+        {
+          name = 'nx',
+          type = 'number'
+        },
+        {
+          name = 'ny',
+          type = 'number'
+        },
+        {
+          name = 'nz',
+          type = 'number'
+        }
+      },
+      returns = {},
       description = 'The function to call when an intersection is detected.'
     }
   },

+ 7 - 0
api/lovr/physics/World/update.lua

@@ -14,6 +14,13 @@ return {
     {
       name = 'resolver',
       type = 'function',
+      arguments = {
+        {
+          name = 'world',
+          type = 'World'
+        }
+      },
+      returns = {},
       default = 'nil',
       description = [[
         The collision resolver function to use.  This will be called before updating to allow for