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.

Abstract

Hierarchy

Constructors

Properties

#setup: boolean = false

Whether the browser and its data have been set up using CompendiumBrowser.setup.

_debouncedRender: ((...args) => void)

Type declaration

    • (...args): void
    • Wrap a callback in a debounced timeout. Delay execution of the callback function until the function has not been called for delay milliseconds

      Parameters

      • Rest ...args: [force?: boolean, options?: RenderOptions<ApplicationOptions>]

      Returns void

      A wrapped function which can be called to debounce execution

_entries: undefined | IndexEntry[]
_loadingInfo: null | object = null

An object containing data used to render the loading spinner and related text.

_query: string = ""

The current search query entered by the user.

_refocus: boolean = true
entries: Collection<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> = ...

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.

#indexingPromises: Map<string, Promise<void>> = ...

A Promise that resolves once all pack indexes have been loaded.

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

The template used to render individual entries in the browser.

documentName: "Actor" | "Item" = "Item"

The document name of entries this browser displays.

Abstract

filterClasses: typeof BaseFilter[] = []

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

typeName: string

A localisation string used in the browser's title.

Abstract

Accessors

  • get defaultOptions(): InsertKeys<{
        baseApplication: null | string;
        classes: string[];
        dragDrop: {
            dragSelector: string;
            dropSelector: null;
        }[];
        filters: Omit<SearchFilterConfiguration, "callback">[];
        height: number;
        id: string;
        left: number;
        minimizable: boolean;
        popOut: boolean;
        resizable: boolean;
        scale: null | number;
        scrollY: string[];
        tabs: Omit<TabsConfiguration, "callback">[];
        template: string;
        title: string;
        top: number;
        width: number;
    }, OmitByValue<{
        classes: string[];
        dragDrop: {
            dragSelector: string;
            dropSelector: null;
        }[];
        height: number;
        id: string;
        left: number;
        resizable: boolean;
        scrollY: string[];
        template: string;
        top: number;
        width: number;
    }, never>>
  • Returns InsertKeys<{
        baseApplication: null | string;
        classes: string[];
        dragDrop: {
            dragSelector: string;
            dropSelector: null;
        }[];
        filters: Omit<SearchFilterConfiguration, "callback">[];
        height: number;
        id: string;
        left: number;
        minimizable: boolean;
        popOut: boolean;
        resizable: boolean;
        scale: null | number;
        scrollY: string[];
        tabs: Omit<TabsConfiguration, "callback">[];
        template: string;
        title: string;
        top: number;
        width: number;
    }, OmitByValue<{
        classes: string[];
        dragDrop: {
            dragSelector: string;
            dropSelector: null;
        }[];
        height: number;
        id: string;
        left: number;
        resizable: boolean;
        scrollY: string[];
        template: string;
        top: number;
        width: number;
    }, never>>

Methods

  • 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

    See

    CompendiumBrowser.#indexingPromise

Generated using TypeDoc