UNPKG

poe-i18n

Version:

i18n utility for Path of Exile

37 lines (36 loc) 1.39 kB
import { Stat } from '../translate'; import { ICUMessageSyntax } from '../types/intl'; import { Description, Descriptions, StatLocaleDatas, Translation } from '../types/StatDescription'; export { Stat } from '../translate'; export declare const DEFAULT_RANGE_MESSAGE = "({min}\u2013{max})"; export declare type Options = { datas: StatLocaleDatas; fallback: Fallback | FallbackCallback; start_file: string; getFormatters: (t: Translation, stat: Stat, n: number) => Translation['formatters']; /** * if a stat value is rollable (i.e. has a min and max value) * default: {DEFAULT_RANGE_MESSAGE} */ range_message: ICUMessageSyntax; }; export declare type TranslatedStats = string[]; export declare type FallbackCallback = (id: string, stat: Stat) => string | null; export declare class NoDescriptionFound extends Error { constructor(stats: Stat[]); } export declare enum Fallback { throw = 0, id = 1, skip = 2 } declare const formatStats: (stats: Stat[], options?: Partial<Options>) => string[]; export default formatStats; /** * creates an array of methods that can be used to find a description for a * given stat. * * return value is to be interpreted as a priority queue * @param descriptions */ export declare function createDescriptionFindStrategies(descriptions: Descriptions): Array<(stat: Stat) => Description | undefined>;