EmmyLua -> LuaLS

This commit is contained in:
Van
2026-06-16 17:50:09 +03:00
parent 5272c8e5a8
commit 24531f8af6
5 changed files with 64 additions and 40 deletions

View File

@@ -1,50 +1,73 @@
--- @meta
---@meta
--- Base class used by [`StorageRef`], [`NodeMetaRef`], [`ItemStackMetaRef`],
--- and [`PlayerMetaRef`].
---Base class used by [`StorageRef`], [`NodeMetaRef`], [`ItemStackMetaRef`],
---and [`PlayerMetaRef`].
---
--- Note: If a metadata value is in the format `${k}`, an attempt to get the value
--- will return the value associated with key `k`. There is a low recursion limit.
--- This behavior is **deprecated** and will be removed in a future version. Usage
--- of the `${k}` syntax in formspecs is not deprecated.
---Note: If a metadata value is in the format `${k}`, an attempt to get the value
---will return the value associated with key `k`. There is a low recursion limit.
---This behavior is **deprecated** and will be removed in a future version. Usage
---of the `${k}` syntax in formspecs is not deprecated.
---
--- @class MetaDataRef
---@class MetaDataRef
MetaDataRef = {}
---@param key string
---@return boolean|nil
---Returns `true` if `key` present, otherwise `false`.
---
---Returns `nil` when the MetaData is inexistent.
---@param key string
---@return boolean?
function MetaDataRef:contains(key) end
---@param key string
---@return string|nil
---Returns the value stored at `key` as a string if present.
---
---Returns nil otherwise.
---@param key string
---@return string?
function MetaDataRef:get(key) end
---@param key string
---@param value string value "" will delete the key
---@return string
---Set the string `value` at `key`.
---
---Value of `""` will delete the key.
---@param key string
---@param value string
function MetaDataRef:set_string(key, value) end
---@param key string
---@return string
---Returns a string value at `key` or `""` if not present.
---@param key string
---@return string
function MetaDataRef:get_string(key) end
---@param key string
---@param value number
---@return number
---Set an integer number `value` to `key`.
---
---Range: [s32].
---
---Some systems internally have a larger value range
---but but you should not rely on this behavior to ensure portability of your code.
---
---The value will be converted into a string when stored.
---@param key string
---@param value integer
function MetaDataRef:set_int(key, value) end
---@param key string
---@return number Returns `0` if `key` not present.
---Returns the value stored at `key` as an integer.
---
---Returns `0` if key not present.
---@param key string
---@return integer
function MetaDataRef:get_int(key) end
---@param key string
---@param value number
---@return number
---Store a number (a 64-bit floating-point number) exactly.
---
---The value will be converted into a string when stored.
---@param key string
---@param value number
function MetaDataRef:set_float(key, value) end
---@param key string
---@return number
---Returns a 64-bit floating-point number stored at `key`.
---
---Returns `0` if key not present.
---@param key string
---@return number
function MetaDataRef:get_float(key) end
--- Returns a list of all keys in the metadata.