Something went wrong. Try again.
Something went wrong. Try again.
1.7 kB · 52 lines
Lua
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253---@mod rest-nvim.api rest.nvim Lua API------@brief [[------The Lua API for rest.nvim---Intended for use by third-party modules that extend its functionalities.------@brief ]]
local api = {}
-- stylua: ignore startlocal autocmds = function() return require("rest-nvim.client") endlocal commands = function() return require("rest-nvim.client") endlocal client = function() return require("rest-nvim.client") end-- stylua: ignore end
---rest.nvim API version, equals to the current rest.nvim version. Meant to be used by modules later---@type string---@see vim.versionapi.VERSION = "3.13.0" -- x-release-please-version
---rest.nvim namespace used for buffer highlights---@type number---@see vim.api.nvim_create_namespaceapi.namespace = vim.api.nvim_create_namespace("rest-nvim")
---Register a new autocommand in the `Rest` augroup---@see vim.api.nvim_create_augroup---@see vim.api.nvim_create_autocmd------@param events string[] Autocommand events, see `:h events`---@param cb string|fun(args: table) Autocommand lua callback, runs a Vimscript command instead if it is a `string`---@param description string Autocommand descriptionfunction api.register_rest_autocmd(events, cb, description) ---@diagnostic disable-next-line: invisible autocmds().register_autocmd(events, cb, description)end
---Register a new `:Rest` subcommand---@param name string The name of the subcommand to register---@param cmd RestCmdfunction api.register_rest_subcommand(name, cmd) ---@diagnostic disable-next-line: invisible commands().register_subcommand(name, cmd)end
function api.register_rest_client(c) client().register_client(c)end
return api