Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions - Mixins

Functions - Other

Variables

Classes - Applications

Classes - Canvas

Classes - Collections

Classes - Custom HTML Elements

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(Base: any): any
  • A specialized subclass of the ClientDocumentMixin which is used for document types that are intended to be represented upon the game Canvas.

    Parameters

    • Base: any

      The base document class mixed with client and canvas features

    Returns any

    The mixed CanvasDocument class definition

  • ClientDocumentMixin(Base: any): 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

    • Base: any

      The base Document class to be mixed

    Returns any

    The mixed client-side document class definition

  • DirectoryCollectionMixin(BaseCollection: any): any
  • A mixin which adds directory functionality to a DocumentCollection, such as folders, tree structures, and sorting.

    mixin

    Parameters

    • BaseCollection: any

      The base collection class to extend

    Returns any

    A Collection mixed with DirectoryCollection functionality

  • OccludableObjectMixin(DisplayObject: any): any
  • A mixin which decorates a DisplayObject with depth and/or occlusion properties.

    Parameters

    • DisplayObject: any

      The parent DisplayObject class being mixed

    Returns any

    A DisplayObject subclass mixed with OccludableObject 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

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

  • 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, options?: { relative: Document; invalid: boolean }): Promise<Document>
  • Retrieve a Document by its Universally Unique Identifier (uuid).

    Parameters

    • uuid: string

      The uuid of the Document to retrieve.

    • options: { relative: Document; invalid: boolean } = {}
      • relative: Document
      • invalid: boolean

    Returns Promise<Document>

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

  • fromUuidSync(uuid: string, options?: { relative: Document; invalid: boolean; strict: boolean }): 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, and the strict option is true.

    Parameters

    • uuid: string

      The uuid of the Document to retrieve.

    • options: { relative: Document; invalid: boolean; strict: boolean } = {}
      • relative: Document
      • invalid: boolean
      • strict: boolean

    Returns any

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

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

    Parameters

    • documentName: string

      The canonical Document name, for example "Actor"

    Returns {}

    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): any
    • Get a single texture or sprite sheet from the cache.

      Parameters

      • src: string

        The texture path to load.

      Returns any

      A texture, a sprite sheet or null if not found in cache.

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

      Parameters

      • src: string

        The requested asset source

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

        Additional options which modify asset loading

        • fallback: string

      Returns any

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

    • FullCanvasObjectMixin(Base: any): any
    • Augment any PIXI.DisplayObject to assume bounds that are always aligned with the full visible screen. The bounds of this container do not depend on its children but always fill the entire canvas.

      Parameters

      • Base: any

        Any PIXI DisplayObject subclass

      Returns any

      The decorated subclass with full canvas bounds

    • RenderFlagsMixin(Base: any): any
    • Add RenderFlags functionality to some other object. This mixin standardizes the interface for such functionality.

      Parameters

      • Base: any

        The base class being mixed

      Returns any

      The mixed class definition

    • DirectoryApplicationMixin(Base: typeof Application): any
    • Augment an Application instance with functionality that supports rendering as a directory of foldered entries.

      Parameters

      • Base: typeof Application

        The base Application class definition

      Returns any

      The decorated DirectoryApplication class definition

    • _resolveEmbedded(parent: Document, parts: string[], [options]?: { invalid: boolean }): 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.

      • [options]: { invalid: boolean } = {}

        Additional options to configure Embedded Document resolution.

        • invalid: boolean

      Returns Document

      The resolved Embedded Document.

    Variables

    vtt: string = ...

    The string prefix used to prepend console logging

    game: Game = ...

    The singleton Game instance

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

    A mapping of allowed package types and the classes which implement them.

    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

    ModuleSubTypeCounts: Object<Object<number>>

    Type Parameters

      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

                    FormApplicationOptions: ApplicationOptions

                    Type Parameters

                      DocumentSheetOptions: FormApplicationOptions

                      Type Parameters

                        ManageCompendiumRequest: SocketRequest

                        Type Parameters

                          ManageCompendiumResponse: SocketResponse

                          Type Parameters

                            ActiveEffectDuration: EffectDurationData

                            Type Parameters

                              pendingRenderFlags: Set<RenderFlagObject>

                              Type Parameters

                                INDICES: number

                                Type Parameters

                                  CanvasAnimationData: CanvasAnimationOptions

                                  Type Parameters

                                    INTERACTION_STATES: number

                                    Type Parameters

                                      WALL_DIRECTION_MODES: number

                                      Type Parameters

                                        ClipperPoints: ClipperPoint[]

                                        Type Parameters

                                          PulsePingOptions: PingOptions

                                          Type Parameters

                                            CREATION_STATES: number

                                            Type Parameters

                                              STATES: number

                                              Type Parameters

                                                CanvasVisionContainer: PIXI.Container

                                                Type Parameters

                                                  RenderedPointSourceData: PointSourceData

                                                  Type Parameters

                                                    LightSourceData: RenderedPointSourceData

                                                    Type Parameters

                                                      VisionSourceData: RenderedPointSourceData

                                                      Type Parameters

                                                        VertexMap: Map<number, PolygonVertex>

                                                        Type Parameters

                                                          EdgeSet: Set<PolygonEdge>

                                                          Type Parameters

                                                            PolygonRay: Ray

                                                            Type Parameters

                                                              colors: Color

                                                              Type Parameters

                                                                weights: number

                                                                Type Parameters

                                                                  DETECTION_TYPES: number

                                                                  Type Parameters

                                                                    PerceptionManagerFlags: RenderFlags

                                                                    Type Parameters

                                                                      COMPATIBILITY_MAPPING: string

                                                                      Type Parameters

                                                                        LIGHTING_LEVELS: number

                                                                        Type Parameters

                                                                          LIGHTING_VISIBILITY: number

                                                                          Type Parameters

                                                                            CLIP_TYPES: number

                                                                            Type Parameters

                                                                              INTERSECTION_TYPES: number

                                                                              Type Parameters

                                                                                SHAPE_TYPES: string

                                                                                Type Parameters

                                                                                  TokenPosition: Point

                                                                                  Type Parameters

                                                                                    COMPRESSION_MODES: number

                                                                                    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

                                                                                                  OPERATORS: string

                                                                                                  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

                                                                                                            • (secret: HTMLElement, content: string): Promise<ClientDocument>
                                                                                                            • Type Parameters

                                                                                                                Parameters

                                                                                                                • secret: HTMLElement
                                                                                                                • content: string

                                                                                                                Returns Promise<ClientDocument>

                                                                                                            DocumentDirectoryOptions: 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

                                                                                                                                              terms: typeof DiceTerm

                                                                                                                                              Type Parameters

                                                                                                                                                polygonBackends: typeof PointSourcePolygon

                                                                                                                                                Type Parameters

                                                                                                                                                  WeatherAmbienceConfiguration: Object

                                                                                                                                                  Type Parameters

                                                                                                                                                    WeatherEffectConfiguration: Object

                                                                                                                                                    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