Skip to content

Commit

Permalink
Make rxi-json-lua encode definition more lenient
Browse files Browse the repository at this point in the history
  • Loading branch information
icy-lava authored and hishamhm committed Mar 9, 2023
1 parent 241602d commit ab11e3d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion types/rxi-json-lua/json.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ local record json

type Value = number | string | boolean | Mixed

encode: function(value: Value): string
-- For convenience, encode takes any type and may throw an error at runtime.
-- You can enforce correctness yourself by specifying types on variables or records.
--
-- For example:
-- local obj: json.Object = {value = 'data'}
-- local encoded = json.encode(obj)

encode: function(value: any): string
-- encode: function(value: Value): string

decode: function(str: string): Value
end

Expand Down

0 comments on commit ab11e3d

Please sign in to comment.