lune/luneTypes.d.luau

62 lines
1.6 KiB
Lua
Raw Normal View History

2023-01-24 17:44:33 +00:00
-- Lune v0.1.0
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: () -> (),
2023-01-21 06:37:31 +00:00
setStyle: (style: "bold" | "dim") -> (),
2023-01-20 03:10:34 +00:00
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,
}
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: {
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,
},
}
2023-01-21 18:33:33 +00:00
2023-01-23 04:00:09 +00:00
declare task: {
2023-01-24 00:13:18 +00:00
cancel: (thread: thread) -> (),
defer: <T...>(functionOrThread: thread | (T...) -> (...any), T...) -> thread,
delay: <T...>(duration: number?, functionOrThread: thread | (T...) -> (...any), T...) -> thread,
spawn: <T...>(functionOrThread: thread | (T...) -> (...any), T...) -> thread,
2023-01-23 04:00:09 +00:00
wait: (duration: number?) -> (number),
}