The Base Registry class, providing shared functionality for all registries in the system.

Abstract

Hierarchy

Constructors

Properties

model: any = null

The class each of this registry's content is expected to be an instance of.

PREFIXES: {
    companion: string;
} = ...

Book type prefix

Type declaration

  • companion: string
_defaultData: ({
    _id: string;
    abbr: string;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy: boolean;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn?: undefined;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy: boolean;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn: string;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn?: undefined;
    legacy?: undefined;
    level: number;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level: number;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy: boolean;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy: boolean;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn: string;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr: string;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn: string;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr: string;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages?: undefined;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr: string;
    date: string;
    isbn: string;
    legacy: boolean;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr: string;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn?: undefined;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher: string;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn: string;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher: string;
    tieIn?: undefined;
    type: string;
    url: string;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn?: undefined;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher: string;
    tieIn?: undefined;
    type: string;
    url?: undefined;
} | {
    _id: string;
    abbr?: undefined;
    date: string;
    isbn?: undefined;
    legacy?: undefined;
    level?: undefined;
    name: string;
    pages: number;
    publisher?: undefined;
    tieIn?: undefined;
    type: string;
    url?: undefined;
})[] = ...

An array of data used to initialise this registry.

model: typeof Source = Source

The class each of this registry's content is expected to be an instance of.

Accessors

Methods

  • Returns an object of the registry's contents, with the id as key and the name as value.

    Returns {
        [id: string]: string;
    }

    The names of each value in the registry, by id

    • [id: string]: string
  • Registers a new instance of Model with the registry, using a partial of its data as the base.

    Parameters

    • namespace: string

      The namespace for which this value is registered.

    • id: string

      The unique key of the value.

    • value: object

      A Partial of the data to use as the base for the new value.

    Returns Registry<any>

    The registry itself, after the value has been registered.

    Example

    pf1.registry.damageTypes.register("my-module", "my-damage-type", {
    name: "My Damage Type",
    img: "icons/svg/damage.svg",
    category: "physical",
    });
  • Returns the contents of this registry as object, using ids as keys.

    Parameters

    • Optional source: boolean = false

      Whether to include the source data instead of its prepared data for each value.

    Returns {
        [id: string]: object;
    }

    The data of each value in the registry, by id

    • [id: string]: object
  • Unregisters a value from the registry, or if no id is provided, all values belonging to the namespace.

    Parameters

    • namespace: string

      The namespace for which this value is unregistered.

    • Optional id: string

      The unique key of the value, or undefined to unregister all values belonging to the namespace.

    Returns void

Generated using TypeDoc