@league-of-foundry-developers/foundry-vtt-types
Version:
TypeScript type definitions for Foundry VTT
1,594 lines (1,270 loc) • 102 kB
text/typescript
import type * as CONST from "../common/constants.d.mts";
import type { DataModel, Document } from "../common/abstract/module.d.mts";
import type { GetKey, AnyObject, HandleEmptyObject, MaybePromise } from "#utils";
import type BaseLightSource from "../client-esm/canvas/sources/base-light-source.d.mts";
import type RenderedEffectSource from "../client-esm/canvas/sources/rendered-effect-source.d.mts";
declare global {
namespace CONFIG {
namespace Dice {
interface FulfillmentConfiguration {
/** The die denominations available for configuration. */
dice: Record<string, FulfillmentDenomination>;
/** The methods available for fulfillment. */
methods: Record<string, FulfillmentMethod>;
/**
* Designate one of the methods to be used by default
* for dice fulfillment, if the user hasn't specified
* otherwise. Leave this blank to use the configured
* randomUniform to generate die rolls.
* @defaultValue `""`
*/
defaultMethod: string;
}
interface FulfillmentDenomination {
/** The human-readable label for the die. */
label: string;
/** An icon to display on the configuration sheet. */
icon: string;
}
interface FulfillmentMethod {
/** The human-readable label for the fulfillment method. */
label: string;
/** An icon to represent the fulfillment method. */
icon?: string | undefined | null;
/** Whether this method requires input from the user or if it is fulfilled entirely programmatically. */
interactive?: boolean | undefined | null;
/** A function to invoke to programmatically fulfil a given term for non-interactive fulfillment methods. */
handler?: FulfillmentHandler | undefined | null;
/**
* A custom RollResolver implementation. If the only interactive methods
* the user has configured are this method and manual, this resolver
* will be used to resolve interactive rolls, instead of the default
* resolver. This resolver must therefore be capable of handling manual
* rolls.
*/
resolver: foundry.applications.dice.RollResolver.AnyConstructor;
}
/**
* Only used for non-interactive fulfillment methods. If a die configured to use this fulfillment method is rolled,
* this handler is called and awaited in order to produce the die roll result.
* @returns The fulfilled value, or undefined if it could not be fulfilled.
*/
type FulfillmentHandler = (
/** The term being fulfilled. */
term: foundry.dice.terms.DiceTerm,
/** Additional options to configure fulfillment. */
options?: AnyObject,
) => Promise<number | void>;
type RollFunction = (...args: Array<string | number>) => MaybePromise<number | `${number}`>;
type DTermDiceStrings = "d4" | "d6" | "d8" | "d10" | "d12" | "d20" | "d100";
}
interface Dice {
/**
* The Dice types which are supported.
* @defaultValue `[foundry.dice.terms.Die, foundry.dice.terms.FateDie]`
*/
types: Array<foundry.dice.terms.DiceTerm.AnyConstructor>;
rollModes: CONFIG.Dice.RollModes;
/**
* Configured Roll class definitions
* @defaultValue `[Roll]`
*/
rolls: Array<foundry.dice.Roll.AnyConstructor>;
/**
* Configured DiceTerm class definitions
* @defaultValue
* ```typescript
* {
* DiceTerm: typeof foundry.dice.terms.DiceTerm,
* MathTerm: typeof foundry.dice.terms.MathTerm,
* NumericTerm: typeof foundry.dice.terms.NumericTerm,
* OperatorTerm: typeof foundry.dice.terms.OperatorTerm,
* ParentheticalTerm: typeof foundry.dice.terms.ParentheticalTerm,
* PoolTerm: typeof foundry.dice.terms.PoolTerm,
* StringTerm: typeof foundry.dice.terms.StringTerm
* }
* ```
*/
termTypes: Record<string, foundry.dice.terms.RollTerm.AnyConstructor>;
/** Configured roll terms and the classes they map to. */
terms: {
c: foundry.dice.terms.Coin.AnyConstructor;
d: foundry.dice.terms.Die.AnyConstructor;
f: foundry.dice.terms.FateDie.AnyConstructor;
} & Record<string, foundry.dice.terms.DiceTerm.AnyConstructor>;
/**
* A function used to provide random uniform values.
* @defaultValue `foundry.dice.MersenneTwister.random`
*/
randomUniform: () => number;
/** A parser implementation for parsing Roll expressions. */
parser: foundry.dice.RollParser.AnyConstructor;
/** A collection of custom functions that can be included in roll expressions.*/
functions: Record<string, CONFIG.Dice.RollFunction>;
/**
* Dice roll fulfillment configuration
*/
fulfillment: CONFIG.Dice.FulfillmentConfiguration;
}
/**
* Configured status effects which are recognized by the game system
*/
type StatusEffect = foundry.documents.BaseActiveEffect.CreateData & {
/**
* A string identifier for the effect
*/
id: string;
/**
* Alias for ActiveEffectData#name
* @deprecated since v11, will be removed in v13
*/
label?: string | undefined | null;
/**
* Alias for ActiveEffectData#img
* @deprecated since v12, will be removed in v14
*/
icon?: string | undefined | null;
/**
* Should this effect be selectable in the Token HUD?
* This effect is only selectable in the Token HUD if the Token's Actor sub-type is one of the configured ones.
* @defaultValue `true`
*/
hud?: boolean | { actorTypes: string[] } | undefined | null;
};
}
/**
* 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.
*/
interface CONFIG {
/**
* Configure debugging flags to display additional information
*/
debug: {
/** @defaultValue `false` */
applications: boolean;
/** @defaultValue `false` */
audio: boolean;
/** @defaultValue `false` */
dice: boolean;
/** @defaultValue `false` */
documents: boolean;
fog: {
/** @defaultValue `false` */
extractor: boolean;
/** @defaultValue `false` */
manager: boolean;
};
/** @defaultValue `false` */
hooks: boolean;
/** @defaultValue `false` */
av: boolean;
/** @defaultValue `false` */
avclient: boolean;
/** @defaultValue `false` */
mouseInteraction: boolean;
/** @defaultValue `false` */
time: boolean;
/** @defaultValue `false` */
keybindings: boolean;
/** @defaultValue `false` */
polygons: boolean;
/** @defaultValue `false` */
gamepad: boolean;
canvas: {
primary: {
/** @defaultValue `false` */
bounds: boolean;
};
};
/** @defaultValue `false` */
rollParsing: boolean;
};
/**
* Configure the verbosity of compatibility warnings generated throughout the software.
* The compatibility mode defines the logging level of any displayed warnings.
* The includePatterns and excludePatterns arrays provide a set of regular expressions which can either only
* include or specifically exclude certain file paths or warning messages.
* Exclusion rules take precedence over inclusion rules.
*
* @see {@link CONST.COMPATIBILITY_MODES | `CONST.COMPATIBILITY_MODES`}
*
* @example Include Specific Errors
* ```js
* const includeRgx = new RegExp("/systems/dnd5e/module/documents/active-effect.mjs");
* CONFIG.compatibility.includePatterns.push(includeRgx);
* ```
*
* @example Exclude Specific Errors
* ```js
* const excludeRgx = new RegExp("/systems/dnd5e/");
* CONFIG.compatibility.excludePatterns.push(excludeRgx);
* ```
*
* @example Both Include and Exclude
* ```js
* const includeRgx = new RegExp("/systems/dnd5e/module/actor/");
* const excludeRgx = new RegExp("/systems/dnd5e/module/actor/sheets/base.js");
* CONFIG.compatibility.includePatterns.push(includeRgx);
* CONFIG.compatibility.excludePatterns.push(excludeRgx);
* ```
*
* @example Targeting more than filenames
* ```js
* const includeRgx = new RegExp("applyActiveEffects");
* CONFIG.compatibility.includePatterns.push(includeRgx);
* ```
*/
compatibility: {
mode: CONST.COMPATIBILITY_MODES;
includePatterns: RegExp[];
excludePatterns: RegExp[];
};
compendium: {
/**
* Configure a table of compendium UUID redirects. Must be configured before the game *ready* hook is fired.
*
* @example Re-map individual UUIDs
* ```js
* CONFIG.compendium.uuidRedirects["Compendium.system.heroes.Actor.Tf0JDPzHOrIxz6BH"] = "Compendium.system.villains.Actor.DKYLeIliXXzlAZ2G";
* ```
*
* @example Redirect UUIDs from one compendium to another.
* ```js
* CONFIG.compendium.uuidRedirects["Compendium.system.heroes"] = "Compendium.system.villains";
* ```
*/
uuidRedirects: Record<string, string>;
};
/**
* Configure the DatabaseBackend used to perform Document operations
* @defaultValue `new foundry.data.ClientDatabaseBackend()`
*/
DatabaseBackend: foundry.data.ClientDatabaseBackend;
/**
* Configuration for the Actor document
*/
Actor: {
/** @defaultValue `Actor` */
documentClass: Document.ImplementationClassFor<"Actor">;
/** @defaultValue `Actors` */
collection: Actors.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/actor-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-user"` */
sidebarIcon: string;
/**
* @defaultValue `{}`
* @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team
*/
dataModels: Record<string, typeof DataModel<any, Actor.Implementation>>;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseActor.SubType, Record<string, SheetClassConfig>>;
/**
* @defaultValue `{}`
* @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit`
*/
typeLabels: Record<foundry.documents.BaseActor.SubType, string>;
/** @defaultValue `{}` */
typeIcons: Record<string, string>;
/** @defaultValue `{}` */
trackableAttributes: Record<string, string>;
};
/**
* Configuration for the Adventure document.
* Currently for internal use only.
* @internal
*/
Adventure: {
/** @defaultValue `foundry.documents.BaseAdventure` */
documentClass: Document.ImplementationClassFor<"Adventure">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/adventure-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fa-solid fa-treasure-chest"` */
sidebarIcon: string;
};
/**
* Configuration for the Cards primary Document type
*/
Cards: {
/** @defaultValue `CardStacks` */
collection: CardStacks.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `Cards` */
documentClass: Document.ImplementationClassFor<"Cards">;
/** @defaultValue `"fa-solid fa-cards"` */
sidebarIcon: string;
/**
* @defaultValue `{}`
* @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team
*/
dataModels: Record<string, typeof DataModel<any, Cards.Implementation>>;
/**
* @defaultValue
* ```typescript
* {
* pokerDark: {
* type: "deck",
* label: "CARDS.DeckPresetPokerDark",
* src: "cards/poker-deck-dark.json"
* },
* pokerLight: {
* type: "deck",
* label: "CARDS.DeckPresetPokerLight",
* src: "cards/poker-deck-light.json"
* }
* }
* ```
*/
presets: Record<string, CONFIG.Cards.Preset>;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseCards.SubType, Record<string, SheetClassConfig>>;
/**
* @defaultValue `{}`
* @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit`
*/
typeLabels: Record<foundry.documents.BaseCards.SubType, string>;
typeIcons: {
/** @defaultValue `"fas fa-cards"` */
deck: string;
/** @defaultValue `"fa-duotone fa-cards"` */
hand: string;
/** @defaultValue `"fa-duotone fa-layer-group"` */
pile: string;
[x: string]: string;
};
};
/**
* Configuration for the ChatMessage document
*/
ChatMessage: {
/** @defaultValue `ChatMessage` */
documentClass: Document.ImplementationClassFor<"ChatMessage">;
/** @defaultValue `Messages` */
collection: Messages.AnyConstructor;
/** @defaultValue `"templates/sidebar/chat-message.html"` */
template: string;
/** @defaultValue `"fas fa-comments"` */
sidebarIcon: string;
/**
* @defaultValue `{}`
* @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team
*/
dataModels: Record<string, typeof DataModel<any, ChatMessage.Implementation>>;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseChatMessage.SubType, Record<string, SheetClassConfig>>;
/**
* @defaultValue `{}`
* @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit`
*/
typeLabels: Record<foundry.documents.BaseChatMessage.SubType, string>;
/** @defaultValue `{}` */
typeIcons: Record<string, string>;
/** @defaultValue `100` */
batchSize: number;
};
/**
* Configuration for the Combat document
*/
Combat: {
/** @defaultValue `Combat` */
documentClass: Document.ImplementationClassFor<"Combat">;
/** @defaultValue `CombatEncounters` */
collection: CombatEncounters.AnyConstructor;
/** @defaultValue `"fas fa-swords"` */
sidebarIcon: string;
/**
* @defaultValue `{}`
* @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team
*/
dataModels: Record<string, typeof DataModel<any, Combat.Implementation>>;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseCombat.SubType, Record<string, SheetClassConfig>>;
/**
* @defaultValue `{}`
* @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit`
*/
typeLabels: Record<foundry.documents.BaseCombat.SubType, string>;
/** @defaultValue `{}` */
typeIcons: Record<string, string>;
initiative: {
/** @defaultValue `null` */
formula: string | null;
/** @defaultValue `2` */
decimals: number;
};
/**
* @defaultValue
* ```typescript
* {
* "epic": {
* label: "COMBAT.Sounds.Epic",
* startEncounter: ["sounds/combat/epic-start-3hit.ogg", "sounds/combat/epic-start-horn.ogg"],
* nextUp: ["sounds/combat/epic-next-horn.ogg"],
* yourTurn: ["sounds/combat/epic-turn-1hit.ogg", "sounds/combat/epic-turn-2hit.ogg"]
* },
* "mc": {
* label: "COMBAT.Sounds.MC",
* startEncounter: ["sounds/combat/mc-start-battle.ogg", "sounds/combat/mc-start-begin.ogg", "sounds/combat/mc-start-fight.ogg", "sounds/combat/mc-start-fight2.ogg"],
* nextUp: ["sounds/combat/mc-next-itwillbe.ogg", "sounds/combat/mc-next-makeready.ogg", "sounds/combat/mc-next-youare.ogg"],
* yourTurn: ["sounds/combat/mc-turn-itisyour.ogg", "sounds/combat/mc-turn-itsyour.ogg"]
* }
* }
* ```
*/
sounds: CONFIG.Combat.Sounds;
};
/**
* Configuration for dice rolling behaviors in the Foundry Virtual Tabletop client
*/
Dice: CONFIG.Dice;
/**
* Configuration for the FogExploration document
*/
FogExploration: {
/** @defaultValue `FogExploration` */
documentClass: Document.ImplementationClassFor<"FogExploration">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `FogExplorations` */
collection: FogExplorations.AnyConstructor;
};
/**
* Configuration for the Folder entity
*/
Folder: {
/** @defaultValue `Folder` */
documentClass: Document.ImplementationClassFor<"Folder">;
/** @defaultValue `Folders` */
collection: Folders.AnyConstructor;
/** @defaultValue `"fas fa-folder"` */
sidebarIcon: string;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.CONST.FOLDER_DOCUMENT_TYPES, Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<foundry.CONST.FOLDER_DOCUMENT_TYPES, string>;
};
/**
* Configuration for the default Item entity class
*/
Item: {
/** @defaultValue `Item` */
documentClass: Document.ImplementationClassFor<"Item">;
/** @defaultValue `Items` */
collection: Items.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/item-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-suitcase"` */
sidebarIcon: string;
/**
* @defaultValue `{}`
* @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team
*/
dataModels: Record<string, typeof DataModel<any, Item.Implementation>>;
/**
* @defaultValue `{}`
* @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit`
*/
typeLabels: Record<foundry.documents.BaseItem.SubType, string>;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseItem.SubType, Record<string, SheetClassConfig>>;
};
/**
* Configuration for the JournalEntry entity
*/
JournalEntry: {
/** @defaultValue `JournalEntry` */
documentClass: Document.ImplementationClassFor<"JournalEntry">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `Journal` */
collection: Journal.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/journalentry-banner.webp"` */
compendiumBanner: string;
noteIcons: {
/** @defaultValue `"icons/svg/anchor.svg"` */
Anchor: string;
/** @defaultValue `"icons/svg/barrel.svg"` */
Barrel: string;
/** @defaultValue `"icons/svg/book.svg"` */
Book: string;
/** @defaultValue `"icons/svg/bridge.svg"` */
Bridge: string;
/** @defaultValue `"icons/svg/cave.svg"` */
Cave: string;
/** @defaultValue `"icons/svg/castle.svg"` */
Castle: string;
/** @defaultValue `"icons/svg/chest.svg"` */
Chest: string;
/** @defaultValue `"icons/svg/city.svg"` */
City: string;
/** @defaultValue `"icons/svg/coins.svg"` */
Coins: string;
/** @defaultValue `"icons/svg/fire.svg"` */
Fire: string;
/** @defaultValue `"icons/svg/hanging-sign.svg"` */
"Hanging Sign": string;
/** @defaultValue `"icons/svg/house.svg"` */
House: string;
/** @defaultValue `"icons/svg/mountain.svg"` */
Mountain: string;
/** @defaultValue `"icons/svg/oak.svg"` */
"Oak Tree": string;
/** @defaultValue `"icons/svg/obelisk.svg"` */
Obelisk: string;
/** @defaultValue `"icons/svg/pawprint.svg"` */
Pawprint: string;
/** @defaultValue `"icons/svg/ruins.svg"` */
Ruins: string;
/** @defaultValue `"icons/svg/skull.svg"` */
Skull: string;
/** @defaultValue `"icons/svg/statue.svg"` */
Statue: string;
/** @defaultValue `"icons/svg/sword.svg"` */
Sword: string;
/** @defaultValue `"icons/svg/tankard.svg"` */
Tankard: string;
/** @defaultValue `"icons/svg/temple.svg"` */
Temple: string;
/** @defaultValue `"icons/svg/tower.svg"` */
Tower: string;
/** @defaultValue `"icons/svg/trap.svg"` */
Trap: string;
/** @defaultValue `"icons/svg/village.svg"` */
Village: string;
/** @defaultValue `"icons/svg/waterfall.svg"` */
Waterfall: string;
/** @defaultValue `"icons/svg/windmill.svg"` */
Windmill: string;
} & Record<string, string>;
/** @defaultValue `"fas fa-book-open"` */
sidebarIcon: string;
};
/**
* Configuration for the Macro entity
*/
Macro: {
/** @defaultValue `Macro` */
documentClass: Document.ImplementationClassFor<"Macro">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<foundry.documents.BaseMacro.SubType, Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<foundry.documents.BaseMacro.SubType, string>;
/** @defaultValue `Macros` */
collection: Macros.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/macro-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-code"` */
sidebarIcon: string;
};
/**
* Configuration for the default Playlist entity class
*/
Playlist: {
/** @defaultValue `Playlist` */
documentClass: Document.ImplementationClassFor<"Playlist">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `Playlists` */
collection: Playlists.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/playlist-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-music"` */
sidebarIcon: string;
/** @defaultValue `20` */
autoPreloadSeconds: number;
};
/**
* Configuration for RollTable random draws
*/
RollTable: {
/** @defaultValue `RollTable` */
documentClass: Document.ImplementationClassFor<"RollTable">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `RollTables` */
collection: RollTables.AnyConstructor;
/** @defaultValue `["formula"]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/rolltable-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-th-list"` */
sidebarIcon: string;
/** @defaultValue `"icons/svg/d20-black.svg"` */
resultIcon: string;
/** @defaultValue `"templates/dice/table-result.html"` */
resultTemplate: string;
};
/**
* Configuration for the default Scene entity class
*/
Scene: {
/** @defaultValue `Scene` */
documentClass: Document.ImplementationClassFor<"Scene">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `Scenes` */
collection: Scenes.AnyConstructor;
/** @defaultValue `[]` */
compendiumIndexFields: string[];
/** @defaultValue `"ui/banners/scene-banner.webp"` */
compendiumBanner: string;
/** @defaultValue `"fas fa-map"` */
sidebarIcon: string;
};
Setting: {
/** @defaultValue `Setting` */
documentClass: Document.ImplementationClassFor<"Setting">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `WorldSettings` */
collection: WorldSettings.AnyConstructor;
};
/**
* Configuration for the User entity, it's roles, and permissions
*/
User: {
/** @defaultValue `User` */
documentClass: Document.ImplementationClassFor<"User">;
/**
* @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js`
*/
sheetClasses: Record<"base", Record<string, SheetClassConfig>>;
/**
* @remarks Initialized by `Localization#initialize`, is undefined until `i18nInit`
*/
typeLabels?: Record<"base", string>;
/** @defaultValue `Users` */
collection: Users.AnyConstructor;
};
/**
* Configuration settings for the Canvas and its contained layers and objects
*/
Canvas: {
/** @defaultValue `8` */
blurStrength: number;
/** @defaultValue `4` */
blurQuality: number;
/** @defaultValue `0x303030` */
darknessColor: number;
/** @defaultValue `0xeeeeee` */
daylightColor: number;
/** @defaultValue `0xffffff` */
brightestColor: number;
chatBubblesClass: ChatBubbles.AnyConstructor;
/** @defaultValue `0.25` */
darknessLightPenalty: number;
dispositionColors: {
/** @defaultValue `0xe72124` */
HOSTILE: number;
/** @defaultValue `0xf1d836` */
NEUTRAL: number;
/** @defaultValue `0x43dfdf` */
FRIENDLY: number;
/** @defaultValue `0x555555` */
INACTIVE: number;
/** @defaultValue `0x33bc4e` */
PARTY: number;
/** @defaultValue `0xff9829` */
CONTROLLED: number;
/** @defaultValue `0xA612D4` */
SECRET: number;
};
/**
* The class used to render door control icons
* @remarks Not `AnyConstructor` because it's instantiated with a `Wall.Implementation` as its first argument
*/
doorControlClass: typeof DoorControl;
/** @defaultValue `0x000000` */
exploredColor: number;
/** @defaultValue `0x000000` */
unexploredColor: number;
/** @defaultValue `10000` */
darknessToDaylightAnimationMS: number;
/** @defaultValue `10000` */
daylightToDarknessAnimationMS: number;
/**
* @defaultValue `foundry.canvas.sources.PointDarknessSource`
* @remarks Can't be `AnyConstructor` as it's instantiated expecting a compatible constructor
*/
darknessSourceClass: typeof foundry.canvas.sources.PointDarknessSource;
/**
* @defaultValue `foundry.canvas.sources.PointLightSource`
* @remarks Can't be `AnyConstructor` as it's instantiated expecting a compatible constructor
*/
lightSourceClass: typeof foundry.canvas.sources.PointLightSource;
/**
* @defaultValue `foundry.canvas.sources.GlobalLightSource`
* @remarks Can't be `AnyConstructor` as it's instantiated expecting a compatible constructor
*/
globalLightSourceClass: typeof foundry.canvas.sources.GlobalLightSource;
/**
* @defaultValue `foundry.canvas.sources.PointVisionSource`
* @remarks Can't be `AnyConstructor` as it's instantiated expecting a compatible constructor
*/
visionSourceClass: typeof foundry.canvas.sources.PointVisionSource;
/**
* @defaultValue `foundry.canvas.sources.PointSoundSource`
* @remarks Can't be `AnyConstructor` as it's instantiated via `new`
*/
soundSourceClass: typeof foundry.canvas.sources.PointSoundSource;
groups: CONFIG.Canvas.Groups;
layers: CONFIG.Canvas.Layers;
lightLevels: {
/** @defaultValue `0` */
dark: number;
/** @defaultValue `0.5` */
halfdark: number;
/** @defaultValue `0.25` */
dim: number;
/** @defaultValue `1.0` */
bright: number;
};
/**
* @defaultValue `FogManager`
* @remarks Can't be `AnyConstructor` because Foundry assumes it can call `new` with the same arguments FogManager accepts
*/
fogManager: typeof FogManager;
polygonBackends: {
/** @defaultValue `typeof ClockwiseSweepPolygon` */
sight: PointSourcePolygon.AnyConstructor;
/** @defaultValue `typeof ClockwiseSweepPolygon` */
light: PointSourcePolygon.AnyConstructor;
/** @defaultValue `typeof ClockwiseSweepPolygon` */
sound: PointSourcePolygon.AnyConstructor;
/** @defaultValue `typeof ClockwiseSweepPolygon` */
move: PointSourcePolygon.AnyConstructor;
};
/** @defaultValue `number` */
darknessSourcePaddingMultiplier: number;
visibilityFilter: VisibilityFilter.AnyConstructor;
visualEffectsMaskingFilter: VisualEffectsMaskingFilter.AnyConstructor;
/**
* @defaultValue `Ruler`
* @remarks Not `AnyConstructor` because it's instantiated with a `User.Implementation` as its first argument
*/
rulerClass: typeof Ruler;
/** @defaultValue `0.8` */
dragSpeedModifier: number;
/** @defaultValue `3.0` */
maxZoom: number;
/** @defaultValue `4` */
objectBorderThickness: number;
gridStyles: {
[key: string]: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.SolidLines",
* shaderClass: GridShader,
* shaderOptions: {
* style: 0
* }
* }
* ```
*/
solidLines: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.DashedLines",
* shaderClass: GridShader,
* shaderOptions: {
* style: 1
* }
* }
* ```
*/
dashedLines: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.DottedLines",
* shaderClass: GridShader,
* shaderOptions: {
* style: 0
* }
* }
* ```
*/
dottedLines: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.SquarePoints",
* shaderClass: GridShader,
* shaderOptions: {
* style: 0
* }
* }
* ```
*/
squarePoints: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.DiamondPoints",
* shaderClass: GridShader,
* shaderOptions: {
* style: 0
* }
* }
* ```
*/
diamondPoints: GridLayer.GridStyle;
/**
* @defaultValue
* ```js
* {
* label: "GRID.STYLES.RoundPoints",
* shaderClass: GridShader,
* shaderOptions: {
* style: 0
* }
* }
* ```
*/
roundPoints: GridLayer.GridStyle;
};
lightAnimations: {
[key: string]: RenderedEffectSource.LightAnimationConfig;
flame: {
/** @defaultValue `"LIGHT.AnimationFame"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateFlickering` */
animation: BaseLightSource.LightAnimationFunction;
/** @defaultValue `FlameIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `FlameColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
torch: {
/** @defaultValue `"LIGHT.AnimationTorch"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTorch` */
animation: BaseLightSource.LightAnimationFunction;
/** @defaultValue `TorchIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `TorchColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
revolving: {
/** @defaultValue `"LIGHT.AnimationRevolving"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: BaseLightSource.LightAnimationFunction;
/** @defaultValue `RevolvingColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
siren: {
/** @defaultValue `"LIGHT.AnimationSiren"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTorch` */
animation: BaseLightSource.LightAnimationFunction;
/** @defaultValue `SirenIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `SirenIlluminationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
pulse: {
/** @defaultValue `"LIGHT.AnimationPulse"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animatePulse` */
animation: BaseLightSource.LightAnimationFunction;
/** @defaultValue `PulseIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `PulseColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
chroma: {
/** @defaultValue `"LIGHT.AnimationChroma"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `ChromaColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
wave: {
/** @defaultValue `"LIGHT.AnimationWave"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `WaveIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `WaveColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
fog: {
/** @defaultValue `"LIGHT.AnimationFog"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `FogColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
sunburst: {
/** @defaultValue `"LIGHT.AnimationSunburst"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `SunburstIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `SunburstColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
dome: {
/** @defaultValue `"LIGHT.AnimationLightDome"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `LightDomeColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
emanation: {
/** @defaultValue `"LIGHT.AnimationEmanation"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `EmanationColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
hexa: {
/** @defaultValue `"LIGHT.AnimationHexaDome";` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `HexaDomeColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
ghost: {
/** @defaultValue `"LIGHT.AnimationGhostLight"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `GhostLightIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `GhostLightColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
energy: {
/** @defaultValue `"LIGHT.AnimationEnergyField"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `EnergyFieldColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
vortex: {
/** @defaultValue `"LIGHT.AnimationVortex"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `VortexIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `VortexColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
witchwave: {
/** @defaultValue `"LIGHT.AnimationBewitchingWave"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `BewitchingWaveIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `BewitchingWaveColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
rainbowswirl: {
/** @defaultValue `"LIGHT.AnimationSwirlingRainbow"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `SwirlingRainbowColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
radialrainbow: {
/** @defaultValue `"LIGHT.AnimationRadialRainbow"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `RadialRainbowColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
fairy: {
/** @defaultValue `"LIGHT.AnimationFairyLight"` */
label: string;
/** @defaultValue `foundry.canvas.sources.LightSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `FairyLightIlluminationShader` */
illuminationShader: AdaptiveIlluminationShader.AnyConstructor;
/** @defaultValue `FairyLightColorationShader` */
colorationShader: AdaptiveColorationShader.AnyConstructor;
};
};
darknessAnimations: {
[key: string]: RenderedEffectSource.DarknessAnimationConfig;
magicalGloom: {
/** @defaultValue `"LIGHT.AnimationMagicalGloom"` */
label: string;
/** @defaultValue `foundry.canvas.sources.PointDarknessSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `MagicalGloomDarknessShader` */
darknessShader: AdaptiveDarknessShader.AnyConstructor;
};
roiling: {
/** @defaultValue `"LIGHT.AnimationRoilingMass"` */
label: string;
/** @defaultValue `foundry.canvas.sources.PointDarknessSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `RoilingDarknessShader` */
darknessShader: AdaptiveDarknessShader.AnyConstructor;
};
hole: {
/** @defaultValue `"LIGHT.AnimationBlackHole"` */
label: string;
/** @defaultValue `foundry.canvas.sources.PointDarknessSource.prototype.animateTime` */
animation: RenderedEffectSource.AnimationFunction;
/** @defaultValue `BlackHoleDarknessShader` */
darknessShader: AdaptiveDarknessShader.AnyConstructor;
};
};
/**
* A registry of Scenes which are managed by a specific SceneManager class.
* @remarks Keys are Scene IDs
* @privateRemarks Can't be `AnyConstructor` because it's instantiated expecting a compatible constructor
*/
managedScenes: Record<string, typeof foundry.canvas.SceneManager>;
pings: {
types: {
/** @defaultValue `"pulse"` */
PULSE: string;
/** @defaultValue `"alert"` */
ALERT: string;
/** @defaultValue `"chevron"` */
PULL: string;
/** @defaultValue `"arrow"` */
ARROW: string;
};
styles: {
/** @defaultValue `{ class: AlertPing, color: "#ff0000", size: 1.5, duration: 900 }` */
alert: CONFIG.Canvas.Pings.Style;
/** @defaultValue `{ class: ArrowPing, size: 1, duration: 900 }` */
arrow: CONFIG.Canvas.Pings.Style;
/** @defaultValue `{ class: ChevronPing, size: 1, duration: 2000 }` */
chevron: CONFIG.Canvas.Pings.Style;
/** @defaultValue `{ class: PulsePing, size: 1.5, duration: 900 }` */
pulse: CONFIG.Canvas.Pings.Style;
[key: string]: CONFIG.Canvas.Pings.Style;
};
/** @defaultValue `700` */
pullSpeed: number;
};
targeting: {
/** @defaultValue `.15` */
size: number;
};
/**
* The hover-fading configuration.
*/
hoverFade: {
/**
* The delay in milliseconds before the (un)faded animation starts on (un)hover.
* @defaultValue `250`
*/
delay: number;
/**
* The duration in milliseconds of the (un)fade animation on (un)hover.
* @defaultValue `750`
*/
duration: number;
};
/**
* Allow specific transcoders for assets
* @defaultValue `{ basis: false }`
*/
transCoders: Record<string, boolean>;
/**
* The set of VisionMode definitions which are available to be used for Token vision.
*/
visionModes: {
[key: string]: VisionMode;
/**
* Default (Basic) Vision
* @defaultValue
* ```typescript
* new VisionMode({
* id: "basic",
* label: "VISION.ModeBasicVision",
* vision: {
* defaults: { attenuation: 0, contrast: 0, saturation: 0, brightness: 0 }
* preferred: true // Takes priority over other vision modes
* }
* })
* ```
*/
basic: VisionMode;
/**
* Darkvision
* @defaultValue
* ```typescript
* new VisionMode({
* id: "darkvision",
* label: "VISION.ModeDarkvision",
* canvas: {
* shader: ColorAdjustmentsSamplerShader,
* uniforms: { contrast: 0, saturation: -1.0, brightness: 0 }
* },
* lighting: {
* levels: {
* [VisionMode.LIGHTING_LEVELS.DIM]: VisionMode.LIGHTING_LEVELS.BRIGHT
* },
* background: { visibility: VisionMode.LIGHTING_VISIBILITY.REQUIRED }
* },
* vision: {
* darkness: { adaptive: false },
* defaults: { attenuation: 0, contrast: 0, saturation: -1.0, brightness: 0 }
* }
* })
* ```
*/
darkvision: VisionMode;
/**
* Darkvision
* @defaultValue
* ```typescript
* new VisionMode({
* id: "monochromatic",
* label: "VISION.ModeMonochromatic",
* canvas: {
* shader: ColorAdjustmentsSamplerShader,
* uniforms: { contrast: 0, saturation: -1.0, brightness: 0 }
* },
* lighting: {
* background: {
* postProcessingModes: ["SATURATION"],
* uniforms: { saturation: -1.0, tint: [1, 1, 1] }
* },
* illumination: {
* postProcessingModes: ["SATURATION"],
* uniforms: { saturation: -1.0, tint: [1, 1, 1] }
* },
* coloration: {
* postProcessingModes: ["SATURATION"],
* uniforms: { saturation: -1.0, tint: [1, 1, 1] }
* }
* },
* vision: {
* darkness: { adaptive: false },
* defaults: { attenuation: 0, contrast: 0, saturation: -1, brightness: 0 }
* }
* })
* ```
*/
monochromatic: VisionMode;
/**
* Blindness
* @defaultValue
* ```typescript
* new VisionMode({
* id: "blindness",
* label: "VISION.ModeBlindness",
* tokenConfig: false,
* canvas: {
* shader: ColorAdjustmentsSamplerShader,
* uniforms: { contrast: -0.75, saturation: -1, exposure: -0.3 }
* },
* lighting: {
* background: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED },
* illumination: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED },
* coloration: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED }
* },
* vision: {
* darkness: { adaptive: false },
* defaults: { color: null, attenuation: 0, contrast: -0.5, saturation: -1, brightness: -1 }
* }
* }),
* ```
*/