---@meta
---@diagnostic disable

--$Factorio 1.1.70
--$Overlay 5
--$Section LuaInventory
-- This file is automatically generated. Edits will be overwritten.

---A storage of item stacks.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html)
---@class LuaInventory:LuaObject
---[R]  
---The entity that owns this inventory, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.entity_owner)
---@field entity_owner? LuaEntity 
---[R]  
---The equipment that owns this inventory, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.equipment_owner)
---@field equipment_owner? LuaEquipment 
---[R]  
---The inventory index this inventory uses, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.index)
---@field index? defines.inventory 
---[R]  
---The mod that owns this inventory, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.mod_owner)
---@field mod_owner? string 
---[R]  
---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.object_name)
---@field object_name string 
---[R]  
---The player that owns this inventory, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.player_owner)
---@field player_owner? LuaPlayer 
---[R]  
---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.valid)
---@field valid boolean 
---[R]  
---Get the number of slots in this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.length)
---
---### Example  
---Will print the number of slots in the player's main inventory. 
---```
---game.player.print(#game.player.get_main_inventory())
---```
---@operator len: uint
---[R]  
---The indexing operator.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.index)
---
---### Example  
---Will get the first item in the player's inventory. 
---```
---game.player.get_main_inventory()[1]
---```
---@field [uint] LuaItemStack 
local LuaInventory={
---Can at least some items be inserted?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.can_insert)
---@param items ItemStackIdentification@Items that would be inserted.
---@return boolean@`true` if at least a part of the given items could be inserted into this inventory.
can_insert=function(items)end,
---If the given inventory slot filter can be set to the given filter.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.can_set_filter)
---@param index uint@The item stack index
---@param filter string@The item name of the filter
---@return boolean
can_set_filter=function(index,filter)end,
---Make this inventory empty.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.clear)
clear=function()end,
---Counts the number of empty stacks.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.count_empty_stacks)
---@param include_filtered boolean?@If true, filtered slots will be included. Defaults to false.
---@return uint
count_empty_stacks=function(include_filtered)end,
---Destroys this inventory.
---
---**Note:** Only inventories created by [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) can be destroyed this way.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.destroy)
destroy=function()end,
---Finds the first empty stack. Filtered slots are excluded unless a filter item is given.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.find_empty_stack)
---@param item string?@If given, empty stacks that are filtered for this item will be included.
---@return LuaItemStack?@The first empty stack, or `nil` if there aren't any empty stacks.
---@return uint?@The stack index of the matching stack, if any is found.
find_empty_stack=function(item)end,
---Finds the first LuaItemStack in the inventory that matches the given item name.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.find_item_stack)
---@param item string@The item name to find
---@return LuaItemStack?@The first matching stack, or `nil` if none match.
---@return uint?@The stack index of the matching stack, if any is found.
find_item_stack=function(item)end,
---Get the current bar. This is the index at which the red area starts.
---
---**Note:** Only useable if this inventory supports having a bar.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_bar)
---@return uint
get_bar=function()end,
---Get counts of all items in this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_contents)
---@return {[string]: uint}@The counts, indexed by item names.
get_contents=function()end,
---Gets the filter for the given item stack index.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_filter)
---@param index uint@The item stack index
---@return string?@The current filter or `nil` if none.
get_filter=function(index)end,
---Gets the number of the given item that can be inserted into this inventory.
---
---**Note:** This is a "best guess" number; things like assembling machine filtered slots, module slots, items with durability, and items with mixed health will cause the result to be inaccurate.
---
---**Note:** The main use for this is in checking how many of a basic item can fit into a basic inventory.
---
---**Note:** This accounts for the 'bar' on the inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_insertable_count)
---@param item string@The item to check.
get_insertable_count=function(item)end,
---Get the number of all or some items in this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_item_count)
---@param item string?@Prototype name of the item to count. If not specified, count all items.
---@return uint
get_item_count=function(item)end,
---All methods and properties that this object supports.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.help)
---@return string
help=function()end,
---Insert items into this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.insert)
---@param items ItemStackIdentification@Items to insert.
---@return uint@Number of items actually inserted.
insert=function(items)end,
---Does this inventory contain nothing?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_empty)
---@return boolean
is_empty=function()end,
---If this inventory supports filters and has at least 1 filter set.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_filtered)
---@return boolean
is_filtered=function()end,
---Remove items from this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.remove)
---@param items ItemStackIdentification@Items to remove.
---@return uint@Number of items actually removed.
remove=function(items)end,
---Resizes the inventory.
---
---**Note:** Items in slots beyond the new capacity are deleted.
---
---**Note:** Only inventories created by [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) can be resized.
---
---**Events:**  
--- * Will raise [on_pre_script_inventory_resized](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) instantly.
---
--- * Will raise [on_script_inventory_resized](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.resize)
---@param size uint16@New size of a inventory
resize=function(size)end,
---Set the current bar.
---
---**Note:** Only useable if this inventory supports having a bar.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_bar)
---@param bar uint?@The new limit. Omitting this parameter will clear the limit.
set_bar=function(bar)end,
---Sets the filter for the given item stack index.
---
---**Note:** Some inventory slots don't allow some filters (gun ammo can't be filtered for non-ammo).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_filter)
---@param index uint@The item stack index.
---@param filter string|nil@The new filter. `nil` erases any existing filter.
---@return boolean@If the filter was allowed to be set.
set_filter=function(index,filter)end,
---Sorts and merges the items in this inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.sort_and_merge)
sort_and_merge=function()end,
---Does this inventory support a bar? Bar is the draggable red thing, found for example on chests, that limits the portion of the inventory that may be manipulated by machines.
---
---**Note:** "Supporting a bar" doesn't mean that the bar is set to some nontrivial value. Supporting a bar means the inventory supports having this limit at all. The character's inventory is an example of an inventory without a bar; the wooden chest's inventory is an example of one with a bar.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.supports_bar)
---@return boolean
supports_bar=function()end,
---If this inventory supports filters.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.supports_filters)
---@return boolean
supports_filters=function()end,
}


