From d0a48768528433eed51a942deda9387c90a5ba83 Mon Sep 17 00:00:00 2001 From: Haxxer Date: Fri, 7 Jan 2022 16:13:32 +0000 Subject: [PATCH] Updated api.md --- docs/api.md | 140 ++++++++++++++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/docs/api.md b/docs/api.md index b5cd3b9b..8f4447ba 100644 --- a/docs/api.md +++ b/docs/api.md @@ -86,6 +86,27 @@
deleteItemPile(target)Promise

Deletes a pile, calling the relevant hooks.

+
isValidItemPile(document)boolean
+

Whether a given document is a valid pile or not

+
+
isItemPileEmpty(target)boolean
+

Whether the item pile is empty

+
+
getItemPileItemTypeFilters(target)Array
+

Returns the item type filters for a given item pile

+
+
getItemPileItems(target, [itemTypeFilters])Array
+

Returns the items this item pile can transfer

+
+
getItemPileAttributes(target)array
+

Returns the attributes this item pile can transfer

+
+
refreshItemPile(target)Promise
+

Refreshes the target image of an item pile, ensuring it remains in sync

+
+
rerenderItemPileInventoryApplication(inPileUuid, [deleted])Promise
+

Causes all connected users to re-render a specific pile's inventory UI

+
### Items & Attributes @@ -126,27 +147,6 @@

Checks whether an item (or item data) is of a type that is not allowed. If an array whether that type is allowed or not, returning the type if it is NOT allowed.

-
isValidItemPile(document)boolean
-

Whether a given document is a valid pile or not

-
-
isItemPileEmpty(target)boolean
-

Whether the item pile is empty

-
-
getItemPileItemTypeFilters(target)Array
-

Returns the item type filters for a given item pile

-
-
getItemPileItems(target, [itemTypeFilters])Array
-

Returns the items this item pile can transfer

-
-
getItemPileAttributes(target)array
-

Returns the attributes this item pile can transfer

-
-
refreshItemPile(target)Promise
-

Refreshes the target image of an item pile, ensuring it remains in sync

-
-
rerenderItemPileInventoryApplication(inPileUuid, [deleted])Promise
-

Causes all connected users to re-render a specific pile's inventory UI

