aboutsummaryrefslogtreecommitdiff
path: root/library/lullaby
diff options
context:
space:
mode:
Diffstat (limited to 'library/lullaby')
-rw-r--r--library/lullaby/common.lua21
-rw-r--r--library/lullaby/net.lua6
2 files changed, 26 insertions, 1 deletions
diff --git a/library/lullaby/common.lua b/library/lullaby/common.lua
new file mode 100644
index 0000000..936feb9
--- /dev/null
+++ b/library/lullaby/common.lua
@@ -0,0 +1,21 @@
+---@meta
+
+---@class meta
+local meta = {}
+
+---@class stream
+meta.stream = {}
+
+---sends the rest of a streams contents to a file
+---@param T stream
+---@param filename string
+---@param bytes integer? max amount to read before stopping
+function meta.stream.file(T, filename, bytes) end
+
+---reads bytes from a stream
+---@param T stream
+---@param bytes integer? max amount to read before stopping
+---@return string
+function meta.stream.read(T, bytes) end
+
+return meta
diff --git a/library/lullaby/net.lua b/library/lullaby/net.lua
index 3f9abdc..57636a4 100644
--- a/library/lullaby/net.lua
+++ b/library/lullaby/net.lua
@@ -1,3 +1,4 @@
+local common = require("common")
---@meta
---@class net
@@ -122,12 +123,15 @@ local function listen_callback(server) end
---@param port integer
function net.listen(callback, port) end
+---@class request-return
+---@field content stream
+
---creates an https request
---@param url string
---@param value string | nil
---@param header table<string, string> | nil
---@param request string | nil
----@return table<string, string> | error
+---@return request-return | error
function net.srequest(url, value, header, request) end
---@class wss-table