Browse Source

Type info for function arguments/returns;

bjorn 7 years ago
parent
commit
ff99fa12ee

+ 66 - 5
api/init.lua

@@ -1722,7 +1722,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 = {}
                 }
               }
             }
@@ -2211,7 +2213,19 @@ return {
                 {
                   name = "chunk",
                   type = "function",
-                  description = "The runnable chunk."
+                  description = "The runnable chunk.",
+                  arguments = {
+                    {
+                      name = "...",
+                      type = "*"
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "...",
+                      type = "*"
+                    }
+                  }
                 }
               }
             }
@@ -7162,7 +7176,14 @@ return {
                 {
                   name = "callback",
                   type = "function",
-                  description = "The function used to render.  It will be passed a string representing the current eye that is being rendered to, either \"left\" or \"right\"."
+                  description = "The function used to render.  It will be passed a string representing the current eye that is being rendered to, either \"left\" or \"right\".",
+                  arguments = {
+                    {
+                      name = "eye",
+                      type = "HeadsetEye"
+                    }
+                  },
+                  returns = {}
                 }
               },
               returns = {}
@@ -12216,7 +12237,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 = {}
                     }
                   }
                 }
@@ -12276,7 +12299,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 = {}
@@ -12414,6 +12468,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/headset/renderTo.lua

@@ -15,6 +15,13 @@ return {
     {
       name = 'callback',
       type = 'function',
+      arguments = {
+        {
+          name = 'eye',
+          type = 'HeadsetEye'
+        }
+      },
+      returns = {},
       description = [[
         The function used to render.  It will be passed a string representing the
         current eye that is being rendered to, either "left" or "right".

+ 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