2023-01-20 03:12:25 +00:00
|
|
|
-- Lune v0.0.3
|
2023-01-19 19:57:39 +00:00
|
|
|
|
2023-01-20 03:10:34 +00:00
|
|
|
declare console: {
|
|
|
|
resetColor: () -> (),
|
|
|
|
setColor: (color: "black" | "red" | "green" | "yellow" | "blue" | "purple" | "cyan" | "white") -> (),
|
|
|
|
resetStyle: () -> (),
|
|
|
|
setStyle: (color: "bold" | "dim") -> (),
|
|
|
|
format: (...any) -> (string),
|
|
|
|
log: (...any) -> (),
|
|
|
|
info: (...any) -> (),
|
|
|
|
warn: (...any) -> (),
|
|
|
|
error: (...any) -> (),
|
|
|
|
}
|
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
declare fs: {
|
|
|
|
readFile: (path: string) -> string,
|
|
|
|
readDir: (path: string) -> { string },
|
|
|
|
writeFile: (path: string, contents: string) -> (),
|
|
|
|
writeDir: (path: string) -> (),
|
|
|
|
removeFile: (path: string) -> (),
|
|
|
|
removeDir: (path: string) -> (),
|
|
|
|
isFile: (path: string) -> boolean,
|
|
|
|
isDir: (path: string) -> boolean,
|
|
|
|
}
|
|
|
|
|
2023-01-19 22:56:12 +00:00
|
|
|
declare net: {
|
|
|
|
request: (config: string | {
|
|
|
|
url: string,
|
|
|
|
method: ("GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "PATCH")?,
|
|
|
|
headers: { [string]: string }?,
|
|
|
|
body: string?,
|
|
|
|
}) -> {
|
|
|
|
ok: boolean,
|
|
|
|
statusCode: number,
|
|
|
|
statusMessage: string,
|
|
|
|
headers: { [string]: string },
|
|
|
|
body: string,
|
|
|
|
},
|
|
|
|
jsonEncode: (value: any, pretty: boolean?) -> string,
|
|
|
|
jsonDecode: (encoded: string) -> any,
|
2023-01-19 01:47:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare process: {
|
2023-01-20 20:21:20 +00:00
|
|
|
args: { string },
|
|
|
|
env: { [string]: string? },
|
2023-01-19 01:47:14 +00:00
|
|
|
exit: (code: number?) -> (),
|
|
|
|
spawn: (program: string, params: { string }?) -> {
|
|
|
|
ok: boolean,
|
|
|
|
code: number,
|
|
|
|
stdout: string,
|
|
|
|
stderr: string,
|
|
|
|
},
|
|
|
|
}
|