Skip to content

Commit 5b6542e

Browse files
authored
Merge pull request #2021 from fesily/3rd-add-bee
3rd: meta add bee
2 parents b20f3f7 + 0312eb4 commit 5b6542e

File tree

5 files changed

+467
-0
lines changed

5 files changed

+467
-0
lines changed

meta/3rd/bee/config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name" : "bee",
3+
"words" : [ "require[%s%(\"']+bee%.%w+[%)\"']" ]
4+
}
+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---@meta
2+
3+
local m = {}
4+
5+
---@enum bee.filesystem.copy_options
6+
local copy_options = {
7+
none = 0,
8+
skip_existing = 1,
9+
overwrite_existing = 2,
10+
update_existing = 4,
11+
recursive = 8,
12+
copy_symlinks = 16,
13+
skip_symlinks = 32,
14+
directories_only = 64,
15+
create_symlinks = 128,
16+
create_hard_links = 256,
17+
__in_recursive_copy = 512,
18+
}
19+
20+
---@alias bee.filesystem.path_arg string|bee.filesystem.path
21+
22+
---@class bee.filesystem.path
23+
---@operator div(any):bee.filesystem.path
24+
---@operator concat(any):bee.filesystem.path
25+
local path = {}
26+
27+
---@return string
28+
function path:string()
29+
end
30+
31+
---@return bee.filesystem.path
32+
function path:filename()
33+
end
34+
35+
---@return bee.filesystem.path
36+
function path:parent_path()
37+
end
38+
39+
---@return bee.filesystem.path
40+
function path:stem()
41+
end
42+
43+
---@return bee.filesystem.path
44+
function path:extension()
45+
end
46+
47+
---@return boolean
48+
function path:is_absolute()
49+
end
50+
51+
---@return boolean
52+
function path:is_relative()
53+
end
54+
55+
---@return bee.filesystem.path
56+
function path:remove_filename()
57+
end
58+
59+
---@param filename bee.filesystem.path_arg
60+
---@return bee.filesystem.path
61+
function path:replace_filename(filename)
62+
end
63+
64+
---@param extension bee.filesystem.path_arg
65+
---@return bee.filesystem.path
66+
function path:replace_extension(extension)
67+
end
68+
69+
---@param path bee.filesystem.path_arg
70+
---@return boolean
71+
function path:equal_extension(path)
72+
end
73+
74+
---@return bee.filesystem.path
75+
function path:lexically_normal()
76+
end
77+
78+
---@class bee.filesystem.file_status
79+
local file_status = {}
80+
81+
---@alias bee.filesystem.file_type
82+
---| "'none'"
83+
---| "'not_found'"
84+
---| "'regular'"
85+
---| "'directory'"
86+
---| "'symlink'"
87+
---| "'block'"
88+
---| "'character'"
89+
---| "'fifo'"
90+
---| "'socket'"
91+
---| "'junction'"
92+
---| "'unknown'"
93+
94+
---@return bee.filesystem.file_type
95+
function file_status:type()
96+
end
97+
98+
---@return boolean
99+
function file_status:exists()
100+
end
101+
102+
---@return boolean
103+
function file_status:is_directory()
104+
end
105+
106+
---@return boolean
107+
function file_status:is_regular_file()
108+
end
109+
110+
---@class bee.filesystem.directory_entry
111+
local directory_entry = {}
112+
113+
---@return bee.filesystem.path
114+
function directory_entry:path()
115+
end
116+
117+
---@return bee.filesystem.file_status
118+
function directory_entry:status()
119+
end
120+
121+
---@return bee.filesystem.file_status
122+
function directory_entry:symlink_status()
123+
end
124+
125+
---@return bee.filesystem.file_type
126+
function directory_entry:type()
127+
end
128+
129+
---@return boolean
130+
function directory_entry:exists()
131+
end
132+
133+
---@return boolean
134+
function directory_entry:is_directory()
135+
end
136+
137+
---@return boolean
138+
function directory_entry:is_regular_file()
139+
end
140+
141+
---@return bee.filesystem.path
142+
function m.path(path)
143+
end
144+
145+
---@return bee.filesystem.file_status
146+
function m.status(path)
147+
end
148+
149+
---@return bee.filesystem.file_status
150+
function m.symlink_status(path)
151+
end
152+
153+
---@return boolean
154+
function m.exists(path)
155+
end
156+
157+
---@return boolean
158+
function m.is_directory(path)
159+
end
160+
161+
---@return boolean
162+
function m.is_regular_file(path)
163+
end
164+
165+
function m.create_directory(path)
166+
end
167+
168+
function m.create_directories(path)
169+
end
170+
171+
function m.rename(from, to)
172+
end
173+
174+
function m.remove(path)
175+
end
176+
177+
function m.remove_all(path)
178+
end
179+
180+
---@return bee.filesystem.path
181+
function m.current_path()
182+
end
183+
184+
---@param options bee.filesystem.copy_options
185+
function m.copy(from, to, options)
186+
end
187+
188+
---@param options bee.filesystem.copy_options
189+
function m.copy_file(from, to, options)
190+
end
191+
192+
function m.absolute(path)
193+
end
194+
195+
function m.canonical(path)
196+
end
197+
198+
function m.relative(path)
199+
end
200+
201+
function m.last_write_time(path)
202+
end
203+
204+
function m.permissions(path)
205+
end
206+
207+
function m.create_symlink(target, link)
208+
end
209+
210+
function m.create_directory_symlink(target, link)
211+
end
212+
213+
function m.create_hard_link(target, link)
214+
end
215+
216+
---@return bee.filesystem.path
217+
function m.temp_directory_path()
218+
end
219+
220+
---@return fun(table: bee.filesystem.path[]): bee.filesystem.path
221+
function m.pairs(path)
222+
end
223+
224+
---@return bee.filesystem.path
225+
function m.exe_path()
226+
end
227+
228+
---@return bee.filesystem.path
229+
function m.dll_path()
230+
end
231+
232+
---@return bee.file
233+
function m.filelock(path)
234+
end
235+
236+
---@return bee.filesystem.path
237+
function m.fullpath(path)
238+
end
239+
240+
return m

