style: added lua annotations to init methods

This commit is contained in:
Folke Lemaitre 2022-09-05 16:56:58 +02:00
parent 9268b4c39f
commit ec13e0f44f
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 0 deletions

View File

@ -25,10 +25,12 @@ local defaults = {
---@type Config
M.options = {}
---@param options Config|nil
function M.setup(options)
M.options = vim.tbl_deep_extend("force", {}, defaults, options or {})
end
---@param options Config|nil
function M.extend(options)
M.options = vim.tbl_deep_extend("force", {}, M.options or defaults, options or {})
end

View File

@ -1,8 +1,10 @@
local util = require("tokyonight.util")
local theme = require("tokyonight.theme")
local config = require("tokyonight.config")
local M = {}
---@param opts Config|nil
function M.load(opts)
if opts then
require("tokyonight.config").extend(opts)
@ -10,6 +12,9 @@ function M.load(opts)
util.load(theme.setup())
end
M.setup = config.setup
-- keep for backward compatibility
M.colorscheme = M.load
return M