ide-helper: add string, math & table luanti methods annotations. LG-1994

This commit is contained in:
alek13
2025-09-23 04:19:23 +03:00
parent c3c88e5b46
commit 4ab48fe835
3 changed files with 127 additions and 0 deletions

35
lua_ext/math.lua Normal file
View File

@@ -0,0 +1,35 @@
--- @diagnostic disable: missing-return
--- Get the hypotenuse of a triangle with legs x and y. Useful for distance calculation.
---
--- @param x number
--- @param y number
---
--- @return number
function math.hypot(x, y) end
--- Get the sign of given number `x`.
--- - returns `-1`, `0` or `1`
--- - if the absolute value of x is within the tolerance or x is NaN, 0 is returned.
---
--- @param x number
--- @param tolerance? number default: `0.0`
---
--- @return number
function math.sign(x, tolerance) end
--- Returns the factorial of `x`.
---
--- @param x number
---
--- @return number
function math.factorial(x) end
--- Returns x rounded to the nearest integer.
--- - At a multiple of 0.5, rounds away from zero.
---
--- @param x number
---
--- @return number
function math.round(x) end