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

15
lua_ext/string.lua Normal file
View File

@@ -0,0 +1,15 @@
--- @diagnostic disable: missing-return
--- e.g. `"a,b":split(",")` returns `{"a","b"}`
--- @param separator? string cannot be empty, default: `","`
--- @param include_empty? boolean default: `false`
--- @param max_splits? number if it's negative, splits aren't limited, default: `-1`
--- @param sep_is_pattern? boolean it specifies whether separator is a plain string or a pattern (regex), default: `false`
--- @return string[]
function string:split(separator, include_empty, max_splits, sep_is_pattern) end
--- Returns the string without whitespace pre- and suffixes
--- e.g. `"\n \t\tfoo bar\t ":trim()` returns `"foo bar"`
--- @return string
function string:trim() end