Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions - Mixins

Functions - Other

Variables

Classes - Applications

Classes - Canvas

Classes - Collections

Classes - Documents

Classes - Other

Classes - Packages

Namespaces

Interfaces

Type Aliases

Modules

- Mixins Functions

  • ClientPackageMixin(BasePackage: any): any
  • A client-side mixin used for all Package types.

    Parameters

    • BasePackage: any

      The parent BasePackage class being mixed

    Returns any

    A BasePackage subclass mixed with ClientPackage features

  • CanvasDocumentMixin(arg0: any): any
  • A specialized sub-class of the ClientDocumentMixin which is used for document types that are intended to be represented upon the game Canvas.

    Parameters

    • arg0: any

    Returns any

  • ClientDocumentMixin(arg0: Class): any
  • A mixin which extends each Document definition with specialized client-side behaviors. This mixin defines the client-side interface for database operations and common document behaviors.

    mixin

    Parameters

    • arg0: Class

    Returns any

  • BaseCanvasMixin(ContainerClass: any): ((ContainerClass: any) => (ContainerClass: any) => ...)
  • A mixin which decorates any container with base canvas common properties.

    Parameters

    • ContainerClass: any

      The parent Container class being mixed.

    Returns ((ContainerClass: any) => (ContainerClass: any) => ...)

    A ContainerClass subclass mixed with BaseCanvasMixin features.

      • (ContainerClass: any): (ContainerClass: any) => ...
      • A mixin which decorates any container with base canvas common properties.

        category
        • Mixins

        Parameters

        • ContainerClass: any

          The parent Container class being mixed.

        Returns (ContainerClass: any) => ...

        A ContainerClass subclass mixed with BaseCanvasMixin features.

  • PrimaryCanvasObjectMixin(DisplayObject: any): any
  • A mixin which decorates a DisplayObject with additional properties expected for rendering in the PrimaryCanvasGroup.

    Parameters

    • DisplayObject: any

      The parent DisplayObject class being mixed

    Returns any

    A DisplayObject subclass mixed with PrimaryCanvasObject features

  • BaseShaderMixin(ShaderClass: any): ((ShaderClass: any) => (ShaderClass: any) => ...)
  • A mixin which decorates a PIXI.Filter or PIXI.Shader with common properties.

    Parameters

    • ShaderClass: any

      The parent ShaderClass class being mixed.

    Returns ((ShaderClass: any) => (ShaderClass: any) => ...)

    A Shader/Filter subclass mixed with BaseShaderMixin features.

      • (ShaderClass: any): (ShaderClass: any) => ...
      • A mixin which decorates a PIXI.Filter or PIXI.Shader with common properties.

        category
        • Mixins

        Parameters

        • ShaderClass: any

          The parent ShaderClass class being mixed.

        Returns (ShaderClass: any) => ...

        A Shader/Filter subclass mixed with BaseShaderMixin features.

  • AdaptiveFragmentChannelMixin(ShaderClass: any): ((ShaderClass: any) => (ShaderClass: any) => ...)
  • A mixin wich decorates a shader or filter and construct a fragment shader according to a choosen channel.

    Parameters

    • ShaderClass: any

      The parent ShaderClass class being mixed.

    Returns ((ShaderClass: any) => (ShaderClass: any) => ...)

    A Shader/Filter subclass mixed with AdaptiveFragmentChannelMixin.

      • (ShaderClass: any): (ShaderClass: any) => ...
      • A mixin wich decorates a shader or filter and construct a fragment shader according to a choosen channel.

        category
        • Mixins

        Parameters

        • ShaderClass: any

          The parent ShaderClass class being mixed.

        Returns (ShaderClass: any) => ...

        A Shader/Filter subclass mixed with AdaptiveFragmentChannelMixin.

