blob: 0c7e41a801f9e089d6ecd5747ff35ca638202641 (
plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
---@meta
---@class fs.path
---@operator div: fs.path
local fsPath = {}
---@return string
function fsPath:string()
end
---@return fs.path
function fsPath:parent_path()
end
---@return boolean
function fsPath:is_relative()
end
---@return fs.path
function fsPath:filename()
end
---@return fs.path
function fsPath:stem()
end
---@return string
function fsPath:extension()
end
---@class fs.status
local fsStatus = {}
---@return 'none' | 'not_found' | 'regular' | 'directory' | 'symlink' | 'block' | 'character' | 'fifo' | 'junction' | 'unknown'
function fsStatus:type()
end
---@class bee.filesystem
local fs = {}
---@class fs.copy_options
---@field overwrite_existing integer
local copy_options
fs.copy_options = copy_options
---@param path string|fs.path
---@return fs.path
function fs.path(path)
end
---@return fs.path
function fs.exe_path()
end
---@param path fs.path
---@return boolean
function fs.exists(path)
end
---@param path fs.path
---@return boolean
function fs.is_directory(path)
end
---@param path fs.path
---@return fun():fs.path, fs.status
function fs.pairs(path)
end
---@param path fs.path
---@return fs.path
function fs.canonical(path)
end
---@param path fs.path
---@return fs.path
function fs.fullpath(path)
end
---@param path fs.path
---@return fs.path
function fs.absolute(path)
end
---@param path fs.path
function fs.create_directories(path)
end
---@param path fs.path
---@return fs.status
function fs.symlink_status(path)
end
---@param path fs.path
---@return boolean
function fs.remove(path)
end
---@param source fs.path
---@param target fs.path
---@param options? integer | `fs.copy_options.overwrite_existing`
function fs.copy_file(source, target, options)
end
---@param oldPath fs.path
---@param newPath fs.path
function fs.rename(oldPath, newPath)
end
---@return fs.path
function fs.current_path()
end
return fs
|