forked from joshbode/mise-nix
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.lua
More file actions
73 lines (62 loc) · 2.63 KB
/
types.lua
File metadata and controls
73 lines (62 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---@meta
--- VFox plugin
---@class PluginBase
---@field name string Plugin name
---@field version string Plugin version
---@field description string Plugin description
---@field homepage string Plugin homepage
---@field license string Plugin license, please choose a correct license according to your needs.
---@field minRuntimeVersion string? Minimum compatible vfox version.
---@field manifestUrl string? If configured, vfox will check for updates to the plugin at this address, otherwise it will check for updates at the global registry.
---@field notes table? Some things that require the user's attention
--- Nix plugin options
---@class Options
---@field flake_attr string? Optional attr to use
---@field flake_lock string? Optional lock file to use
---@field profile_dir string? Optional profile directory to use
--- Nix plugin context
---@class Context
---@field options Options | boolean Plugin options
--- Mise plugin
---@class Plugin: PluginBase
---@field MiseEnv fun(self: Plugin, ctx: Context):
---| { cacheable?: boolean, watch_files?: string[], env?: { key: string, value: string }[] } Update environment
---@field MisePath fun(self: Plugin, ctx: Context):
---| string[] Update PATH
--- VFox built-in strings library
---@class Strings
---@field contains fun(x: string, substr: string): boolean
---@field has_prefix fun(x: string, prefix: string): boolean
---@field has_suffix fun(x: string, suffix: string): boolean
---@field join fun(x: string[], sep: string): string Join array of strings with delimiter
---@field split fun(x: string, sep: string): string[] Split string by delimiter into array of strings
---@field trim fun(x: string, suffix: string): string
---@field trim_space fun(x: string): string
--- Development environment
---@class DevEnv
---@field variables
---| { string: { type: "exported" | "var" | "array", value: any } }
---@field bashFunctions { string: string}
--- Mise built-in cmd module
---@class Cmd
---@field exec fun(command: string, options?: { cwd?: string, env?: table, timeout?: number }): string
--- Mise built-in json module
---@class Json
---@field encode fun(value: any): string
---@field decode fun(str: string): any
--- Mise built-in env module
---@class Env
---@field setenv fun(key: string, value: string)
--- Mise built-in file module
---@class File
---@field exists fun(path: string): boolean
---@field join_path fun(...: string): string
---@field read fun(path: string): string
---@field symlink fun(source: string, destination: string)
--- Mise built-in log module
---@class Log
---@field trace fun(...: any)
---@field debug fun(...: any)
---@field info fun(...: any)
---@field warn fun(...: any)
---@field error fun(...: any)