- Other Functions

  • saveDataToFile(data: string, type: string, filename: string): void
  • Export data content to be saved to a local file

    Parameters

    • data: string

      Data content converted to a string

    • type: string

      The type of

    • filename: string

      The filename of the resulting download

    Returns void

  • readTextFromFile(file: File): Promise<string>
  • Read text data from a user provided File object

    Parameters

    • file: File

      A File object

    Returns Promise<string>

    A Promise which resolves to the loaded text data

  • fromUuid(uuid: string, relative: Document): Promise<Document>
  • Retrieve a Document by its Universally Unique Identifier (uuid).

    Parameters

    • uuid: string

      The uuid of the Document to retrieve.

    • relative: Document

    Returns Promise<Document>

    Returns the Document if it could be found, otherwise null.

  • fromUuidSync(uuid: string, relative: Document): any
  • Retrieve a Document by its Universally Unique Identifier (uuid) synchronously. If the uuid resolves to a compendium document, that document's index entry will be returned instead.

    throws

    If the uuid resolves to a Document that cannot be retrieved synchronously.

    Parameters

    • uuid: string

      The uuid of the Document to retrieve.

    • relative: Document

    Returns any

    The Document or its index entry if it resides in a Compendium, otherwise null.

  • getDocumentClass(documentName: string): any
  • Return a reference to the Document class implementation which is configured for use.

    Parameters

    • documentName: string

      The canonical Document name, for example "Actor"

    Returns any

    The configured Document class implementation

  • getTemplate(path: string, id: string): Promise<Function>
  • Get a template from the server by fetch request and caching the retrieved result

    Parameters

    • path: string

      The web-accessible HTML template URL

    • id: string

    Returns Promise<Function>

    A Promise which resolves to the compiled Handlebars template

  • loadTemplates(paths: any): Promise<Function[]>
  • Load and cache a set of templates by providing an Array of paths

    example

    Loading a list of templates.

    await loadTemplates(["templates/apps/foo.html", "templates/apps/bar.html"]);
    
    <!-- Include a pre-loaded template as a partial -->
    {{> "templates/apps/foo.html" }}
    example

    Loading an object of templates.

    await loadTemplates({
    foo: "templates/apps/foo.html",
    bar: "templates/apps/bar.html"
    });
    <!-- Include a pre-loaded template as a partial -->
    {{> foo }}

    Parameters

    • paths: any

      An array of template file paths to load, or an object of Handlebars partial IDs to paths.

    Returns Promise<Function[]>

  • renderTemplate(path: string, data: any): Promise<string>
  • 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.

    see

    https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access

    Parameters

    • path: string

      The file path to the target HTML template

    • data: any

      A data object against which to compile the template

    Returns Promise<string>

    Returns the compiled and rendered template as a string

  • srcExists(src: string): Promise<boolean>
  • Test whether a file source exists by performing a HEAD request against it

    Parameters

    • src: string

      The source URL or path to test

    Returns Promise<boolean>

    Does the file exist at the provided url?

  • getTexture(src: string): Texture
  • Get a single texture from the cache

    Parameters

    • src: string

    Returns Texture

  • loadTexture(src: string, [options]?: { fallback: string }): any
  • Load a single texture and return a Promise which resolves once the texture is ready to use

    Parameters

    • src: string

      The requested texture source

    • [options]: { fallback: string } = {}

      Additional options which modify texture loading

      • fallback: string

    Returns any

    The loaded Texture, or null if loading failed with no fallback

  • Parse a UUID into its constituent parts.

    Parameters

    • uuid: string

      The UUID to parse.

    • relative: Document

    Returns ResolvedUUID

    Returns the Collection and the Document ID to resolve the parent document, as well as the remaining Embedded Document parts, if any.

  • _resolveEmbedded(parent: Document, parts: string[]): Document
  • Resolve a series of embedded document UUID parts against a parent Document.

    Parameters

    • parent: Document

      The parent Document.

    • parts: string[]

      A series of Embedded Document UUID parts.

    Returns Document

    The resolved Embedded Document.

  • _resolveRelativeUuid(uuid: string, relative: Document): ResolvedUUID
  • Resolve a UUID relative to another document. The general-purpose algorithm for resolving relative UUIDs is as follows:

    1. If the number of parts is odd, remove the first part and resolve it against the current document and update the current document.
    2. If the number of parts is even, resolve embedded documents against the current document.

    Parameters

    • uuid: string

      The UUID to resolve.

    • relative: Document

      The document to resolve against.

    Returns ResolvedUUID

Variables

vtt: string = ...

The string prefix used to prepend console logging

game: Game = ...

The singleton Game instance

PACKAGE_TYPES: { world: typeof World; system: typeof System; module: typeof Module } = ...

Type declaration

_appId: number = 0

A namespace containing the user interface applications which are defined throughout the Foundry VTT ecosystem.

namespace

applications

_maxZ: number = 100
MIN_WINDOW_WIDTH: 200 = 200
MIN_WINDOW_HEIGHT: 50 = 50
twist: MersenneTwister = ...
BLEND_MODES: typeof BLEND_MODES = {}
TabsV2: typeof Tabs = Tabs
CONFIG: any = ...

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 Aliases

MODIFIER_KEYS: string

