Pathfinder 1e for Foundry VTT
    Preparing search index...

    The basic compendium browser class allowing the browsing of compendiums by utilising their indexes.

    Extending classes must define the following static properties if the browser is not meant to browse Item documents: documentName. Extending classes should define the following static properties: typeName, filterClasses.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _dragDrop: undefined | DragDrop
    _entries: undefined | null | IndexEntry[]
    constructor: typeof CompendiumBrowser
    entries: Collection<IndexEntry, Methods<IndexEntry>>

    The Collection of index entries this browser is aware of.

    expandedFilters: Set<string> = ...

    A set of filters that were expanded by the user, and should stay expanded upon re-render.

    filters: Collection<BaseFilter, Methods<BaseFilter>> = ...

    The set of filters to apply to the compendium index.

    handledTypes: Set<string> = ...

    The types of entries this browser handles, as per a document's type property.

    packs: CompendiumCollection<any>[] = []

    Compendium packs this browser gets entries from.

    sort: { direction: "desc" | "asc"; order: string } = ...

    The current sort order and direction for the entries in the browser.

    worldContent: boolean = true

    Include world content

    _query: undefined | string
    BROWSERS: {} = {}

    Known browsers.

    Initialized in initializeBrowsers

    DEFAULT_OPTIONS: {
        actions: {
            changeDisplayModeGrid: () => void;
            changeDisplayModeList: () => void;
            changeSortDirection: (...this: any, _event: Event) => void;
            clearFilter: (event: PointerEvent, button: HTMLElement) => void;
            reloadPacks: Object;
            resetFilters: Object;
        };
        classes: string[];
        id: string;
        position: { height: number; left: number; top: number; width: number };
        tag: string;
        window: {
            controls: {
                action: string;
                icon: string;
                label: string;
                visible: () => boolean;
            }[];
            icon: string;
            resizable: boolean;
        };
    } = ...
    documentName: "Actor" | "Item" = "Item"

    The document name of entries this browser displays.

    StaticENTRY_TEMPLATE

    ENTRY_TEMPLATE: string = "systems/pf1/templates/apps/compendium-browser/entries.hbs"

    The template used to render individual entries in the browser.

    filterClasses: (typeof PackFilter | typeof SourceFilter)[] = ...

    An array of classes extending BaseFilter that should be used for this browser.

    PARTS: { form: { scrollable: string[]; template: string; templates: string[] } } = ...
    PURGE_DELAY: number = 30_000

    Delay after closing until internal cache is purged

    Default to 30 seconds.

    Low delay since most of the heavy processing is actually fetching the indexes which has already happened.

    sortOrders: { [key: string]: string } = ...

    The columns used for sorting entries in the browser.

    typeName: string = "PF1.Races"

    A localisation string used in the browser's title.

    Accessors

    • get title(): any

      Returns any

    Methods

    • Internal Experimental

      Enable queued filters

      Returns void

    • Parameters

      • _selector: any

      Returns boolean

    • Protected

      Get the set of ContextMenu options which should be used for the compendium browser's entries.

      Returns object[]

      • The Array of ContextMenu options
    • Parameters

      • html: HTMLElement

      Returns void

    • Initialize configuration options for the Application instance. The default behavior of this method is to intelligently merge options for each class with those of their parents.

      • Array-based options are concatenated
      • Inner objects are merged
      • Otherwise, properties in the subclass replace those defined by a parent

      Parameters

      • options: any

        Options provided directly to the constructor

      Returns any

      Configured options for the application instance

    • Protected

      Obfuscate Physical Item information if unidentified

      Parameters

      • result: any
      • item: any

      Returns void

    • Protected

      Form Change Event

      Parameters

      • ...this: any
      • _formConfig: ApplicationFormConfiguration

        The configuration of the form being changed

      • event: Event

        The triggering event

      Returns Promise<void>

    • Actions performed after closing the Application. Post-close steps are not awaited by the close process.

      Parameters

      • options: any

        Provided render options

      Returns void

    • Parameters

      • event: any

      Returns void

    • Parameters

      • context: any
      • options: any

      Returns void

    • Parameters

      • partId: any
      • context: any
      • options: any

      Returns Promise<any>

    • Parameters

      • context: any
      • options: any

      Returns Promise<void>

    • Parameters

      • partId: string
      • newElement: HTMLElement
      • priorElement: HTMLElement
      • state: object

      Returns void

    • Internal Experimental

      Queue filters to be processed by _activateFilterQueue

      Only one filter bundle is ever queued.

      Parameters

      • filters: object

      Returns void

    • Returns void

    • Internal

      Add global listeners

      Comprehensive listeners for ensuring the drag end event is caught.

      Returns void

    • Parameters

      • partId: string
      • newElement: HTMLElement
      • priorElement: HTMLElement
      • state: object

      Returns void

    • Protected

      Create pseudo-index of world documents

      Returns Generator<IndexEntry, void, unknown>

    • Protected

      Perform minimal preparation steps to initialize the compendium browser. Add filters and determine which compendiums include data relevant to this browser.

      Returns void

    • Check whether a compendium should be included in the browser.

      Parameters

      • pack: CompendiumCollection<any>

        The compendium to test

      Returns boolean

      Whether the compendium should be included

    • Protected

      Load a compendium's index to prepare it for browsing.

      Parameters

      • pack: CompendiumCollection<any>

        The compendium to load

      Returns Promise<IndexEntry[]>

      The loaded index entries

    • 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<void>

    • Map an entry from a compendium to the format used by the browser.

      Parameters

      • entry: object

        The entry to map

      • pack: CompendiumCollection<any>

        The compendium the entry is from

      Returns IndexEntry

      The mapped entry

    • Protected

      Flip the current sort direction.

      Parameters

      • ...this: any
      • _event: Event

        The triggering event

      Returns void

    • Protected

      Clear singular filter

      Parameters

      • event: PointerEvent
      • button: HTMLElement

      Returns void

    • Prepare indexing

      Returns void

    • Request indexes of all packs of a document type to be loaded. This method should only ever be called as CompendiumBrowser.getIndexes to ensure Promises are properly bundled.

      Parameters

      • packNames: string[] = []

        The names of the packs to load indexes for

      Returns Promise<void>

      A Promise that resolves once all indexes have been loaded

      CompendiumBrowser.#indexingPromise

    • Internal

      Fill BROWSERS

      Called in init hook.

      Returns void