Skip to content

Commit

Permalink
add lua-messagepack
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad authored and hishamhm committed Sep 27, 2023
1 parent ab11e3d commit b622a68
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions types/lua-messagepack/MessagePack.d.tl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
--
-- https://luarocks.org/modules/fperrad/lua-messagepack
--

local record MessagePack
_VERSION: string
_DESCRIPTION: string
_COPYRIGHT: string
full64bits: boolean
long_double: boolean
small_lua: boolean
sentinel: any

record Cursor
s: string
i: integer
j: integer
underflow: function(Cursor, integer)
end

enum Packer
"_string"
"_table"
"array"
"binary"
"boolean"
"double"
"ext"
"fixext1"
"fixext2"
"fixext4"
"fixext8"
"fixext16"
"float"
"integer"
"map"
"nil"
"number"
"signed"
"string"
"string_compat"
"table"
"unsigned"
"userdata"
end
packers: {Packer:function({string}, any, integer|string)}

enum String
"string_compat"
"string"
"binary"
end
set_string: function(String)
enum Array
"without_hole"
"with_hole"
"always_as_map"
end
set_array: function(Array)
enum Number
"float"
"double"
end
set_number: function(Number)

pack: function(data: any): string
build_ext: function(tag: integer, data: string): any
unpack_cursor: function(c: Cursor): any
unpack: function(s: string): any
unpacker: function(src: string|function(): string): function(): (boolean|integer, any)
end

return MessagePack

0 comments on commit b622a68

Please sign in to comment.