aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/vimfn.lua
diff options
context:
space:
mode:
authorColin Kennedy <colinvfx@gmail.com>2024-12-11 01:01:14 -0800
committerLewis Russell <me@lewisr.dev>2024-12-13 17:05:38 +0000
commitf9dd6826210335d8b37455002d767d1b37c09ce4 (patch)
treede202d9b1f6126c07cb0b8948eee52e2e0679987 /runtime/lua/vim/_meta/vimfn.lua
parent65b1733405e558e80527096a0ba42b5a678c9b54 (diff)
downloadrneovim-f9dd6826210335d8b37455002d767d1b37c09ce4.tar.gz
rneovim-f9dd6826210335d8b37455002d767d1b37c09ce4.tar.bz2
rneovim-f9dd6826210335d8b37455002d767d1b37c09ce4.zip
docs(annotations): added `---@generic` support
Diffstat (limited to 'runtime/lua/vim/_meta/vimfn.lua')
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua29
1 files changed, 17 insertions, 12 deletions
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 77c78f03d4..cf1beda15f 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -1147,8 +1147,9 @@ function vim.fn.confirm(msg, choices, default, type) end
--- A |Dictionary| is copied in a similar way as a |List|.
--- Also see |deepcopy()|.
---
---- @param expr any
---- @return any
+--- @generic T
+--- @param expr T
+--- @return T
function vim.fn.copy(expr) end
--- Return the cosine of {expr}, measured in radians, as a |Float|.
@@ -1308,9 +1309,10 @@ function vim.fn.debugbreak(pid) end
--- {noref} set to 1 will fail.
--- Also see |copy()|.
---
---- @param expr any
+--- @generic T
+--- @param expr T
--- @param noref? boolean
---- @return any
+--- @return T
function vim.fn.deepcopy(expr, noref) end
--- Without {flags} or with {flags} empty: Deletes the file by the
@@ -4769,7 +4771,7 @@ function vim.fn.isnan(expr) end
--- cases, items() returns a List with the index and the value at
--- the index.
---
---- @param dict any
+--- @param dict table
--- @return any
function vim.fn.items(dict) end
@@ -5952,7 +5954,7 @@ function vim.fn.matchstrpos(expr, pat, start, count) end
--- an error. An empty |List| or |Dictionary| results in zero.
---
--- @param expr any
---- @return any
+--- @return number
function vim.fn.max(expr) end
--- Returns a |List| of |Dictionaries| describing |menus| (defined
@@ -7016,10 +7018,11 @@ function vim.fn.readfile(fname, type, max) end
--- echo reduce('xyz', { acc, val -> acc .. ',' .. val })
--- <
---
+--- @generic T
--- @param object any
---- @param func function
+--- @param func fun(accumulator: T, current: any): any
--- @param initial? any
---- @return any
+--- @return T
function vim.fn.reduce(object, func, initial) end
--- Returns the single letter name of the register being executed.
@@ -7215,8 +7218,9 @@ function vim.fn.resolve(filename) end
--- let revlist = reverse(copy(mylist))
--- <
---
---- @param object any
---- @return any
+--- @generic T
+--- @param object T[]
+--- @return T[]
function vim.fn.reverse(object) end
--- Round off {expr} to the nearest integral value and return it
@@ -9079,10 +9083,11 @@ function vim.fn.sockconnect(mode, address, opts) end
--- eval mylist->sort({i1, i2 -> i1 - i2})
--- <
---
---- @param list any
+--- @generic T
+--- @param list T[]
--- @param how? string|function
--- @param dict? any
---- @return any
+--- @return T[]
function vim.fn.sort(list, how, dict) end
--- Return the sound-folded equivalent of {word}. Uses the first