lune/luneTypes.d.luau

72 lines
1.8 KiB
Text
Raw Normal View History

2023-01-23 02:46:30 +00:00
-- Lune v0.0.5
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
declare task: {
cancel: (t: thread) -> (),
defer: (f: thread | (...any) -> (...any)) -> thread,
delay: (duration: number?, f: thread | (...any) -> (...any)) -> thread,
spawn: (f: thread | (...any) -> (...any)) -> thread,
wait: (duration: number?) -> (number),
}
--[[
2023-01-23 04:00:09 +00:00
declare task: {
cancel: (t: thread) -> (),
defer: <T...>(f: thread | (T...) -> (...any), T...) -> thread,
delay: <T...>(duration: number?, f: thread | (T...) -> (...any), T...) -> thread,
spawn: <T...>(f: thread | (T...) -> (...any), T...) -> thread,
wait: (duration: number?) -> (number),
}
]]