lune/luneTypes.d.luau

62 lines
1.6 KiB
Lua
Raw Normal View History

2023-01-24 20:32:31 -05:00
-- Lune v0.1.2
2023-01-19 14:57:39 -05:00
2023-01-19 22:10:34 -05:00
declare console: {
resetColor: () -> (),
setColor: (color: "black" | "red" | "green" | "yellow" | "blue" | "purple" | "cyan" | "white") -> (),
resetStyle: () -> (),
2023-01-21 01:37:31 -05:00
setStyle: (style: "bold" | "dim") -> (),
2023-01-19 22:10:34 -05:00
format: (...any) -> (string),
log: (...any) -> (),
info: (...any) -> (),
warn: (...any) -> (),
error: (...any) -> (),
}
2023-01-18 20:47:14 -05: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-18 20:47:14 -05:00
}
declare process: {
args: { string },
env: { [string]: string? },
2023-01-18 20:47:14 -05:00
exit: (code: number?) -> (),
spawn: (program: string, params: { string }?) -> {
ok: boolean,
code: number,
stdout: string,
stderr: string,
},
}
2023-01-21 13:33:33 -05:00
2023-01-22 23:00:09 -05:00
declare task: {
2023-01-23 19:13:18 -05: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-22 23:00:09 -05:00
wait: (duration: number?) -> (number),
}