Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions generated/slua_default.d.luau
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ export type OsDateTime = {
yday: number?,
isdst: boolean?,
}
type LLJsonEncodeOptions = {
tight: boolean?,
skip_tojson: boolean?,
allow_sparse: boolean?,
replacer: ((key: any, value: any, parent: {}?) -> any)?,
}
type LLJsonDecodeReviverWithoutPath = (key: string | number, value: any, parent: {}?, ctx: {}) -> any
type LLJsonDecodeOptionsWithoutPath = {
track_path: false?,
reviver: LLJsonDecodeReviverWithoutPath?,
} | LLJsonDecodeReviverWithoutPath
type LLJsonDecodeOptionsWithPath = {
track_path: true,
reviver: (key: string | number, value: any, parent: {}?, ctx: {path: {string | number}}) -> any
}
type LLJsonDecodeOptions = LLJsonDecodeOptionsWithoutPath | LLJsonDecodeOptionsWithPath

declare extern type DetectedEvent with
index: number
Expand Down Expand Up @@ -256,15 +272,15 @@ declare llbase64: {

declare lljson: {
null: any,
empty_array_mt: { [any]: any },
array_mt: { [any]: any },
empty_array: any,
_NAME: string,
_VERSION: string,
encode: (value: any) -> string,
decode: (json: string) -> any,
slencode: (value: any, tight: boolean?) -> string,
sldecode: (json: string) -> any,
remove: any,
array_mt: {__jsonhint: string},
object_mt: {__jsonhint: string},
empty_array: {},
empty_object: {},
encode: (value: any, options: LLJsonEncodeOptions?) -> string,
decode: (json: string, options: LLJsonDecodeOptions?) -> any,
slencode: (value: any, options: LLJsonEncodeOptions?) -> string,
sldecode: (json: string, options: LLJsonDecodeOptions?) -> any,
}


Expand Down
20 changes: 10 additions & 10 deletions generated/slua_default.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,27 +256,27 @@
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson.null": {
"documentation": "A constant to pass for null to json encode",
"documentation": "A constant to pass for null to json encode.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson.empty_array_mt": {
"documentation": "Value: {}<br>Metatable for declaring table as an empty array for json encode",
"@sl-slua/global/lljson.remove": {
"documentation": "A constant to return from a reviver/replacer replacer function to omit this item.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson.array_mt": {
"documentation": "Value: {}<br>Metatable for declaring table as an array for json encode",
"documentation": "Value: {__jsonhint = \"array\"}<br>Metatable for declaring table as an array for json encode.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson.empty_array": {
"documentation": "A constant to pass for an empty array to json encode",
"@sl-slua/global/lljson.object_mt": {
"documentation": "Value: {__jsonhint = \"object\"}<br>Metatable for declaring table as an object for json encode.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson._NAME": {
"documentation": "Value: \"lljson\"<br>Name of the lljson library",
"@sl-slua/global/lljson.empty_array": {
"documentation": "Value: setmetatable({}, lljson.array_mt}<br>A constant to pass for an empty array to json encode.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson._VERSION": {
"documentation": "Value: \"2.1.0.11\"<br>Version of the lljson library",
"@sl-slua/global/lljson.empty_object": {
"documentation": "Value: setmetatable({}, lljson.object_mt}<br>A constant to pass for an empty object to json encode.",
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
},
"@sl-slua/global/lljson.encode": {
Expand Down
71 changes: 49 additions & 22 deletions generated/slua_keywords_pretty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,53 +235,53 @@ export type rotation = quaternion</string>
<key>value</key>
<string>false</string>
</map>
<key>lljson._NAME</key>
<key>lljson.array_mt</key>
<map>
<key>tooltip</key>
<string>Name of the lljson library</string>
<string>Metatable for declaring table as an array for json encode.</string>
<key>type</key>
<string>string</string>
<string>{__jsonhint: string}</string>
<key>value</key>
<string>"lljson"</string>
<string>{__jsonhint = "array"}</string>
</map>
<key>lljson._VERSION</key>
<key>lljson.empty_array</key>
<map>
<key>tooltip</key>
<string>Version of the lljson library</string>
<string>A constant to pass for an empty array to json encode.</string>
<key>type</key>
<string>string</string>
<string>{}</string>
<key>value</key>
<string>"2.1.0.11"</string>
<string>setmetatable({}, lljson.array_mt}</string>
</map>
<key>lljson.array_mt</key>
<key>lljson.empty_object</key>
<map>
<key>tooltip</key>
<string>Metatable for declaring table as an array for json encode</string>
<string>A constant to pass for an empty object to json encode.</string>
<key>type</key>
<string>{ [any]: any }</string>
<key>value</key>
<string>{}</string>
<key>value</key>
<string>setmetatable({}, lljson.object_mt}</string>
</map>
<key>lljson.empty_array</key>
<key>lljson.null</key>
<map>
<key>tooltip</key>
<string>A constant to pass for an empty array to json encode</string>
<string>A constant to pass for null to json encode.</string>
<key>type</key>
<string>any</string>
</map>
<key>lljson.empty_array_mt</key>
<key>lljson.object_mt</key>
<map>
<key>tooltip</key>
<string>Metatable for declaring table as an empty array for json encode</string>
<string>Metatable for declaring table as an object for json encode.</string>
<key>type</key>
<string>{ [any]: any }</string>
<string>{__jsonhint: string}</string>
<key>value</key>
<string>{}</string>
<string>{__jsonhint = "object"}</string>
</map>
<key>lljson.null</key>
<key>lljson.remove</key>
<map>
<key>tooltip</key>
<string>A constant to pass for null to json encode</string>
<string>A constant to return from a reviver/replacer replacer function to omit this item.</string>
<key>type</key>
<string>any</string>
</map>
Expand Down Expand Up @@ -13104,6 +13104,15 @@ Returns true if result is non-zero.</string>
<string>string</string>
</map>
</map>
<map>
<key>options</key>
<map>
<key>tooltip</key>
<string></string>
<key>type</key>
<string>LLJsonDecodeOptions?</string>
</map>
</map>
</array>
<key>energy</key>
<real>10.0</real>
Expand All @@ -13127,6 +13136,15 @@ Returns true if result is non-zero.</string>
<string>any</string>
</map>
</map>
<map>
<key>options</key>
<map>
<key>tooltip</key>
<string></string>
<key>type</key>
<string>LLJsonEncodeOptions?</string>
</map>
</map>
</array>
<key>energy</key>
<real>10.0</real>
Expand All @@ -13150,6 +13168,15 @@ Returns true if result is non-zero.</string>
<string>string</string>
</map>
</map>
<map>
<key>options</key>
<map>
<key>tooltip</key>
<string></string>
<key>type</key>
<string>LLJsonDecodeOptions?</string>
</map>
</map>
</array>
<key>energy</key>
<real>10.0</real>
Expand All @@ -13174,12 +13201,12 @@ Returns true if result is non-zero.</string>
</map>
</map>
<map>
<key>tight</key>
<key>options</key>
<map>
<key>tooltip</key>
<string></string>
<key>type</key>
<string>boolean?</string>
<string>LLJsonEncodeOptions?</string>
</map>
</map>
</array>
Expand Down
35 changes: 21 additions & 14 deletions generated/slua_selene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4339,49 +4339,56 @@ globals:
The output is truncated at the first decoding error.
lljson.null:
property: read-only
description: A constant to pass for null to json encode
lljson.empty_array_mt:
description: A constant to pass for null to json encode.
lljson.remove:
property: read-only
type: table
description: Metatable for declaring table as an empty array for json encode
description: A constant to return from a reviver/replacer replacer function to
omit this item.
lljson.array_mt:
property: read-only
type: table
description: Metatable for declaring table as an array for json encode
lljson.empty_array:
description: Metatable for declaring table as an array for json encode.
lljson.object_mt:
property: read-only
description: A constant to pass for an empty array to json encode
lljson._NAME:
type: table
description: Metatable for declaring table as an object for json encode.
lljson.empty_array:
property: read-only
type: string
description: Name of the lljson library
lljson._VERSION:
type: table
description: A constant to pass for an empty array to json encode.
lljson.empty_object:
property: read-only
type: string
description: Version of the lljson library
type: table
description: A constant to pass for an empty object to json encode.
lljson.encode:
args:
- type: any
- type: table
required: false
must_use: true
description: Encodes a Lua value as JSON. Raises an error if value contains unsupported
types.
lljson.decode:
args:
- type: string
- type: any
required: false
must_use: true
description: Decodes a JSON string to a Lua value. Raises an error if JSON is
invalid.
lljson.slencode:
args:
- type: any
- type: bool
- type: table
required: false
must_use: true
description: Encodes a Lua value as JSON, preserving SL types. Use tight to encode
more compactly. Raises an error if value contains unsupported types.
lljson.sldecode:
args:
- type: string
- type: any
required: false
must_use: true
description: Decodes a JSON string to a Lua value, preserving SL types. Raises
an error if JSON is invalid.
Expand Down
Loading
Loading