Type Parameters

    MODIFIER_CODES: string[]

    Type Parameters

      TOOLTIP_DIRECTIONS: string

      Type Parameters

        STATUS: string

        Type Parameters

          WorkerTask: Object<string, (*)>

          Type Parameters

            WORKER_TASK_ACTIONS: string

            Type Parameters

              RENDER_STATES: number

              Type Parameters

                ApplicationHeaderButton: { label: string; class: string; icon: string; onclick: Function | null }

                Type Parameters

                  Type declaration

                  • label: string
                  • class: string
                  • icon: string
                  • onclick: Function | null
                  FormApplicationOptions: ApplicationOptions

                  Type Parameters

                    DocumentSheetOptions: FormApplicationOptions

                    Type Parameters

                      ClientDocument: abstract.Document

                      Type Parameters

                        INDICES: number

                        Type Parameters

                          CanvasAnimationData: CanvasAnimationOptions

                          Type Parameters

                            INTERACTION_STATES: number

                            Type Parameters

                              PulsePingOptions: PingOptions

                              Type Parameters

                                CREATION_STATES: number

                                Type Parameters

                                  STATES: number

                                  Type Parameters

                                    CanvasVisionContainer: PIXI.Container

                                    Type Parameters

                                      VertexMap: Map<number, PolygonVertex>

                                      Type Parameters

                                        EdgeSet: Set<PolygonEdge>

                                        Type Parameters

                                          ClockwiseSweepPolygonConfig: PointSourcePolygonConfig

                                          Type Parameters

                                            PolygonRay: Ray

                                            Type Parameters

                                              colors: Color

                                              Type Parameters

                                                weights: number

                                                Type Parameters

                                                  DETECTION_TYPES: number

                                                  Type Parameters

                                                    FLAGS: { propagate: string[]; reset: string[] }

                                                    Type Parameters

                                                      Type declaration

                                                      • propagate: string[]
                                                      • reset: string[]
                                                      COMPATIBILITY_MAPPING: string

                                                      Type Parameters

                                                        LIGHTING_LEVELS: number

                                                        Type Parameters

                                                          LIGHTING_VISIBILITY: number

                                                          Type Parameters

                                                            SHAPE_TYPES: string

                                                            Type Parameters

                                                              ROOF_TYPES: number

                                                              Type Parameters

                                                                TokenPosition: Point

                                                                Type Parameters

                                                                  LightSourceData: Object

                                                                  Type Parameters

                                                                    FILTER_MODES: number

                                                                    Type Parameters

                                                                      POST_PROCESS_TECHNIQUES: { id: string; glsl: string }

                                                                      Type Parameters

                                                                        Type declaration

                                                                        • id: string
                                                                        • glsl: string
                                                                        ContextMenuCallback: ((target: HTMLElement) => any)

                                                                        Type Parameters

                                                                          Type declaration

                                                                            • (target: HTMLElement): any
                                                                            • Type Parameters

                                                                                Parameters

                                                                                • target: HTMLElement

                                                                                Returns any

                                                                            DialogOptions: ApplicationOptions

                                                                            Type Parameters

                                                                              FilePickerOptions: ApplicationOptions

                                                                              Type Parameters

                                                                                HTMLSecretContentCallback: ((secret: HTMLElement) => string)

                                                                                Type Parameters

                                                                                  Type declaration

                                                                                    • (secret: HTMLElement): string
                                                                                    • Type Parameters

                                                                                        Parameters

                                                                                        • secret: HTMLElement

                                                                                        Returns string

                                                                                    HTMLSecretUpdateCallback: ((secret: HTMLElement, content: string) => Promise<ClientDocument>)

                                                                                    Type Parameters

                                                                                      Type declaration

                                                                                        • Type Parameters

                                                                                            Parameters

                                                                                            • secret: HTMLElement
                                                                                            • content: string

                                                                                            Returns Promise<ClientDocument>

                                                                                        SidebarDirectoryOptions: ApplicationOptions

                                                                                        Type Parameters

                                                                                          AdventureContentTreeRoot: AdventureContentTreeNode

                                                                                          Type Parameters

                                                                                            SORT_TYPES: string

                                                                                            Type Parameters

                                                                                              FONT_TYPES: string

                                                                                              Type Parameters

                                                                                                ImagePopoutOptions: FormApplicationOptions

                                                                                                Type Parameters

                                                                                                  VIEW_MODES: number

                                                                                                  Type Parameters

                                                                                                    OWNERSHIP_ICONS: string

                                                                                                    Type Parameters

                                                                                                      JournalSheetOptions: DocumentSheetOptions

                                                                                                      Type Parameters

                                                                                                        ChatBubbleOptions: Option

                                                                                                        Type Parameters

                                                                                                          DrawingConfigOptions: FormApplicationOptions

                                                                                                          Type Parameters

                                                                                                            WorldConfigOptions: FormApplicationOptions

                                                                                                            Type Parameters

                                                                                                              MESSAGE_PATTERNS: RegExp

                                                                                                              Type Parameters

                                                                                                                ChatLogOptions: ApplicationOptions

                                                                                                                Type Parameters

                                                                                                                  AV_MODES: number

                                                                                                                  Type Parameters

                                                                                                                    VOICE_MODES: string

                                                                                                                    Type Parameters

                                                                                                                      NAMEPLATE_MODES: number

                                                                                                                      Type Parameters

                                                                                                                        DOCK_POSITIONS: string

                                                                                                                        Type Parameters

                                                                                                                          FontDefinition: FontFaceDescriptors

                                                                                                                          Type Parameters

                                                                                                                            specialStatusEffects: string

                                                                                                                            Type Parameters

                                                                                                                              TextEditorEnricher: ((match: RegExpMatchArray, options?: EnrichmentOptions) => Promise<HTMLElement | null>)

                                                                                                                              Type Parameters

                                                                                                                                Type declaration

                                                                                                                                  • Type Parameters

                                                                                                                                      Parameters

                                                                                                                                      Returns Promise<HTMLElement | null>

                                                                                                                                  LOAD_STATES: number

                                                                                                                                  Type Parameters