-
@@ -177,7 +177,7 @@ The filters for item types eligible for interaction within this system ## ItemPiles.API.setActorClassType(inClassType) ⇒ Promise -Sets the actor class type used for the original item pile actor in this system +Sets the actor class type used for the original item pile actor in this system | Param | Type | | --- | --- | @@ -186,7 +186,7 @@ Sets the actor class type used for the original item pile actor in this system ## ItemPiles.API.setDynamicAttributes(inAttributes) ⇒ Promise -Sets the attributes used to track dynamic attributes in this system +Sets the attributes used to track dynamic attributes in this system | Param | Type | | --- | --- | @@ -195,7 +195,7 @@ Sets the attributes used to track dynamic attributes in this system ## ItemPiles.API.setItemQuantityAttribute(inAttribute) ⇒ Promise -Sets the inAttribute used to track the quantity of items in this system +Sets the inAttribute used to track the quantity of items in this system | Param | Type | | --- | --- | @@ -204,7 +204,7 @@ Sets the inAttribute used to track the quantity of items in this system ## ItemPiles.API.setItemTypeAttribute(inAttribute) ⇒ string -Sets the attribute used to track the item type in this system +Sets the attribute used to track the item type in this system | Param | Type | | --- | --- | @@ -213,7 +213,7 @@ Sets the attribute used to track the item type in this system ## ItemPiles.API.setItemTypeFilters(inFilters) ⇒ Promise -Sets the filters for item types eligible for interaction within this system +Sets the filters for item types eligible for interaction within this system | Param | Type | | --- | --- | @@ -222,7 +222,7 @@ Sets the filters for item types eligible for interaction within this system ## ItemPiles.API.createItemPile(position, [items], [pileActorName]) ⇒ Promise -Creates the default item pile token at a location. +Creates the default item pile token at a location. | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -233,8 +233,8 @@ Creates the default item pile token at a location. ## ItemPiles.API.transferItems(source, target, items, [itemTypeFilters]) ⇒ Promise.<object> -Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0 -**Returns**: Promise.<object> - An object containing a key value pair for each item added to the target, key being item ID, value being quantities added +Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0 +**Returns**: Promise.<object> - An object containing a key value pair for each item added to the target, key being item ID, value being quantities added | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -246,8 +246,8 @@ Transfers items from the source to the target, subtracting a number of quantity ## ItemPiles.API.removeItems(target, items, [itemTypeFilters]) ⇒ Promise.<array> -Subtracts the quantity of items on an actor. If the quantity of an item reaches 0, the item is removed from the actor. -**Returns**: Promise.<array> - An array containing the objects of each item that was removed, with their quantities set to the number removed +Subtracts the quantity of items on an actor. If the quantity of an item reaches 0, the item is removed from the actor. +**Returns**: Promise.<array> - An array containing the objects of each item that was removed, with their quantities set to the number removed | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -258,8 +258,8 @@ Subtracts the quantity of items on an actor. If the quantity of an item reaches ## ItemPiles.API.addItems(target, items, [itemTypeFilters]) ⇒ Promise.<array> -Adds item to an actor, increasing item quantities if matches were found -**Returns**: Promise.<array> - An array containing each item added as an object, with their quantities updated to match the new amounts +Adds item to an actor, increasing item quantities if matches were found +**Returns**: Promise.<array> - An array containing each item added as an object, with their quantities updated to match the new amounts | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -270,8 +270,8 @@ Adds item to an actor, increasing item quantities if matches were found ## ItemPiles.API.transferAllItems(source, target, [itemTypeFilters]) ⇒ Promise.<array> -Transfers all items between the source and the target. -**Returns**: Promise.<array> - An array containing all of the items that were transferred to the target +Transfers all items between the source and the target. +**Returns**: Promise.<array> - An array containing all of the items that were transferred to the target | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -282,8 +282,8 @@ Transfers all items between the source and the target. ## ItemPiles.API.transferAttributes(source, target, attributes) ⇒ Promise.<object> -Transfers a set quantity of an attribute from a source to a target, removing it or subtracting from the source and adds it the target -**Returns**: Promise.<object> - An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred +Transfers a set quantity of an attribute from a source to a target, removing it or subtracting from the source and adds it the target +**Returns**: Promise.<object> - An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred | Param | Type | Description | | --- | --- | --- | @@ -294,8 +294,8 @@ Transfers a set quantity of an attribute from a source to a target, removing it ## ItemPiles.API.removeAttributes(target, attributes) ⇒ Promise.<object> -Subtracts attributes on the target -**Returns**: Promise.<object> - Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed +Subtracts attributes on the target +**Returns**: Promise.<object> - Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed | Param | Type | Description | | --- | --- | --- | @@ -305,8 +305,8 @@ Subtracts attributes on the target ## ItemPiles.API.addAttributes(target, attributes) ⇒ Promise.<object> -Adds to attributes on an actor -**Returns**: Promise.<object> - Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed +Adds to attributes on an actor +**Returns**: Promise.<object> - Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed | Param | Type | Description | | --- | --- | --- | @@ -316,8 +316,8 @@ Adds to attributes on an actor ## ItemPiles.API.transferAllAttributes(source, target) ⇒ Promise.<object> -Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target -**Returns**: Promise.<object> - An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred +Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target +**Returns**: Promise.<object> - An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred | Param | Type | Description | | --- | --- | --- | @@ -327,8 +327,8 @@ Transfers all dynamic attributes from a source to a target, removing it or subtr ## ItemPiles.API.transferEverything(source, target, [itemTypeFilters]) ⇒ Promise.<object> -Transfers all items and attributes between the source and the target. -**Returns**: Promise.<object> - An object containing all items and attributes transferred to the target +Transfers all items and attributes between the source and the target. +**Returns**: Promise.<object> - An object containing all items and attributes transferred to the target | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -339,8 +339,8 @@ Transfers all items and attributes between the source and the target. ## ItemPiles.API.turnTokenIntoItemPile(target, pileSettings, tokenSettings) ⇒ Promise.<string> -Turns a token and its actor into an item pile -**Returns**: Promise.<string> - The uuid of the target after it was turned into an item pile +Turns a token and its actor into an item pile +**Returns**: Promise.<string> - The uuid of the target after it was turned into an item pile | Param | Type | Description | | --- | --- | --- | @@ -351,8 +351,8 @@ Turns a token and its actor into an item pile ## ItemPiles.API.revertTokenFromItemPile(target, tokenSettings) ⇒ Promise.<string> -Reverts a token from an item pile into a normal token and actor -**Returns**: Promise.<string> - The uuid of the target after it was reverted from an item pile +Reverts a token from an item pile into a normal token and actor +**Returns**: Promise.<string> - The uuid of the target after it was reverted from an item pile | Param | Type | Description | | --- | --- | --- | @@ -362,11 +362,11 @@ Reverts a token from an item pile into a normal token and actor ## ItemPiles.API.rerenderTokenHud() ⇒ Promise -Causes every user's token HUD to rerender +Causes every user's token HUD to rerender ## ItemPiles.API.openItemPile(target, [interactingToken]) ⇒ Promise -Opens a pile if it is enabled and a container +Opens a pile if it is enabled and a container | Param | Type | Default | | --- | --- | --- | @@ -376,7 +376,7 @@ Opens a pile if it is enabled and a container ## ItemPiles.API.closeItemPile(target, [interactingToken]) ⇒ Promise -Closes a pile if it is enabled and a container +Closes a pile if it is enabled and a container | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -386,7 +386,7 @@ Closes a pile if it is enabled and a container ## ItemPiles.API.toggleItemPileClosed(target, [interactingToken]) ⇒ Promise -Toggles a pile's closed state if it is enabled and a container +Toggles a pile's closed state if it is enabled and a container | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -396,7 +396,7 @@ Toggles a pile's closed state if it is enabled and a container ## ItemPiles.API.lockItemPile(target, [interactingToken]) ⇒ Promise -Locks a pile if it is enabled and a container +Locks a pile if it is enabled and a container | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -406,7 +406,7 @@ Locks a pile if it is enabled and a container ## ItemPiles.API.unlockItemPile(target, [interactingToken]) ⇒ Promise -Unlocks a pile if it is enabled and a container +Unlocks a pile if it is enabled and a container | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -416,7 +416,7 @@ Unlocks a pile if it is enabled and a container ## ItemPiles.API.toggleItemPileLocked(target, [interactingToken]) ⇒ Promise -Toggles a pile's locked state if it is enabled and a container +Toggles a pile's locked state if it is enabled and a container | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -426,7 +426,7 @@ Toggles a pile's locked state if it is enabled and a container ## ItemPiles.API.rattleItemPile(target) ⇒ Promise.<boolean> -Causes the item pile to play a sound as it was attempted to be opened, but was locked +Causes the item pile to play a sound as it was attempted to be opened, but was locked | Param | Type | | --- | --- | @@ -435,7 +435,7 @@ Causes the item pile to play a sound as it was attempted to be opened, but was l ## ItemPiles.API.isItemPileLocked(target) ⇒ boolean -Whether an item pile is locked. If it is not enabled or not a container, it is always false. +Whether an item pile is locked. If it is not enabled or not a container, it is always false. | Param | Type | | --- | --- | @@ -444,7 +444,7 @@ Whether an item pile is locked. If it is not enabled or not a container, it is a ## ItemPiles.API.isItemPileClosed(target) ⇒ boolean -Whether an item pile is closed. If it is not enabled or not a container, it is always false. +Whether an item pile is closed. If it is not enabled or not a container, it is always false. | Param | Type | | --- | --- | @@ -453,7 +453,7 @@ Whether an item pile is closed. If it is not enabled or not a container, it is a ## ItemPiles.API.isItemPileContainer(target) ⇒ boolean -Whether an item pile is a container. If it is not enabled, it is always false. +Whether an item pile is a container. If it is not enabled, it is always false. | Param | Type | | --- | --- | @@ -462,7 +462,7 @@ Whether an item pile is a container. If it is not enabled, it is always false. ## ItemPiles.API.updateItemPile(target, newData, [interactingToken], [tokenSettings]) ⇒ Promise -Updates a pile with new data. +Updates a pile with new data. | Param | Type | Default | | --- | --- | --- | @@ -474,7 +474,7 @@ Updates a pile with new data. ## ItemPiles.API.deleteItemPile(target) ⇒ Promise -Deletes a pile, calling the relevant hooks. +Deletes a pile, calling the relevant hooks. | Param | Type | | --- | --- | @@ -484,7 +484,7 @@ Deletes a pile, calling the relevant hooks. ## ItemPiles.API.isItemTypeDisallowed(item, [itemTypeFilters]) ⇒ boolean/string Checks whether an item (or item data) is of a type that is not allowed. If an array whether that type is allowed -or not, returning the type if it is NOT allowed. +or not, returning the type if it is NOT allowed. | Param | Type | Default | | --- | --- | --- | @@ -494,7 +494,7 @@ or not, returning the type if it is NOT allowed. ## ItemPiles.API.isValidItemPile(document) ⇒ boolean -Whether a given document is a valid pile or not +Whether a given document is a valid pile or not | Param | Type | | --- | --- | @@ -503,7 +503,7 @@ Whether a given document is a valid pile or not ## ItemPiles.API.isItemPileEmpty(target) ⇒ boolean -Whether the item pile is empty +Whether the item pile is empty | Param | Type | | --- | --- | @@ -512,7 +512,7 @@ Whether the item pile is empty ## ItemPiles.API.getItemPileItemTypeFilters(target) ⇒ Array -Returns the item type filters for a given item pile +Returns the item type filters for a given item pile | Param | | --- | @@ -521,7 +521,7 @@ Returns the item type filters for a given item pile ## ItemPiles.API.getItemPileItems(target, [itemTypeFilters]) ⇒ Array -Returns the items this item pile can transfer +Returns the items this item pile can transfer | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -531,7 +531,7 @@ Returns the items this item pile can transfer ## ItemPiles.API.getItemPileAttributes(target) ⇒ array -Returns the attributes this item pile can transfer +Returns the attributes this item pile can transfer | Param | Type | | --- | --- | @@ -540,7 +540,7 @@ Returns the attributes this item pile can transfer ## ItemPiles.API.refreshItemPile(target) ⇒ Promise -Refreshes the target image of an item pile, ensuring it remains in sync +Refreshes the target image of an item pile, ensuring it remains in sync | Param | | --- | @@ -549,7 +549,7 @@ Refreshes the target image of an item pile, ensuring it remains in sync ## ItemPiles.API.rerenderItemPileInventoryApplication(inPileUuid, [deleted]) ⇒ Promise -Causes all connected users to re-render a specific pile's inventory UI +Causes all connected users to re-render a specific pile's inventory UI | Param | Type | Default | Description | | --- | --- | --- | --- |