UNPKG

fvtt-types

Version:
1,604 lines (1,364 loc) 131 kB
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, ConcreteKeys, RemoveIndexSignatures, InexactPartial, Brand, InterfaceToObject, } from "#utils"; import type BaseLightSource from "#client/canvas/sources/base-light-source.d.mts"; import type RenderedEffectSource from "#client/canvas/sources/rendered-effect-source.d.mts"; import type * as shaders from "#client/canvas/rendering/shaders/_module.d.mts"; import type * as canvasLayers from "#client/canvas/layers/_module.d.mts"; import type * as canvasGroups from "#client/canvas/groups/_module.d.mts"; import type * as perception from "#client/canvas/perception/_module.d.mts"; import type * as placeables from "#client/canvas/placeables/_module.d.mts"; import type { DoorControl, DoorMesh } from "#client/canvas/containers/_module.d.mts"; import type * as geometry from "#client/canvas/geometry/_module.d.mts"; import type { CanvasAnimation } from "#client/canvas/animation/_module.d.mts"; import SimplePeerAVClient = foundry.av.clients.SimplePeerAVClient; 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 Terms extends Record<string, foundry.dice.terms.DiceTerm.AnyConstructor> { c: foundry.dice.terms.Coin.AnyConstructor; d: foundry.dice.terms.Die.AnyConstructor; f: foundry.dice.terms.FateDie.AnyConstructor; } } interface Dice { /** * The Dice types which are supported. * @defaultValue `[foundry.dice.terms.Die, foundry.dice.terms.FateDie]` */ types: Array<foundry.dice.terms.DiceTerm.AnyConstructor>; // Note(LukeAbby): `InterfaceToObject` is used to ensure that it's valid when used with `choices`. rollModes: InterfaceToObject<CONFIG.Dice.RollModes>; /** * Configured Roll class definitions * @defaultValue `[`{@linkcode foundry.dice.Roll}`]` */ rolls: Array<foundry.dice.Roll.Internal.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: Dice.Terms; /** * 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 */ interface StatusEffect extends 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; } interface TrackableAttribute { bar: string[]; value: string[]; } } /** * 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 {@linkcode 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 {@linkcode foundry.documents.collections.Actors} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Actors; /** @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<Actor.SubType, Record<string, SheetClassConfig>>; /** * @defaultValue `{}` * @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit` */ typeLabels: Record<Actor.SubType, string>; /** @defaultValue `{}` */ typeIcons: Record<string, string>; /** @defaultValue `{}` */ trackableAttributes: Record<string, CONFIG.TrackableAttribute>; }; /** * 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 {@linkcode foundry.documents.collections.CardStacks} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.CardStacks; /** @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; [type: Brand<string, "CONFIG.Cards.typeIcons">]: string; }; }; /** * Configuration for the ChatMessage document */ ChatMessage: { /** @defaultValue `ChatMessage` */ documentClass: Document.ImplementationClassFor<"ChatMessage">; /** * @defaultValue {@linkcode foundry.documents.collections.ChatMessages} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.ChatMessages; /** @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 {@linkcode foundry.documents.collections.CombatEncounters} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.CombatEncounters; /** @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 "icons/vtt-512.png" */ fallbackTurnMarker: string; /** * @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 {@linkcode foundry.documents.collections.FogExplorations} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.FogExplorations; }; /** * Configuration for the Folder entity */ Folder: { /** @defaultValue `Folder` */ documentClass: Document.ImplementationClassFor<"Folder">; /** * @defaultValue {@linkcode foundry.documents.collections.Folders} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Folders; /** @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 {@linkcode foundry.documents.collections.Items} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Items; /** @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 {@linkcode foundry.documents.collections.Journal} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Journal; /** @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 {@linkcode foundry.documents.collections.Macros} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Macros; /** @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 {@linkcode foundry.documents.collections.Playlists} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Playlists; /** @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 {@linkcode foundry.documents.collections.RollTables} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.RollTables; /** @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 {@linkcode foundry.documents.collections.Scenes} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Scenes; /** @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 {@linkcode foundry.documents.collections.WorldSettings} * @remarks {@linkcode foundry.helpers.ClientSettings | ClientSettings#constructor} instantiates `WorldSettings` by name, without referring to this property. * It's only purpose seems to be allowing a {@linkcode WorldCollection.instance | CONFIG[primaryType]?.collection?.instance} reference in * {@linkcode foundry.utils.parseUuid} to work. */ collection: foundry.documents.collections.WorldSettings.Internal.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 {@linkcode foundry.documents.collections.Users} * @remarks `typeof` instead of `AnyConstructor` because it's instantiated via `new` in {@linkcode Game.initializeDocuments | Game#initializeDocuments} */ collection: typeof foundry.documents.collections.Users; }; /** * Configuration settings for the Canvas and its contained layers and objects */ Canvas: CONFIG.Canvas; /** * Configure the default Token text style so that it may be reused and overridden by modules * @defaultValue * ```typescript * new PIXI.TextStyle({ * fontFamily: "Signika", * fontSize: 36, * fill: "#FFFFFF", * stroke: "#111111", * strokeThickness: 1, * dropShadow: true, * dropShadowColor: "#000000", * dropShadowBlur: 2, * dropShadowAngle: 0, * dropShadowDistance: 0, * align: "center", * wordWrap: false, * padding: 1 * }) * ``` */ canvasTextStyle: PIXI.TextStyle; /** * Available Weather Effects implementations */ weatherEffects: { [weatherEffectID: Brand<string, "CONFIG.weatherEffects">]: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ```ts * { * id: "leaves", * label: "WEATHER.AutumnLeaves", * effects: [{ * id: "leavesParticles", * effectClass: AutumnLeavesWeatherEffect * }] * } * ``` */ leaves: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ```ts * { * id: "rain", * label: "WEATHER.Rain", * filter: { * enabled: false * }, * effects: [{ * id: "rainShader", * effectClass: WeatherShaderEffect, * shaderClass: RainShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * config: { * opacity: 0.25, * tint: [0.7, 0.9, 1.0], * intensity: 1, * strength: 1, * rotation: 0.2618, * speed: 0.2, * } * }] * } * ``` */ rain: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ``` * { * id: "rainStorm", * label: "WEATHER.RainStorm", * filter: { * enabled: false * }, * effects: [{ * id: "fogShader", * effectClass: WeatherShaderEffect, * shaderClass: FogShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * performanceLevel: 2, * config: { * slope: 1.5, * intensity: 0.050, * speed: -55.0, * scale: 25, * } * }, * { * id: "rainShader", * effectClass: WeatherShaderEffect, * shaderClass: RainShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * config: { * opacity: 0.45, * tint: [0.7, 0.9, 1.0], * intensity: 1.5, * strength: 1.5, * rotation: 0.5236, * speed: 0.30, * } * }] * } * ``` */ rainStorm: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ``` * { * id: "fog", * label: "WEATHER.Fog", * filter: { * enabled: false * }, * effects: [{ * id: "fogShader", * effectClass: WeatherShaderEffect, * shaderClass: FogShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * config: { * slope: 0.45, * intensity: 0.4, * speed: 0.4, * } * }] * } * ``` */ fog: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ``` * { * id: "snow", * label: "WEATHER.Snow", * filter: { * enabled: false * }, * effects: [{ * id: "snowShader", * effectClass: WeatherShaderEffect, * shaderClass: SnowShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * config: { * tint: [0.85, 0.95, 1], * direction: 0.5, * speed: 2, * scale: 2.5, * } * }] * } * ``` */ snow: canvasLayers.WeatherEffects.AmbienceConfiguration; /** * @defaultValue * ``` * { * id: "blizzard", * label: "WEATHER.Blizzard", * filter: { * enabled: false * }, * effects: [{ * id: "snowShader", * effectClass: WeatherShaderEffect, * shaderClass: SnowShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * config: { * tint: [0.95, 1, 1], * direction: 0.80, * speed: 8, * scale: 2.5, * } * }, * { * id: "fogShader", * effectClass: WeatherShaderEffect, * shaderClass: FogShader, * blendMode: PIXI.BLEND_MODES.SCREEN, * performanceLevel: 2, * config: { * slope: 1.0, * intensity: 0.15, * speed: -4.0, * } * }] * } * ``` */ blizzard: canvasLayers.WeatherEffects.AmbienceConfiguration; }; /** * The control icons used for rendering common HUD operations */ controlIcons: { /** @defaultValue `"icons/svg/combat.svg"` */ combat: string; /** @defaultValue `"icons/svg/cowled.svg"` */ visibility: string; /** @defaultValue `"icons/svg/aura.svg"` */ effects: string; /** @defaultValue `"icons/svg/padlock.svg"` */ lock: string; /** @defaultValue `"icons/svg/up.svg"` */ up: string; /** @defaultValue `"icons/svg/down.svg"` */ down: string; /** @defaultValue `"icons/svg/skull.svg"` */ defeated: string; /** @defaultValue `"icons/svg/light.svg"` */ light: string; /** @defaultValue `"icons/svg/light-off.svg"` */ lightOff: string; /** @defaultValue `"icons/svg/explosion.svg"` */ template: string; /** @defaultValue `"icons/svg/sound.svg"` */ sound: string; /** @defaultValue `"icons/svg/sound-off.svg"` */ soundOff: string; /** @defaultValue `"icons/svg/door-closed-outline.svg"` */ doorClosed: string; /** @defaultValue `"icons/svg/door-open-outline.svg"` */ doorOpen: string; /** @defaultValue `"icons/svg/door-secret-outline.svg"` */ doorSecret: string; /** @defaultValue `"icons/svg/door-locked-outline.svg"` */ doorLocked: string; /** @defaultValue `"icons/svg/wall-direction.svg"` */ wallDirection: string; } & Record<string, string>; /** * A collection of fonts to load either from the user's local system, or remotely. * @defaultValue * ```typescript * { * Arial: { editor: true; fonts: [] }; * Amiri: { * editor: true, * fonts: [ * {urls: ["fonts/amiri/amiri-regular.woff2"]}, * {urls: ["fonts/amiri/amiri-bold.woff2"], weight: 700} * ] * }, * "Bruno Ace": {editor: true, fonts: [ * {urls: ["fonts/bruno-ace/bruno-ace.woff2"]} * ]}, * Courier: { editor: true; fonts: [] }; * "Courier New": { editor: true; fonts: [] }; * "Modesto Condensed": { * editor: true; * fonts: [ * { urls: ["fonts/modesto-condensed/modesto-condensed.woff2"] }, * { urls: ["fonts/modesto-condensed/modesto-condensed-bold.woff2"]; weight: 700 } * ]; * }; * Signika: { * editor: true; * fonts: [ * { urls: ["fonts/signika/signika-regular.woff2"] }, * { urls: ["fonts/signika/signika-bold.woff2"]; weight: 700 } * ]; * }; * Times: { editor: true; fonts: [] }; * "Times New Roman": { editor: true; fonts: [] }; * } * ``` */ fontDefinitions: Record<string, CONFIG.Font.FamilyDefinition>; /** * The default font family used for text labels on the PIXI Canvas * @defaultValue `"Signika"` */ defaultFontFamily: string; /** * The array of status effect icons which can be applied to an Actor * @defaultValue * ```js * [ * { * id: "dead"; * name: "EFFECT.StatusDead"; * img: "icons/svg/skull.svg"; * }, * { * id: "unconscious"; * name: "EFFECT.StatusUnconscious"; * img: "icons/svg/unconscious.svg"; * }, * { * id: "sleep"; * name: "EFFECT.StatusAsleep"; * img: "icons/svg/sleep.svg"; * }, * { * id: "stun"; * name: "EFFECT.StatusStunned"; * img: "icons/svg/daze.svg"; * }, * { * id: "prone"; * name: "EFFECT.StatusProne"; * img: "icons/svg/falling.svg"; * }, * { * id: "restrain"; * name: "EFFECT.StatusRestrained"; * img: "icons/svg/net.svg"; * }, * { * id: "paralysis"; * name: "EFFECT.StatusParalysis"; * img: "icons/svg/paralysis.svg"; * }, * { * id: "fly"; * name: "EFFECT.StatusFlying"; * img: "icons/svg/wing.svg"; * }, * { * id: "blind"; * name: "EFFECT.StatusBlind"; * img: "icons/svg/blind.svg"; * }, * { * id: "deaf"; * name: "EFFECT.StatusDeaf"; * img: "icons/svg/deaf.svg"; * }, * { * id: "silence"; * name: "EFFECT.StatusSilenced"; * img: "icons/svg/silenced.svg"; * }, * { * id: "fear"; * name: "EFFECT.StatusFear"; * img: "icons/svg/terror.svg"; * }, * { * id: "burning"; * name: "EFFECT.StatusBurning"; * img: "icons/svg/fire.svg"; * }, * { * id: "frozen"; * name: "EFFECT.StatusFrozen"; * img: "icons/svg/frozen.svg"; * }, * { * id: "shock"; * name: "EFFECT.StatusShocked"; * img: "icons/svg/lightning.svg"; * }, * { * id: "corrode"; * name: "EFFECT.StatusCorrode"; * img: "icons/svg/acid.svg"; * }, * { * id: "bleeding"; * name: "EFFECT.StatusBleeding"; * img: "icons/svg/blood.svg"; * }, * { * id: "disease"; * name: "EFFECT.StatusDisease"; * img: "icons/svg/biohazard.svg"; * }, * { * id: "poison"; * name: "EFFECT.StatusPoison"; * img: "icons/svg/poison.svg"; * }, * { * id: "curse"; * name: "EFFECT.StatusCursed"; * img: "icons/svg/sun.svg"; * }, * { * id: "regen"; * name: "EFFECT.StatusRegen"; * img: "icons/svg/regen.svg"; * }, * { * id: "degen"; * name: "EFFECT.StatusDegen"; * img: "icons/svg/degen.svg"; * }, * { * id: "hover"; * name: "EFFECT.StatusHover"; * img: "icons/svg/wingfoot.svg"; * }, * { * id: "burrow"; * name: "EFFECT.StatusBurrow"; * img: "icons/svg/mole.svg"; * }, * { * id: "upgrade"; * name: "EFFECT.StatusUpgrade"; * img: "icons/svg/upgrade.svg"; * }, * { * id: "downgrade"; * name: "EFFECT.StatusDowngrade"; * img: "icons/svg/downgrade.svg"; * }, * { * id: "invisible", * name: "EFFECT.StatusInvisible", * img: "icons/svg/invisible.svg" * }, * { * id: "target"; * name: "EFFECT.StatusTarget"; * img: "icons/svg/target.svg"; * }, * { * id: "eye"; * name: "EFFECT.StatusMarked"; * img: "icons/svg/eye.svg"; * }, * { * id: "bless"; * name: "EFFECT.StatusBlessed"; * img: "icons/svg/angel.svg"; * }, * { * id: "fireShield"; * name: "EFFECT.StatusFireShield"; * img: "icons/svg/fire-shield.svg"; * }, * { * id: "coldShield"; * name: "EFFECT.StatusIceShield"; * img: "icons/svg/ice-shield.svg"; * }, * { * id: "magicShield"; * name: "EFFECT.StatusMagicShield"; * img: "icons/svg/mage-shield.svg"; * }, * { * id: "holyShield"; * name: "EFFECT.StatusHolyShield"; * img: "icons/svg/holy-shield.svg"; * } * ] * ``` */ statusEffects: CONFIG.StatusEffect[]; /** * A mapping of status effect IDs which provide some additional mechanical integration. * @defaultValue `{ DEFEATED: "dead", INVISIBLE: "invisible", BLIND: "blind", BURROW: "burrow", HOVER: "hover", FLY: "fly" }` */ specialStatusEffects: HandleEmptyObject<CONFIG.SpecialStatusEffects, CONFIG.DefaultSpecialStatusEffects>; /** * A mapping of core audio effects used which can be replaced by systems or mods */ sounds: { /** @defaultValue `"sounds/dice.wav"` */ dice: string; /** @defaultValue `"sounds/lock.wav"` */ lock: string; /** @defaultValue `"sounds/notify.wav"` */ notification: string; /** @defaultValue `"sounds/drums.wav"` */ combat: string; }; /** * Define the set of supported languages for localization * @defaultValue `{ en: "English" }` */ supportedLanguages: { en: string; } & Record<string, string>; /** * Localization constants. */ i18n: { /** * In operations involving the document index, search prefixes must have at least this many characters to avoid too * large a search space. Languages that have hundreds or thousands of characters will typically have very shallow * search trees, so it should be safe to lower this number in those cases. * @defaultValue `4` */ searchMinimumCharacterLength: number; }; /** * Configuration for time tracking */ time: CONFIG.Time; /** * Configuration for the ActiveEffect embedded document type */ ActiveEffect: { /** @defaultValue `ActiveEffect` */ documentClass: Document.ImplementationClassFor<"ActiveEffect">; /** * @defaultValue `{}` * @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team */ dataModels: Record<string, typeof DataModel<any, ActiveEffect.Implementation>>; /** * @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js` */ sheetClasses: Record<foundry.documents.BaseActiveEffect.SubType, Record<string, SheetClassConfig>>; /** * @defaultValue `{}` * @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit` */ typeLabels: Record<foundry.documents.BaseActiveEffect.SubType, string>; /** @defaultValue `{}` */ typeIcons: Record<string, string>; /** * If true, Active Effects on Items will be copied to the Actor when the Item is created on the Actor if the * Active Effect's transfer property is true, and will be deleted when that Item is deleted from the Actor. * If false, Active Effects are never copied to the Actor, but will still apply to the Actor from within the Item * if the transfer property on the Active Effect is true. * @remarks Foundry states "\@deprecated since v11" but this is misleading for actual use */ legacyTransferral: boolean; }; /** * Configuration for the ActorDelta embedded document type. */ ActorDelta: { /** @defaultValue `ActorDelta` */ documentClass: Document.ImplementationClassFor<"ActorDelta">; /** * @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>; }; /** * Configuration for the Card embedded Document type */ Card: { /** @defaultValue `Card` */ documentClass: Document.ImplementationClassFor<"Card">; /** * @defaultValue `{}` * @remarks `TypeDataModel` is preferred to `DataModel` per core Foundry team */ dataModels: Record<string, typeof DataModel<any, Card.Implementation>>; /** * @remarks Added by `DocumentSheetConfig._registerDefaultSheets` in `tail.js` */ sheetClasses: Record<foundry.documents.BaseCard.SubType, Record<string, SheetClassConfig>>; /** * @defaultValue `{}` * @remarks Initialized by `Localization#initialize`, is an empty object until `i18nInit` */ typeLabels: Record<foundry.documents.BaseCard.SubType, string>; /** @defaultValue `{}` */ typeIcons: Record<string, string>; }; /** * Configuration for the TableResult embedded document type */ TableResult: { /** @defaultValue `TableResult` */ documentClass: Document.ImplementationClassFor