fix(net, serde): update types to reflect buffer support

This commit is contained in:
Erica Marigold 2024-04-20 14:39:16 +05:30
parent d1d7cb77e4
commit 77edb89829
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
2 changed files with 5 additions and 5 deletions

View file

@ -61,7 +61,7 @@ export type FetchResponse = {
statusCode: number, statusCode: number,
statusMessage: string, statusMessage: string,
headers: HttpHeaderMap, headers: HttpHeaderMap,
body: (string | buffer)?, body: string?,
} }
--[=[ --[=[
@ -83,7 +83,7 @@ export type ServeRequest = {
query: { [string]: string? }, query: { [string]: string? },
method: HttpMethod, method: HttpMethod,
headers: { [string]: string }, headers: { [string]: string },
body: (string | buffer)?, body: string?,
} }
--[=[ --[=[

View file

@ -70,7 +70,7 @@ end
@param encoded The string to decode @param encoded The string to decode
@return The decoded lua value @return The decoded lua value
]=] ]=]
function serde.decode(format: EncodeDecodeFormat, encoded: string): any function serde.decode(format: EncodeDecodeFormat, encoded: buffer | string): any
return nil :: any return nil :: any
end end
@ -93,7 +93,7 @@ end
@param s The string to compress @param s The string to compress
@return The compressed string @return The compressed string
]=] ]=]
function serde.compress(format: CompressDecompressFormat, s: string): string function serde.compress(format: CompressDecompressFormat, s: buffer | string): string
return nil :: any return nil :: any
end end
@ -116,7 +116,7 @@ end
@param s The string to decompress @param s The string to decompress
@return The decompressed string @return The decompressed string
]=] ]=]
function serde.decompress(format: CompressDecompressFormat, s: string): string function serde.decompress(format: CompressDecompressFormat, s: buffer | string): string
return nil :: any return nil :: any
end end