The items in the list.
A read-only copy of items in the list.
We don't allow adding new items to the ItemList via setting new properties, nor do we allow modifying existing items directly.
Add an item to the list.
A unique key for the item.
The item's content.
The priority of the item. Items with a higher priority will be positioned before items with a lower priority.
Proxies an item's content, adding the itemName
readonly property to it.
The item's content (objects only)
The item's key
Proxied content
Get the content of an item.
Get the priority of an item.
Check whether an item is present in the list.
Check whether the list is empty.
Remove an item from the list.
If the provided key
is not present, nothing will happen.
Replace an item and/or priority in the list, only if it is already present.
If content
or priority
are null
, these values will not be replaced.
If the provided key
is not present, nothing will happen.
The key of the item in the list
The item's new content
The item's new priority
Replaces an item's content, if the provided item key exists.
If the provided key
is not present, an error will be thrown.
The key of the item in the list
The item's new content
Replaces an item's priority, if the provided item key exists.
If the provided key
is not present, an error will be thrown.
The key of the item in the list
The item's new priority
Convert the list into an array of item content arranged by priority.
This does not preserve the original types of primitives and proxies
all content values to make itemName
accessible on them.
NOTE: If your ItemList holds primitive types (such as numbers, booleans
or strings), these will be converted to their object counterparts if you do
not provide true
to this function.
NOTE: Modifying any objects in the final array may also update the content of the original ItemList.
Converts item content to objects and sets the
itemName
property on them.
Convert the list into an array of item content arranged by priority.
Content values that are already objects will be proxied and have
itemName
accessible on them. Primitive values will not have the
itemName
property accessible.
NOTE: Modifying any objects in the final array may also update the content of the original ItemList.
Converts item content to objects and sets the
itemName
property on them.
A read-only map of all keys to their respective items in no particular order.
We don't allow adding new items to the ItemList via setting new properties, nor do we allow modifying existing items directly. You should use the ItemList.add, ItemList.setContent and ItemList.setPriority methods instead.
To match the old behaviour of the ItemList.items
property, call
Object.values(ItemList.toObject())
.
Generated using TypeDoc version 0.22.10
The
ItemList
class collects items and then arranges them into an array by priority.