meta/3rd/bee/library/bee/platform.lua

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---@meta
2+
3+
---@alias bee.platform.os
4+
---| '"windows"'
5+
---| '"android"'
6+
---| '"linux"'
7+
---| '"netbsd"'
8+
---| '"freebsd"'
9+
---| '"openbsd"'
10+
---| '"ios"'
11+
---| '"macos"'
12+
---| '"unknown"'
13+
14+
---@alias bee.platform.OS
15+
---| '"Windows"'
16+
---| '"Android"'
17+
---| '"Linux"'
18+
---| '"NetBSD"'
19+
---| '"FreeBSD"'
20+
---| '"OpenBSD"'
21+
---| '"iOS"'
22+
---| '"macOS"'
23+
---| '"unknown"'
24+
25+
---@alias bee.platform.arch
26+
---| '"x86"'
27+
---| '"x86_64"'
28+
---| '"arm"'
29+
---| '"arm64"'
30+
---| '"riscv"'
31+
---| '"unknown"'
32+
33+
---@alias bee.platform.compiler
34+
---| '"clang"'
35+
---| '"gcc"'
36+
---| '"msvc"'
37+
---| '"unknown"'
38+
39+
---@alias bee.platform.crt
40+
---| '"msvc"'
41+
---| '"bionic"'
42+
---| '"libstdc++"'
43+
---| '"libc++"'
44+
---| '"unknown"'
45+
46+
local m = {
47+
---@type bee.platform.os
48+
os = "unknown",
49+
---@type bee.platform.OS
50+
OS = "unknown",
51+
---@type bee.platform.compiler
52+
Compiler = "clang",
53+
CompilerVersion = "",
54+
CRTVersion = "",
55+
---@type bee.platform.crt
56+
CRT = "msvc",
57+
---@type bee.platform.arch
58+
Arch = "x86",
59+
DEBUG = false,
60+
}
61+
62+
return m

0 commit comments

Comments
 (0)