/** * Loads FVTT core fonts supporting `FontConfig` on Foundry v10+. * * Note: This class contains code modified from Foundry VTT core client code. There are only so many ways to process * core Foundry data structures correctly. */ declare class FontManager { /** * Collect all the font definitions and combine them. * * @returns { {[key: string]: fvtt.FontFamilyDefinition}[] } Core font definitions. */ static getCoreDefinitions(): { [key: string]: fvtt.FontFamilyDefinition; }[]; /** * Ensure that fonts have loaded and are ready for use. * Enforce a maximum timeout in milliseconds. * Proceed after that point even if fonts are not yet available. * * @param {object} [opts] - Optional parameters. * * @param {number} [opts.ms=4500] - The maximum time to spend loading fonts before proceeding. * * @param {Document} [opts.document] - The target document to load the fonts into. * * @param {boolean} [opts.editor=true] - When true verifies the `editor` field of {@link FontFamilyDefinition}. * * @param {( * {[key: string]: fvtt.FontFamilyDefinition}[] | * {[key: string]: fvtt.FontFamilyDefinition} * )} [opts.fonts] - A custom set of font family definitions to load. If not defined the core font family definitions * are loaded. * * @returns {Promise} */ static loadFonts({ ms, document, editor, fonts, }?: { ms?: number; document?: Document; editor?: boolean; fonts?: | { [key: string]: fvtt.FontFamilyDefinition; }[] | { [key: string]: fvtt.FontFamilyDefinition; }; }): Promise; /** * Removes duplicate font definitions. * * @param { {[key: string]: fvtt.FontFamilyDefinition}[] } fonts - An array of FontFamilyDefinition objects * to process. * * @returns { {[key: string]: fvtt.FontFamilyDefinition}[] } Filtered font definitions. */ static removeDuplicateDefinitions( fonts: { [key: string]: fvtt.FontFamilyDefinition; }[], ): { [key: string]: fvtt.FontFamilyDefinition; }[]; } /** * Parses the core Foundry style sheet creating an indexed object of properties by selector. */ declare class FoundryStyles { /** * Gets the properties object associated with the selector. Try and use a direct match otherwise all keys * are iterated to find a selector string that includes the `selector`. * * @param {string} selector - Selector to find. * * @returns { {[key: string]: string} } Properties object. */ static getProperties(selector: string): { [key: string]: string; }; /** * Gets a specific property value from the given `selector` and `property` key. Try and use a direct selector * match otherwise all keys are iterated to find a selector string that includes `selector`. * * @param {string} selector - Selector to find. * * @param {string} property - Specific property to locate. * * @returns {string|undefined} Property value. */ static getProperty(selector: string, property: string): string | undefined; } /** * Provides a helper class to determine the version of the Foundry platform starting a version `9`. * * Note: You must use any of these utility methods after the Foundry `init` hook. */ declare class FVTTVersion { /** * Returns true when Foundry is at least the specific major version number provided. * * Note: `game` must be initialized for correct comparison; use after Foundry `init` hook. * * @param {number} version - Major version to check against. * * @returns {boolean} Foundry version is at least the major version specified. */ static isAtLeast(version: number): boolean; /** * Returns true when Foundry is inclusively between the min / max major version numbers provided. * * @param {number} min - Major minimum version to check against. * * @param {number} max - Major maximum version to check against. * * @returns {boolean} Foundry version is at least the major version specified. */ static isBetween(min: number, max: number): boolean; } export { FVTTVersion, FontManager, FoundryStyles };