### Compendium Browser - setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.SpellBrowser Performs the initial setup for the compendium browser, including requesting indexes and preparing filters. ```APIDOC ## setup ### Description Perform the initial setup of the compendium browser. This includes requesting the index of all relevant compendiums if necessary and preparing the filters. ### Method N/A (This appears to be a static method or a utility function within a class context, not a direct HTTP endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (Promise) This method returns a Promise that resolves when setup is complete. #### Response Example ```json { "status": "setup complete" } ``` ``` -------------------------------- ### Initialize Compendium Browser Setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.ClassBrowser Performs the initial setup for the compendium browser. This asynchronous function prepares filters and requests indexes for relevant compendiums if needed. It returns a Promise that resolves when setup is complete. ```typescript setup(): Promise // Perform the initial setup of the compendium browser. This includes requesting the index of all relevant compendiums if necessary and preparing the filters. // Returns Promise ``` -------------------------------- ### Filter Setup and Indexing Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.class.ClassHitDieFilter Handles the setup and registration of index fields for filters, preparing them for use after compendium entries have been gathered. ```APIDOC ## POST /api/filters/setup ### Description Prepares the filter for use. This step expects the compendium browser to have gathered its entries. ### Method POST ### Endpoint /api/filters/setup ### Response #### Success Response (200) - **status** (string) - Indicates successful setup. #### Response Example ```json { "status": "Filter setup complete." } ``` ## POST /api/filters/register-index-fields ### Description Adds the index fields checked by this filter to the document's `CONFIG` object, so that `CompendiumCollection#getIndex` will include them. ### Method POST ### Endpoint /api/filters/register-index-fields ### Response #### Success Response (200) - **status** (string) - Indicates successful registration of index fields. #### Response Example ```json { "status": "Index fields registered successfully." } ``` ``` -------------------------------- ### Setup Filter Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.feat.FeatTypeFilter Prepares the filter for use, expecting that the compendium browser has already gathered its entries. ```APIDOC ## POST /filter/setup ### Description Prepare the filter for use. This step expects the compendium browser to have gathered its entries. ### Method POST ### Endpoint /filter/setup ### Parameters #### Path Parameters - **none** #### Query Parameters - **none** #### Request Body - **none** ### Response #### Success Response (200) - **message** (string) - Indicates successful setup. #### Response Example ```json { "message": "Filter setup complete." } ``` ``` -------------------------------- ### Apply Damage Prompt Example Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.ApplyDamage This example demonstrates how to use the `wait` method of the ApplyDamage class to prompt the user for damage application. It specifies the damage value and targets, returning a promise that resolves when the user confirms the action. ```javascript await pf1.applications.ApplyDamage.wait({ value: 20, targets: canvas.tokens.controlled }); ``` -------------------------------- ### Setup Filter Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.class.ClassSkillPointsFilter Prepares the filter for use, assuming the compendium browser has already gathered its entries. This is an asynchronous operation. ```typescript /** * Prepare the filter for use. This step expects the compendium browser to have gathered its entries. * @returns {Promise} */ setup(): Promise; ``` -------------------------------- ### Compendium Browser Filter API - setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.NumberRangeFilter Prepares the filter for use after the compendium browser has gathered its entries. This is an asynchronous operation. ```APIDOC ## POST /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/setup ### Description Prepare the filter for use. This step expects the compendium browser to have gathered its entries. ### Method POST ### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/setup ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful setup of the filter. #### Response Example ```json { "message": "Filter setup complete." } ``` ``` -------------------------------- ### Example: Get Actor Source Details Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorBasePF An example demonstrating how to use the getSourceDetails method to retrieve information about the max HP attribute. ```javascript actor.getSourceDetails("system.attributes.hp.max"); ``` -------------------------------- ### Filter Setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.common.PackFilter Asynchronously prepares the filter for use after the compendium browser has gathered its entries. ```APIDOC ## Filter Setup ### setup #### Description Prepare the filter for use. This step expects the compendium browser to have gathered its entries. #### Method POST #### Endpoint /api/filters/{filterId}/setup #### Returns - Promise ``` -------------------------------- ### Filter Lifecycle and Setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.race.CreatureTypeFilter Details methods for preparing filter components, registering index fields, setting up the filter for use, and resetting its state. ```APIDOC ## Filter Lifecycle Methods ### prepareBooleanOperator #### Description Prepare the boolean operator for this filter. #### Method POST #### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/filter/prepareBooleanOperator #### Response #### Success Response (200) - **void** ### prepareChoices #### Description Prepare the choices for this filter. This is called after the compendium browser has gathered its entries. By default, this will generate a list of choices from the index field of all entries in the compendium. #### Method POST #### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/filter/prepareChoices #### Response #### Success Response (200) - **void** ### registerIndexFields #### Description Adds the index fields checked by this filter to the document's `CONFIG` object, so that CompendiumCollection#getIndex will include them. #### Method POST #### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/filter/registerIndexFields #### Response #### Success Response (200) - **void** ### reset #### Description Reset all choices and controls to their default state (inactive). #### Method POST #### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/filter/reset #### Response #### Success Response (200) - **void** ### setup #### Description Prepare the filter for use. This step expects the compendium browser to have gathered its entries. #### Method POST #### Endpoint /websites/foundryvtt_pathfinder1e_gitlab_io/foundryvtt-pathfinder1/filter/setup #### Response #### Success Response (200) - **Promise** ``` -------------------------------- ### Get Raw Effect Data Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemLootPF Asynchronously determines the starting data for an ActiveEffect based on the item. It accepts optional roll data for further customization. ```typescript item.getRawEffectData(options?: { rollData: object }): Promise ``` -------------------------------- ### Get Raw Effect Data Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemRacePF Asynchronously determines the starting data for an ActiveEffect based on the item. It accepts optional `rollData` to influence the effect's initial state. ```typescript const effectData = await item.getRawEffectData({ rollData: { ability: "str" } }); ``` -------------------------------- ### Get Default Actor Artwork (Pathfinder 1e) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorNPCPF Adds default artwork to an actor. This is an internal function that can be guided by provided actor data. It returns an object containing data alterations for the artwork. ```typescript getDefaultArtwork(actorData?: object): object ``` -------------------------------- ### _onWeightTooltip Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.actor.ActorSheetPFNPC Experimental method for handling weight tooltips. ```APIDOC ## _onWeightTooltip ### Description `Experimental` Weight Tooltips ### Method Experimental ### Endpoint N/A (Internal Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return value** (Promise) - A promise that resolves when the tooltip is handled. #### Response Example ```json null ``` ``` -------------------------------- ### Get Default Actor Artwork Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorPF An internal static method to add default artwork to actor data. It can optionally take actor data to guide the creation process. Returns an object with resulting data alterations. ```javascript Actor.getDefaultArtwork(actorData); ``` -------------------------------- ### Get Raw Effect Data Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemAmmunitionPF Asynchronously determines the starting data for an ActiveEffect based on the item. It can accept optional roll data for calculations. This method returns a Promise that resolves to an object containing the effect data. ```typescript getRawEffectData(options?: { rollData: object }): Promise ``` -------------------------------- ### _prepareSkillsets Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.actor.ActorSheetPFNPC Prepares adventure/background skill distinction if needed. ```APIDOC ## _prepareSkillsets ### Description `Internal` Prepare adventure/background skill distinction if needed. ### Method Internal ### Endpoint N/A (Internal Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example ```json null ``` ``` -------------------------------- ### Get Default Artwork (JavaScript) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorBasePF An internal utility function to add default artwork to an actor. It takes optional actor data to guide the artwork creation process and returns an object containing the resulting data alterations. ```javascript actor.getDefaultArtwork(actorData); ``` -------------------------------- ### Setup Filter (Pathfinder 1e FoundryVTT) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.class.ClassWillFilter Prepares the filter for use, assuming that the compendium browser has already gathered its entries. This asynchronous method should be called before the filter is actively used for searching or displaying results. ```typescript /** * Prepare the filter for use. * This step expects the compendium browser to have gathered its entries. * @returns {Promise} */ setup(): Promise; ``` -------------------------------- ### Get Raw Effect Data (Pathfinder 1e) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemConsumablePF Asynchronously determines the starting data for an ActiveEffect based on the item. Can accept optional roll data for context. Returns a Promise that resolves to the Active Effect creation data object. ```typescript item.getRawEffectData(options?: { rollData: object }): Promise // Parameters: // options: { rollData: object } = {} - Additional options // rollData: object - Roll data // Returns: Active Effect creation data ``` -------------------------------- ### Get Raw Effect Data (JavaScript) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemAttackPF Determines the starting data for an ActiveEffect based on the item. This asynchronous function accepts an optional `options` object, which can include `rollData`. It returns a Promise that resolves to an object containing the Active Effect creation data. ```javascript const effectData = await item.getRawEffectData({ rollData: item.getRollData() }); ``` -------------------------------- ### AbstractSettingsApplication Class Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1._types_.AbstractSettingsApplication Provides a generic application to render a settings modal. It is a base class for various configuration applications. ```APIDOC ## Class AbstractSettingsApplication ### Description A generic application to render a settings modal. ### Type Parameters * `Model` extends `foundry.abstract.DataModel` ### Hierarchy * `HandlebarsApplication & ApplicationV2` * `AbstractSettingsApplication` * `ExperienceConfig` * `HealthConfig` * `IntegrationConfig` * `PerformanceConfig` * `SourcesConfig` ### Constructors #### `new AbstractSettingsApplication>(options?: {})` Applications are constructed by providing an object of configuration options. * **Parameters** * `options` (object) - Optional. Options used to configure the Application instance (default: `{}`). * **Returns** * `AbstractSettingsApplication` ### Properties #### `fields` * **`fields`** (any) #### `settings` * **`settings`** (any) #### `Static settings` * **`settings`** (any) ### Accessors #### `model` * **`get model()`**: `Model` Returns the model associated with this application. ### Methods #### `Static _onCommitChanges(event: SubmitEvent, form: HTMLFormElement, formData: FormDataExtended)` Internal. Update the game settings with the new configuration. * **Parameters** * `this`: `ActorRestDialog` * `event` (SubmitEvent) - The originating form submission event. * `form` (HTMLFormElement) - The form element that was submitted. * `formData` (FormDataExtended) - Processed data for the submitted form. * `object` (object) - The form data in object form. * **Returns** * `Promise` #### `Static _onFormReset(event: Event)` Internal. The event handler that is fired when the form is reset to its original values. * **Parameters** * `event` (Event) - The triggering event. * **Returns** * `Promise` ``` -------------------------------- ### BaseItemModel Class Documentation Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.BaseItemModel Provides detailed information about the BaseItemModel class, including its constructor, properties, and methods. ```APIDOC ## Class BaseItemModel Base Item Model Datamodel expressing common elements to all items. #### Hierarchy (View Summary, Expand) * any * BaseItemModel * ActionItemModel * ClassModel * RaceModel ##### Index ### General constructor armorProf? changeFlags? changes? classSkills? contextNotes? description? flags? languages? links? parent? scriptCalls? subType? tag? weaponProf? activeState autoDeductCharges canUse charges hasFiniteCharges isActive isCharged isPhysical isSingleUse maxCharges isPhysical _activeStateChange _chargePreUpdate _prepareTraits _rechargeActions _rechargeUses _updateChargeLinking _updateInheritedCharges getDefaultChargeCost getDefaultChargeFormula getLabels getName getRollData prepareBaseData prepareDependentData prepareDerivedData recharge setActive _adjustNewItem migrateParentData pruneData ### Document metadata ## General ### constructor * new BaseItemModel(): BaseItemModel #### Returns BaseItemModel ### `Optional`armorProf armorProf?: Trait<"med" | "lgt" | "hvy" | "shl" | "twr"> ### `Optional`changeFlags changeFlags?: Set< | "loseDexToAC" | "lowLightVision" | "seeInDarkness" | "seeInvisibility" | "immuneToMorale" | "noMediumEncumbrance" | "noHeavyEncumbrance" | "mediumArmorFullSpeed" | "heavyArmorFullSpeed" | "noAblScore.str" | "noAblScore.dex" | "noAblScore.con" | "noAblScore.int" | "noAblScore.wis" | "noAblScore.cha", > ### `Optional`changes changes?: ItemChange[] ### `Optional`classSkills classSkills?: Set ### `Optional`contextNotes contextNotes?: ContextNote[] ### `Optional`description description?: { instructions?: string; summary?: string; value?: string } ### `Optional`flags flags?: { boolean?: {}; dictionary?: {} } ### `Optional`languages languages?: Set ### `Optional`links links?: { children?: LinkModel[]; supplements?: LinkModel[] } ### `Optional`parent parent?: ItemPF ### `Optional`scriptCalls scriptCalls?: ItemScriptCall[] ### `Optional`subType subType?: string ### `Optional`tag tag?: string ### `Optional`weaponProf weaponProf?: Trait<"simple" | "siege" | "martial" | "firearm" | "heavy"> ### activeState * get activeState(): boolean Active state as per what setActive would correspond with. #### Returns boolean ### autoDeductCharges * get autoDeductCharges(): boolean Consumes are adds charges by default. #### Returns boolean ### canUse * get canUse(): boolean Is this item usable at base level, disregarding per-action details. #### Returns boolean ### charges * get charges(): number Remaining charges #### Returns number ### hasFiniteCharges * get hasFiniteCharges(): boolean Finite charges #### Returns boolean ### isActive * get isActive(): boolean Is Active This returns composite result of if the item is equipped, has quantity, is not disabled, is not out of charges, etc. and is not representative if the item can be set active or not via setActive. #### Returns boolean #### See activeState ### isCharged * get isCharged(): boolean #### Returns boolean ### `Abstract`isPhysical * get isPhysical(): boolean Is this a physical item? #### Returns boolean ### isSingleUse * get isSingleUse(): boolean #### Returns boolean ### maxCharges * get maxCharges(): number Maximum possible charges this item can have. #### Returns number #### Remarks * Can return zero. Usually signifying something has reduced the potential uses below usability. * Can return infinity, signifying lack of limits. ### `Static`isPhysical * get isPhysical(): boolean Is this a physical item? #### Returns boolean ### `Abstract`_activeStateChange * _activeStateChange(changed: object): boolean `Internal` `Experimental` Return active state change from data if present This is a hack to allow item-type agnostic active state change detection. #### Parameters * changed: object #### Returns boolean ### _chargePreUpdate * _chargePreUpdate(changed: object, context: object): Promise `Internal` Handle charge update sanity checking, constraining them to reasonable values, and propagating to parent items if charges are shared. #### Parameters * changed: object Changed data * context: object Context #### Returns Promise ### _prepareTraits * _prepareTraits(): void `Internal` #### Returns void ### `Protected`_rechargeActions * _rechargeActions( options?: { exact: boolean; period?: string; rollData?: object }, ): object | undefined `Protected` Update action limited uses {@inheritDoc ItemPF.recharge} #### Parameters * options: { exact: boolean; period?: string; rollData?: object } = {} Options * ##### exact: boolean Exact time period only * ##### `Optional`period?: string Recharge only if matching this time period * ##### `Optional`rollData?: object Roll data #### Returns object | undefined * Update data or undefined if no update is needed. ``` -------------------------------- ### Get Default Actor Artwork Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorHauntPF An internal static method to add default artwork to actor data. It can optionally use provided actor data to guide the creation process. The method returns an object containing the resulting data alterations. ```javascript getDefaultArtwork({ name: "New Actor" }); ``` -------------------------------- ### Get Default Artwork - Pathfinder 1e Actor API Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorTrapPF Internal static method to add default artwork to actor data. It can optionally use provided actor data to guide the artwork creation. Returns an object containing the resulting data alterations. ```javascript await Actor.getDefaultArtwork(actorData); ``` -------------------------------- ### Get Raw Effect Data (Pathfinder 1e) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemImplantPF Generates the starting data for an ActiveEffect based on the current item. This is an asynchronous method that may accept an options object containing `rollData`. It returns a Promise that resolves to an object representing the ActiveEffect creation data. ```javascript const effectData = await item.getRawEffectData({ rollData: rollData }); ``` -------------------------------- ### ActionUse Class Documentation Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.actionUse.ActionUse Documentation for the ActionUse class, which handles the usage of actions in Pathfinder 1e for Foundry VTT. ```APIDOC ## Class ActionUse ### Description Represents the usage of an action within the Pathfinder 1e system for Foundry VTT. ### Constructor #### `new ActionUse(shared: Partial): ActionUse` Initializes a new instance of the `ActionUse` class. **Parameters** * `shared` (Partial) - Required - The shared context for this action use. ### Properties * **`action`** (Action) - The action this action use is based on. * **`actor`** (ActorPF) - The actor this action use is based on. * **`formData`** ({}) - Optional - Form data associated with the action. * **`item`** (ItemPF) - The item this action use is based on. * **`shared`** (SharedActionData) - The shared data object holding all relevant data for this action use. * **`token`** (TokenDocument) - The token associated with the actor. ### Accessors * **`rollData`** (object) - Returns the roll data associated with this action use. ### Methods * **`_getConditionalParts(atk: ActionUseAttack, index?: number): ConditionalParts`** Determines conditional parts used in a specific attack. **Parameters** * `atk` (ActionUseAttack) - The attack used. * `index` (number) - Optional - The index of the attack, in order of enabled attacks. **Returns** ConditionalParts - The conditional parts used. * **`addAttacks(): Promise`** Adds ChatAttack entries to an attack's shared context. * **`addCombatPropertyLabels(): string[]`** Adds combat property labels to an attack's chat card. **Returns** string[] - The resulting property labels. **Todo** Object format * **`addDamage(): Promise`** Adds a ChatAttack entry for damage to an attack's shared context. * **`addEffectNotes(): Promise`** Add effect notes for each individual attack. * **`addEmptyAttack(): Promise`** Adds an empty attack entry. * **`addFootnotes(): Promise`** Adds footnotes to the action. * **`addGenericPropertyLabels(): string[]`** Adds generic property labels to an attack's chat card. **Returns** string[] - The resulting property labels. **Todo** Object format * **`alterRollData(formData?: object): void`** Alters roll (and shared) data based on user input during the attack's dialog. **Parameters** * `formData` (object) - Optional - The attack dialog's form data. * **`autoSelectAmmo(): Promise`** Automatically selects ammunition for the action. * **`checkAttackRequirements(): number | Promise`** Checks all requirements to make the attack. This is after the attack dialog's data has been parsed. **Returns** number | Promise - 0 if successful, otherwise one of the ERR_REQUIREMENT constants. * **`checkRequirements(): Promise`** Checks the requirements for the action. **Returns** Promise - 0 when successful, otherwise one of the ERR_REQUIREMENT constants. * **`enrichEffectNotes(): Promise`** Enrich effect notes. * **`enrichNotes(notes: string[], title: string, css: string): Promise`** Enrich notes with provided title and CSS. **Parameters** * `notes` (string[]) - Notes to enrich. * `title` (string) - Notes section title. * `css` (string) - CSS selectors. **Returns** Promise - Enriched HTML as text. * **`executeScriptCalls(category?: "use" | "postUse"): Promise`** Executes the item's script calls. **Parameters** * `category` ("use" | "postUse") - Optional - Script call category. Defaults to "use". * **`generateAttacks(forceFullAttack?: boolean): AttackData[]`** Generates attacks for an item's action. **Parameters** * `forceFullAttack` (boolean) - Optional - Generate full attack data, e.g. as base data for an ActionDialog. Defaults to false. **Returns** AttackData[] - The generated default attacks. * **`generateChatAttacks(): Promise`** Generates ChatAttack entries based off the attack type. * **`generateChatMetadata(): object`** Generates metadata for this attack for the chat card to store. **Returns** object - The resulting metadata object. * **`getAmmo(): AttackAmmo[]`** Fetch valid ammo items from actor. **Returns** AttackAmmo[] - Available ammo options. ``` -------------------------------- ### onSkillContextMenu Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/functions/pf1.chat.enrichers.onSkillContextMenu Handles the context menu event for skills in the Pathfinder 1e system. ```APIDOC ## Function onSkillContextMenu ### Description Handles the context menu event for skills, allowing for custom actions when a skill is right-clicked. ### Method N/A (This is a game system function, not a REST API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example N/A ### Response #### Success Response This function returns void, indicating no specific value is returned. #### Response Example N/A ``` -------------------------------- ### Get Item Labels and Name Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.AttackModel Protected method to get item labels, potentially in an isolated context or with roll data. Also provides a method to get the visible item name, with an option to retrieve the player-facing name. ```typescript /** * Protected: Called by () * @param labels * @param options * @returns void */ getLabels( labels: object, options?: { isolated?: boolean; rollData?: object }, ): void; /** * Visible item name * @param asPlayer If true, return value players see. * @returns Item name */ getName(asPlayer?: boolean): string; ``` -------------------------------- ### Registry Method: setup (Protected Abstract) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.registry.Conditions A protected abstract method intended for post-registry initialization entry preparation. Subclasses must implement this method. ```typescript setup(): void ``` -------------------------------- ### initData Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorTrapPF Performs initialization tasks before system or document prepareBaseData() is called. ```APIDOC ## POST /actors/{actorId}/initData ### Description Initialization before system or document prepareBaseData() is called. ### Method POST ### Endpoint /actors/{actorId}/initData ### Parameters #### Path Parameters - **actorId** (string) - Required - The ID of the actor. ### Response #### Success Response (200) - **void** - Indicates successful initialization. #### Response Example ```json null ``` ``` -------------------------------- ### Override Drag Start Event Handler - _onDragStart Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.item.ItemSheetPF Overrides the default drag start event handler. This internal method takes a DragEvent and returns void. It is used to customize drag start behavior. ```typescript _onDragStart(event: DragEvent): void `Internal` Override of drag start event handler #### Parameters * event: DragEvent #### Returns void ``` -------------------------------- ### Example: Enable Actor Condition (Dazzled) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorBasePF An example demonstrating how to enable the 'dazzled' condition on an actor. ```javascript await actor.setCondition("dazzled", true); ``` -------------------------------- ### Example: Check Actor Condition (Grappled) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorBasePF An example showing how to test if an actor is currently 'grappled'. ```javascript actor.hasCondition("grappled"); ``` -------------------------------- ### Setup Filter Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.CheckboxFilter Prepares the filter for use after the compendium browser has gathered its entries. This asynchronous method ensures all necessary preparations are complete before the filter is active. ```typescript setup(): Promise ``` -------------------------------- ### _prepareSenseLabels Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.actor.ActorSheetPFNPC Prepares sense labels. ```APIDOC ## _prepareSenseLabels ### Description Prepares sense labels. ### Method Internal ### Endpoint N/A (Internal Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return value** ({}) - An empty object, likely a placeholder. #### Response Example ```json { "labels": {} } ``` ``` -------------------------------- ### Get Item Charge Information Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.AttackModel Retrieves the maximum possible charges an item can hold, which can be zero or infinite. Also provides methods to get the default charge cost and formula. ```typescript /** * Maximum possible charges this item can have. * @returns number * @remarks Can return zero, signifying reduced usability, or infinity, signifying lack of limits. */ get maxCharges(): number; /** * Get default charge cost for all actions. * @param options Additional options * @returns Number for default cost. */ getDefaultChargeCost(options?: { rollData?: object }): number; /** * Default charge formula. * @returns Charge formula */ getDefaultChargeFormula(): string; ``` -------------------------------- ### Experimental Activate Simple Tooltip Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.actor.ActorSheetPFVehicle Activates a simple tooltip dynamically. This is an experimental method. ```APIDOC ## Experimental _onActivateSimpleTooltip ### Description Activates a simple tooltip dynamically. This is an experimental method. ### Method Experimental ### Endpoint N/A (Internal method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "event": "PointerEvent object", "target": "HTMLElement" } ``` ### Response #### Success Response (200) - **boolean**: True if the tooltip was activated, false otherwise. #### Response Example ```json true ``` ``` -------------------------------- ### HelpBrowserPF Singleton Instance Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/variables/pf1.applications.helpBrowser Declares the singleton instance of `HelpBrowserPF` available at runtime. This variable provides access to the help browser functionality within the Pathfinder 1e system. ```typescript declare const helpBrowser: HelpBrowserPF; ``` -------------------------------- ### Filter Configuration and Setup Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.class.ClassTypeFilter API endpoints for managing filter configurations, including index fields, boolean operators, and initial setup. ```APIDOC ## Filter Configuration API ### registerIndexFields #### Description Registers the index fields used by this filter with the document's `CONFIG` object. This ensures that `CompendiumCollection#getIndex` includes the necessary fields for the filter to operate correctly. #### Method POST #### Endpoint /api/filters/{filterId}/index/register #### Parameters ##### Path Parameters - **filterId** (string) - Required - The unique identifier of the filter. #### Returns - **void** ### prepareBooleanOperator #### Description Prepares the boolean operator for the filter. This is typically called before applying filter logic. #### Method POST #### Endpoint /api/filters/{filterId}/operator/prepare #### Parameters ##### Path Parameters - **filterId** (string) - Required - The unique identifier of the filter. #### Returns - **void** ### setup #### Description Initializes and prepares the filter for use. This asynchronous method should be called after compendium entries have been gathered and expects the filter to be ready for interaction. #### Method POST #### Endpoint /api/filters/{filterId}/setup #### Parameters ##### Path Parameters - **filterId** (string) - Required - The unique identifier of the filter. #### Returns - **Promise** - A promise that resolves when the filter setup is complete. ### reset #### Description Resets all choices and controls within the filter to their default, inactive state. #### Method POST #### Endpoint /api/filters/{filterId}/reset #### Parameters ##### Path Parameters - **filterId** (string) - Required - The unique identifier of the filter. #### Returns - **void** ``` -------------------------------- ### Class CreateConsumablePrompt Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.item.CreateConsumablePrompt Documentation for the CreateConsumablePrompt class, which handles the creation of consumable items. ```APIDOC ## Class CreateConsumablePrompt ### Description Represents a prompt for creating consumable items in Pathfinder 1e for Foundry VTT. ### Hierarchy HandlebarsApplication & ApplicationV2 > CreateConsumablePrompt ## Constructors ### constructor ```typescript new CreateConsumablePrompt(options: any): CreateConsumablePrompt ``` #### Parameters * **options** (any) - Options for the constructor. ## Properties ### cl * **cl** (number) - Class identifier. ### identified * **identified** (boolean) - Indicates if the item is identified. ### sl * **sl** (number) - Spell level. ### uses * **uses** (number) - Number of uses for the consumable. ## Accessors ### item * **get item()**: ItemSpellPF * Returns the associated item spell. ### promise * **get promise()**: Promise * Returns a promise related to the item. ### type * **get type()**: string * Returns the type of the consumable. ## Methods ### _disableForm * **_disableForm()**: void * Disables the form associated with the prompt. ### _getPrice * **_getPrice(type: "potion" | "scroll" | "wand" | "scribe")**: any * Get price for consumable type. Rounds to standard currency precision. * #### Parameters * **type** ("potion" | "scroll" | "wand" | "scribe") - The type of consumable to get the price for. ### _onCreate * **`Protected` `Static` _onCreate(event: PointerEvent, target: HTMLElement)**: void * `Protected` method to handle the creation of a potion. * #### Parameters * **event** (PointerEvent) - The pointer event. * **target** (HTMLElement) - The target element. ### _onScribe * **`Protected` `Static` _onScribe(event: PointerEvent, target: HTMLElement)**: void * `Protected` method to handle the creation of a spell scroll. * #### Parameters * **event** (PointerEvent) - The pointer event. * **target** (HTMLElement) - The target element. ### wait * **`Static` wait(__namedParameters?: {{}}): Promise** * #### Parameters * **__namedParameters** ({}) - Named parameters (optional). ``` -------------------------------- ### Pathfinder 1e Player's Guide Data Structure Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.registry.Sources Defines the structure for Pathfinder 1e player's guide (pg) type content. Includes fields like _id, date, isbn, name, pages, publisher, type, and an optional url. This structure is used for player-focused guides. ```typescript { _id: "string"; date: "string"; isbn: "string"; name: "string"; pages: number; publisher: "string"; type: "pg"; url?: "string"; } ``` -------------------------------- ### Get Item Name Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.ConsumableModel Retrieves the visible name of the item. An optional boolean parameter can be used to get the name as it appears to players. ```typescript /** * Visible item name. * @param asPlayer - If true, return value players see. * @returns Item name */ getName(asPlayer?: boolean): string; ``` -------------------------------- ### Setup Filter Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.spell.SpellDescriptorFilter Prepares the filter for use, assuming that the compendium browser has already gathered its entries. This method should be called before the filter is actively used for filtering. ```typescript /** * Prepare the filter for use. * This step expects the compendium browser to have gathered its entries. * @returns A Promise that resolves when the filter is set up. */ setup(): Promise ``` -------------------------------- ### Compendium Browser - initializeBrowsers Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.SpellBrowser Initializes all CompendiumBrowsers found within the system and registers them. ```APIDOC ## initializeBrowsers ### Description Initialize all CompendiumBrowsers found in pf1.applications.compendiumBrowser and register them in pf1.applications.compendiums. ### Method N/A (This appears to be a static method or a utility function within a class context, not a direct HTTP endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example ```json { "status": "browsers initialized" } ``` ``` -------------------------------- ### Get Item Labels Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.ClassModel Called by other functions to get item labels. It accepts labels and optional named parameters, returning any. ```typescript getLabels(labels: any, __namedParameters?: {}): any ``` -------------------------------- ### Get Item Name Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.WeaponModel Retrieves the visible name of an item. An optional boolean parameter `asPlayer` can be used to get the name as players see it. ```typescript /** * Visible item name * @param asPlayer If true, return value players see. * @returns Item name */ getName(asPlayer?: boolean): string ``` -------------------------------- ### ActionDialog Class Documentation Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.ActionDialog Detailed documentation for the ActionDialog class, including its properties, accessors, and methods. ```APIDOC ## Class ActionDialog Action Dialog #### Hierarchy * HandlebarsApplication & ApplicationV2< RenderContext, Configuration, RenderOptions, this, > * ActionDialog ##### Index ## Properties ### ammoUsage `ammoUsage`: Record ### attributes `attributes`: { "attack-bonus": string; "cl-offset": string; d20: string; "damage-ability-multiplier": number | null; "damage-bonus": string; held?: "1h" | "2h" | "oh"; "measure-template-count": number; rangeIncrement: number; rangeIncrementPenalty?: number; rangePenalty?: number; rollMode: string; skipAttacks: number; "sl-offset": string; } ### base `base`: { cl: number; sl: number } ### conditionals `conditionals`: { [key: string]: { conditional: ItemConditional; enabled: boolean }; } ### flags `flags`: Flags | undefined ### rollData `rollData`: object & { action?: { held?: "1h" | "2h" | "oh" }; cl?: number; item?: { held?: "1h" | "2h" | "oh" }; sl?: number; } ### useOptions `useOptions`: UseOptions | undefined ### `Static`DEFAULT_FULL_ATTACK `DEFAULT_FULL_ATTACK`: boolean = true ## Accessors ### action * get action(): Action #### Returns Action ### actionUse * get actionUse(): ActionUse #### Returns ActionUse ### actor * get actor(): ActorPF #### Returns ActorPF ### attacks * get attacks(): ActionUseAttack[] #### Returns ActionUseAttack[] ### damageMult * get damageMult(): number | null #### Returns number | null ### item * get item(): ItemPF | undefined #### Returns ItemPF | undefined ### noPenaltyIncrements * get noPenaltyIncrements(): number `Experimental` Number of Increments with No Penalty #### Returns number ### object * get object(): Action #### Returns Action ### promise * get promise(): Promise #### Returns Promise ### shared * get shared(): SharedActionData #### Returns SharedActionData ## Methods ### _onChangeAttribute * _onChangeAttribute(event: PointerEvent, target: HTMLElement): void Change Attribute #### Parameters * event: PointerEvent * target: HTMLElement #### Returns void #### Todo Relabel ### _onToggleConditional * _onToggleConditional(event: PointerEvent, target: HTMLElement): void Toggle Conditional #### Parameters * event: PointerEvent * target: HTMLElement #### Returns void ### _onToggleFlag * _onToggleFlag(event: PointerEvent, target: HTMLElement, render?: boolean): void Toggle Flag #### Parameters * event: PointerEvent * target: HTMLElement * render: boolean = false Re-render after #### Returns void ### _onTogglePopover * _onTogglePopover(event: ToggleEvent): void Handle Popover (Ammo Menu) Toggling #### Parameters * event: ToggleEvent #### Returns void ### _resetExtraAttackVisualization * _resetExtraAttackVisualization(): void Reset Extra Attacks Visualization Undim extra attacks when single attack button hover ends #### Returns void ### _toggleExtraAttack * _toggleExtraAttack(type: any, enabled?: boolean): void #### Parameters * type: any * enabled: boolean = true #### Returns void ### _unfocusElements * _unfocusElements(event: PointerEvent): void Unfocus Elements This is called by every click to ensure ammo selection is closed. #### Parameters * event: PointerEvent #### Returns void ### _visualizeExtraAttacks * _visualizeExtraAttacks(): void Visualize Extra Attacks State Dim extra attacks when hovering single attack button #### Returns void ### getRangePenalty * getRangePenalty(): number `Experimental` Get Current Range Penalty #### Returns number * Penalty, 0 or higher ### initAmmoUsage * initAmmoUsage(): void #### Returns void ### initAttacks * initAttacks(): void #### Returns void ### setAttackAmmo * setAttackAmmo(attackIndex: number, ammoId?: string): void `Internal` Set ammo type attack at index #### Parameters * attackIndex: number * ammoId: string = null #### Returns void ### show * show(): Promise #### Returns Promise * Attack configuration object or null if rejected #### Deprecated ### `Static`wait * wait(actionUse: ActionUse, options?: object): Promise Initialize application and wait for its result. This simply initializes the application with provided options, renders it and returns `app.promise` #### Parameters * actionUse: ActionUse Action Use instance * `Optional`options: object = {} Application options ``` -------------------------------- ### Prepare Sense Labels Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.actor.ActorSheetPFVehicle Prepares labels for senses. ```APIDOC ## _prepareSenseLabels ### Description Prepares labels for senses. ### Method N/A (Internal method) ### Endpoint N/A (Internal method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **{}**: An empty object, likely a placeholder or indicating no specific data is returned directly. #### Response Example ```json {} ``` ``` -------------------------------- ### Get Item Name (Pathfinder 1e) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.item.ItemPhysicalPF Retrieves the name of the item. An optional boolean parameter can be provided to get the name as it appears to players. ```typescript item.getName(asPlayer?: boolean): string // Parameters: // asPlayer?: boolean = false - If true, return value players see. // Returns: Item name ``` -------------------------------- ### Example: Enable Actor Condition with Duration (Sleep) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.documents.actor.ActorBasePF An example showing how to enable the 'sleep' condition for 10 rounds (60 seconds) on an actor. ```javascript await actor.setCondition("sleep", { duration: { seconds: 60 } }); ``` -------------------------------- ### Internal Method: _onOpenChangeMenu Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.item.ItemSheetPF Opens a static tooltip for a Change. This is an internal method. ```APIDOC ## Internal Method: _onOpenChangeMenu ### Description Open static tooltip for a Change. This is an internal method. ### Method (Not specified, likely internal call) ### Endpoint (Not applicable, internal method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **event** (PointerEvent) - The triggering event. ### Request Example None ### Response #### Success Response - **Promise**: A promise that resolves when the menu is opened. ``` -------------------------------- ### Setup Filter Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.compendiumBrowser.filters.common.PackFilter Prepares the filter for use after the compendium browser has gathered its entries. This is an asynchronous operation that returns a Promise. ```typescript /** * Prepare the filter for use. This step expects the compendium browser to have gathered its entries. * @returns {Promise} */ setup(): Promise ``` -------------------------------- ### Get Armor Weight Multiplier (Internal) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.ConsumableModel Internal method to get the weight scaling multiplier for armor, used across different item types. ```typescript /** * `Internal` * Weight scaling * For use with () across item types * @returns {number} * @remarks Weight multiplier */ _getArmorWeightMultiplier(): number; ``` -------------------------------- ### Internal Method: _initializeActions Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.applications.item.ItemSheetPF Initializes actions. This is an internal method and is marked for removal with AppV2 conversion. ```APIDOC ## Internal Method: _initializeActions ### Description Initializes actions. This is an internal method and is marked for removal with AppV2 conversion. ### Method (Not specified, likely internal call) ### Endpoint (Not applicable, internal method) ### Parameters None ### Request Example None ### Response #### Success Response - **void**: This method does not return any value. ``` -------------------------------- ### Get Active State Change (Internal) Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.ConsumableModel Internal and experimental method to get the active state change from data. This is a hack for item-type agnostic active state detection. ```typescript /** * `Internal` `Experimental` * Return active state change from data if present * This is a hack to allow item-type agnostic active state change detection. * @param {any} changed - Changed data * @returns {any} */ _activeStateChange(changed: any): any; ``` -------------------------------- ### Get Item Proficiency and Roll Data Source: https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/classes/pf1.models.item.AttackModel Determines if the item's owner is proficient with it, specifically for weapons or armor, and throws an error if proficiency is not supported. Also includes a method to get data model-specific roll data. ```typescript /** * Get proficiency as a weapon. Armor otherwise. * @param weapon Get proficiency as a weapon. Armor otherwise. * @returns Whether or not the owner of the item is proficient. * @throws If item type does not support proficiency. * @since PF1 v10 */ getProficiency(weapon?: boolean): boolean; /** * DataModel specific roll data * @param result Roll data * @returns void */ getRollData(result: object): void; ```