Members
(constant) CONFIG :Object
Runtime configuration settings for Foundry VTT which exposes a large number of variables which determine how aspects of the software behaves.
Unlike the CONST analog which is frozen and immutable, the CONFIG object may be updated during the course of a session or modified by system and module developers to adjust how the application behaves.
Type:
- Object
layer :PlaceablesLayer|null
A reference to the CanvasLayer which contains Document objects of this type.
Type:
- PlaceablesLayer | null
(constant) STRING_ARRAY_FIELD :DocumentField
A helper field used for string arrays
Type:
Methods
(async) deleteDialog(optionsopt) → {Promise.<Document>}
Present a Dialog form to confirm deletion of this Document.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object |
<optional> |
Positioning and sizing options for the resulting dialog |
Returns:
A Promise which resolves to the deleted Document
- Type
- Promise.<Document>
(async) fromUuid(uuid) → {Promise.<(Document|null)>}
Retrieve a Document by its Universally Unique Identifier (uuid).
Parameters:
Name | Type | Description |
---|---|---|
uuid |
string | The uuid of the Document to retrieve |
Returns:
- Type
- Promise.<(Document|null)>
getDocumentClass(documentName) → {function}
Return a reference to the Document class implementation which is configured for use.
Parameters:
Name | Type | Description |
---|---|---|
documentName |
string | The canonical Document name, for example "Actor" |
Returns:
The configured Document class implementation
- Type
- function
(async) getTemplate(path) → {Promise.<function()>}
Get a template from the server by fetch request and caching the retrieved result
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The web-accessible HTML template URL |
Returns:
A Promise which resolves to the compiled Handlebars template
- Type
- Promise.<function()>
getTexture(src) → {PIXI.Texture}
Get a single texture from the cache
Parameters:
Name | Type | Description |
---|---|---|
src |
string |
Returns:
- Type
- PIXI.Texture
INCLUDE_ARRAY_FIELD()
A helper field used for arrays of package include objects
(async) loadTemplates(paths) → {Promise.<Array.<function()>>}
Load and cache a set of templates by providing an Array of paths
Parameters:
Name | Type | Description |
---|---|---|
paths |
Array.<string> | An array of template file paths to load |
Returns:
- Type
- Promise.<Array.<function()>>
(async) loadTexture(src, fallback) → {PIXI.Texture}
Load a single texture and return a Promise which resolves once the texture is ready to use
Parameters:
Name | Type | Description |
---|---|---|
src |
string | The requested texture source |
fallback |
string | A fallback texture to use if the requested source is unavailable or invalid |
Returns:
- Type
- PIXI.Texture
readTextFromFile(file) → {Promise.<String>}
Read text data from a user provided File object
Parameters:
Name | Type | Description |
---|---|---|
file |
File | A File object |
Returns:
A Promise which resolves to the loaded text data
- Type
- Promise.<String>
(async) renderTemplate(path, data) → {Promise.<string>}
- See:
Get and render a template using provided data and handle the returned HTML Support asynchronous file template file loading with a client-side caching layer
Allow resolution of prototype methods and properties since this all occurs within the safety of the client.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The file path to the target HTML template |
data |
Object | A data object against which to compile the template |
Returns:
Returns the compiled and rendered template as a string
- Type
- Promise.<string>
saveDataToFile(data, type, filename)
Export data content to be saved to a local file
Parameters:
Name | Type | Description |
---|---|---|
data |
string | Data content converted to a string |
type |
string | The type of |
filename |
string | The filename of the resulting download |
(async) srcExists(src) → {boolean}
Test whether a file source exists by performing a HEAD request against it
Parameters:
Name | Type | Description |
---|---|---|
src |
string | The source URL or path to test |
Returns:
Does the file exist at the provided url?
- Type
- boolean
Type Definitions
ApplicationOptions
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
closeOnSubmit |
boolean |
<optional> |
true
|
Whether to automatically close the application when it's contained form is submitted. |
submitOnChange |
boolean |
<optional> |
false
|
Whether to automatically submit the contained HTML form when an input or select element is changed. |
submitOnClose |
boolean |
<optional> |
false
|
Whether to automatically submit the contained HTML form when the application window is manually closed. |
editable |
boolean |
<optional> |
true
|
Whether the application form is editable - if true, it's fields will be unlocked and the form can be submitted. If false, all form fields will be disabled and the form cannot be submitted. |
Type:
- Object
CanvasHistory
Properties:
Name | Type | Description |
---|---|---|
type |
string | The type of operation stored as history (create, update, delete) |
data |
Array.<Object> | The data corresponding to the action which may later be un-done |
Type:
- Object
CanvasLayerOptions
Properties:
Name | Type | Description |
---|---|---|
name |
string | The layer name by which the instance is referenced within the Canvas |
zIndex |
number | The zIndex sorting of this layer relative to other layers |
sortActiveTop |
boolean | Should this layer be sorted to the top when it is active? |
Options which configure the behavior of a Canvas Layer.
Type:
- Object
ContextMenuEntry
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The context menu label. Can be localized. |
|
icon |
string | A string containing an HTML icon element for the menu item |
|
callback |
function | The function to call when the menu item is clicked. Receives the HTML element of the SidebarTab entry that this context menu is for. |
|
condition |
function |
<optional> |
A function to call to determine if this item appears in the menu. Receives the HTML element of the SidebarTab entry that this context menu is for. |
Type:
- object
DialogButton
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
icon |
string | A Font Awesome icon for the button |
|
label |
string | The label for the button |
|
callback |
function |
<optional> |
A callback function that fires when the button is clicked |
Type:
- Object
DiceTermResult
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
result |
number | The numeric result |
|
active |
boolean |
<optional> |
Is this result active, contributing to the total? |
count |
number |
<optional> |
A value that the result counts as, otherwise the result is not used directly as |
success |
boolean |
<optional> |
Does this result denote a success? |
failure |
boolean |
<optional> |
Does this result denote a failure? |
discarded |
boolean |
<optional> |
Was this result discarded? |
rerolled |
boolean |
<optional> |
Was this result rerolled? |
exploded |
boolean |
<optional> |
Was this result exploded? |
Type:
- Object
DocumentField
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
type |
* | An object which defines the data type of this field |
|
required |
boolean | Is this field required to have an assigned value? Default is false. |
|
nullable |
boolean |
<optional> |
Can the field be populated by a null value? Default is true. |
default |
function | * |
<optional> |
A static default value or a function which assigns a default value |
collection |
boolean |
<optional> |
|
clean |
function |
<optional> |
An optional cleaning function which sanitizes input data to this field |
validate |
function |
<optional> |
A function which asserts that the value of this field is valid |
validationError |
string |
<optional> |
An error message which is displayed if validation fails |
isCollection |
boolean |
<optional> |
Is the field an embedded Document collection? |
A schema entry which describes a field of DocumentData
Type:
- Object
DocumentModificationContext
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
parent |
Document |
<optional> |
A parent Document within which these Documents should be embedded |
|
pack |
string |
<optional> |
A Compendium pack identifier within which the Documents should be modified |
|
noHook |
boolean |
<optional> |
false
|
Block the dispatch of preCreate hooks for this operation |
index |
boolean |
<optional> |
false
|
Return an index of the Document collection, used only during a get operation. |
indexFields |
Array.<string> |
<optional> |
An array of fields to retrieve when indexing the collection |
|
keepId |
boolean |
<optional> |
false
|
When performing a creation operation, keep the provided _id instead of clearing it. |
temporary |
boolean |
<optional> |
false
|
Create a temporary document which is not saved to the database. Only used during creation. |
render |
boolean |
<optional> |
true
|
Automatically re-render existing applications associated with the document. |
renderSheet |
boolean |
<optional> |
false
|
Automatically create and render the Document sheet when the Document is first created. |
diff |
boolean |
<optional> |
true
|
Difference each update object against current Document data to reduce the size of the transferred data. Only used during update. |
recursive |
boolean |
<optional> |
true
|
Merge objects recursively. If false, inner objects will be replaced explicitly. Use with caution! |
isUndo |
boolean |
<optional> |
Is the operation undoing a previous operation, only used by embedded Documents within a Scene |
|
deleteAll |
boolean |
<optional> |
Whether to delete all documents of a given type, regardless of the array of ids provided. Only used during a delete operation. |
Type:
- Object
DocumentSchema
The schema of a Document
Type:
- Object.<DocumentField>
LightChannel
A mapping of different light level channels
Type:
- Object
Point
A single point, expressed as an object {x, y}
Type:
- PIXI.Point | Object
PointArray
A single point, expressed as an array [x,y]
Type:
- Array.<number>
QuadtreeObject
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
r |
Rectangle | ||
t |
* | ||
n |
Set.<Quadtree> |
<optional> |
Type:
- Object
RayIntersection
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
wall |
<optional> |
Wall |
A Ray intersection point
Type:
- Object | null
RayIntersection
Properties:
Name | Type | Description |
---|---|---|
x |
number | The x-coordinate of intersection |
y |
number | The y-coordinate of intersection |
t0 |
number | The proximity to the Ray origin, as a ratio of distance |
t1 |
number | The proximity to the Ray destination, as a ratio of distance |
Type:
- Object
Rectangle
A standard rectangle interface.
Type:
- PIXI.Rectangle | Object
RequestData
Type:
RollTableDraw
Properties:
Name | Type | Description |
---|---|---|
roll |
Roll | The Dice roll which generated the draw |
results |
Array.<TableResult> | An array of drawn TableResult documents |
An object containing the executed Roll and the produced results
Type:
- Object
SceneControl
Properties:
Name | Type | Description |
---|---|---|
name |
string | |
title |
string | |
layer |
string | |
icon |
string | |
visible |
boolean | |
tools |
Array.<SceneControlTool> | |
activeTool |
string |
Type:
- Object
SceneControlTool
Properties:
Name | Type | Description |
---|---|---|
name |
string | |
label |
string | |
icon |
string | |
visible |
boolean | |
toggle |
boolean | |
active |
boolean | |
button |
boolean | |
onClick |
function |
Type:
- Object
SocketRequest
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
action |
string |
<optional> |
The server-side action being requested |
type |
string |
<optional> |
The type of object being modified |
data |
RequestData |
<optional> |
Data applied to the operation |
pack |
string |
<optional> |
A Compendium pack name |
parentType |
string |
<optional> |
The type of parent document |
parentId |
string |
<optional> |
The ID of a parent document |
options |
object |
<optional> |
Additional options applied to the request |
Type:
- Object
SocketResponse
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
request |
SocketRequest | The initial request |
|
error |
Error |
<optional> |
An error, if one occurred |
status |
string |
<optional> |
The status of the request |
userId |
string |
<optional> |
The ID of the requesting User |
data |
RequestData |
<optional> |
Data returned as a result of the request |
Type:
- Object
TabsConfiguration
Type:
- Object