@phensley/cldr
Version:
Internationalization in Typescript with Unicode CLDR, batteries included
1,294 lines (1,293 loc) • 104 kB
TypeScript
// Generated by dts-bundle-generator v9.5.1
/**
* Very low-level access to strings in a bundle. Includes properties
* needed to resolve locales within a pack.
*
* @public
*/
export interface PrimitiveBundle {
id(): string;
language(): string;
region(): string;
get(offset: number): string;
}
/**
* Maps a name to a key index.
*
* @public
*/
export interface KeyIndexMap {
[name: string]: KeyIndex<string>;
}
/**
* Indexes each string in an array to its offset in the array.
*
* @public
*/
export interface KeyIndex<T extends string> {
readonly index: {
[P in T]: number;
};
readonly keys: T[];
readonly size: number;
readonly last: number;
get(key: T): number;
}
/**
* Function for fetching a single field.
*
* @public
*/
export interface FieldArrow {
readonly offset: number;
get(bundle: PrimitiveBundle): string;
}
/**
* Function for entering a new scope.
*
* @public
*/
export interface ScopeArrow<T extends string, R> {
readonly map: {
[P in T]: R;
};
get(key: T): R | undefined;
}
/**
* Function for fetching a field based on plural category and
* number of digits.
*
* @public
*/
export interface DigitsArrow<T extends string> {
readonly offset: number;
readonly index: KeyIndex<T>;
readonly values: number[];
readonly size2: number;
/**
* Gets the field for the given plural category and number of integer digits.
*/
get(bundle: PrimitiveBundle, key: T, digits: number): [
string,
number
];
}
/**
* Function representing a 1-dimensional vector.
*
* @public
*/
export interface Vector1Arrow<T extends string> {
/**
* Indicates this vector exists in the bundle.
*/
exists(bundle: PrimitiveBundle): boolean;
/**
* Fast way to check if a key is valid, even if it has no value.
*/
valid(key: T): boolean;
/**
* Gets the field at the corresponding offset of the given key.
*/
get(bundle: PrimitiveBundle, key: T | T[]): string;
/**
* Full mapping of all keys to the corresponding fields.
*/
mapping(bundle: PrimitiveBundle): {
[P in T]: string;
};
}
/**
* Function representing a 2-dimensional vector.
*
* @public
*/
export interface Vector2Arrow<T extends string, S extends string> {
/**
* Indicates this vector exists in the bundle.
*/
exists(bundle: PrimitiveBundle): boolean;
/**
* Fast way to check if a key is valid, even if it has no value.
*/
valid(key1: T | T[], key2: S | S[]): boolean;
/**
* Gets the field at the corresponding offset [key1, key2]
*/
get(bundle: PrimitiveBundle, key1: T | T[], key2: S | S[]): string;
/**
* Full mapping of all keys to the corresponding fields.
*/
mapping(bundle: PrimitiveBundle): {
[P in T]: {
[Q in S]: string;
};
};
}
/**
* Function representing a 3-dimensional vector.
*
* @public
*/
export interface Vector3Arrow<T extends string, S extends string, U extends string> {
/**
* Indicates this vector exists in the bundle.
*/
exists(bundle: PrimitiveBundle): boolean;
/**
* Gets the field at the corresponding offset [key1, key2, key3]
*/
get(bundle: PrimitiveBundle, key1: T | T[], key2: S | S[], key3: U | U[]): string;
/**
* Full mapping of all keys to the corresponding fields.
*/
mapping(bundle: PrimitiveBundle): {
[P in T]: {
[Q in S]: {
[R in U]: string;
};
};
};
}
/** @public */
export type ContextTransformFieldType = ("calendar-field" | "currencyName" | "day-format-except-narrow" | "day-standalone-except-narrow" | "era-abbr" | "era-name" | "keyValue" | "languages" | "month-format-except-narrow" | "month-standalone-except-narrow" | "number-spellout" | "relative" | "script" | "typographicNames");
/** @public */
export type CurrencyType = ("ADP" | "AED" | "AFA" | "AFN" | "ALK" | "ALL" | "AMD" | "ANG" | "AOA" | "AOK" | "AON" | "AOR" | "ARA" | "ARL" | "ARM" | "ARP" | "ARS" | "ATS" | "AUD" | "AWG" | "AZM" | "AZN" | "BAD" | "BAM" | "BAN" | "BBD" | "BDT" | "BEC" | "BEF" | "BEL" | "BGL" | "BGM" | "BGN" | "BGO" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOL" | "BOP" | "BOV" | "BRB" | "BRC" | "BRE" | "BRL" | "BRN" | "BRR" | "BRZ" | "BSD" | "BTN" | "BUK" | "BWP" | "BYB" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLE" | "CLF" | "CLP" | "CNH" | "CNX" | "CNY" | "COP" | "COU" | "CRC" | "CSD" | "CSK" | "CUC" | "CUP" | "CVE" | "CYP" | "CZK" | "DDM" | "DEM" | "DJF" | "DKK" | "DOP" | "DZD" | "ECS" | "ECV" | "EEK" | "EGP" | "ERN" | "ESA" | "ESB" | "ESP" | "ETB" | "EUR" | "FIM" | "FJD" | "FKP" | "FRF" | "GBP" | "GEK" | "GEL" | "GHC" | "GHS" | "GIP" | "GMD" | "GNF" | "GNS" | "GQE" | "GRD" | "GTQ" | "GWE" | "GWP" | "GYD" | "HKD" | "HNL" | "HRD" | "HRK" | "HTG" | "HUF" | "IDR" | "IEP" | "ILP" | "ILR" | "ILS" | "INR" | "IQD" | "IRR" | "ISJ" | "ISK" | "ITL" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRH" | "KRO" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LTT" | "LUC" | "LUF" | "LUL" | "LVL" | "LVR" | "LYD" | "MAD" | "MAF" | "MCF" | "MDC" | "MDL" | "MGA" | "MGF" | "MKD" | "MKN" | "MLF" | "MMK" | "MNT" | "MOP" | "MRO" | "MRU" | "MTL" | "MTP" | "MUR" | "MVP" | "MVR" | "MWK" | "MXN" | "MXP" | "MXV" | "MYR" | "MZE" | "MZM" | "MZN" | "NAD" | "NGN" | "NIC" | "NIO" | "NLG" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEI" | "PEN" | "PES" | "PGK" | "PHP" | "PKR" | "PLN" | "PLZ" | "PTE" | "PYG" | "QAR" | "RHD" | "ROL" | "RON" | "RSD" | "RUB" | "RUR" | "RWF" | "SAR" | "SBD" | "SCR" | "SDD" | "SDG" | "SDP" | "SEK" | "SGD" | "SHP" | "SIT" | "SKK" | "SLE" | "SLL" | "SOS" | "SRD" | "SRG" | "SSP" | "STD" | "STN" | "SUR" | "SVC" | "SYP" | "SZL" | "THB" | "TJR" | "TJS" | "TMM" | "TMT" | "TND" | "TOP" | "TPE" | "TRL" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UAK" | "UGS" | "UGX" | "USD" | "USN" | "USS" | "UYI" | "UYP" | "UYU" | "UYW" | "UZS" | "VEB" | "VED" | "VEF" | "VES" | "VND" | "VNN" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XCG" | "XDR" | "XEU" | "XFO" | "XFU" | "XOF" | "XPD" | "XPF" | "XPT" | "XRE" | "XSU" | "XTS" | "XUA" | "XXX" | "YDD" | "YER" | "YUD" | "YUM" | "YUN" | "YUR" | "ZAL" | "ZAR" | "ZMK" | "ZMW" | "ZRN" | "ZRZ" | "ZWD" | "ZWG" | "ZWL" | "ZWR");
/** @public */
export type LanguageIdType = ("aa" | "ab" | "ace" | "ach" | "ada" | "ady" | "ae" | "aeb" | "af" | "afh" | "agq" | "ain" | "ak" | "akk" | "akz" | "ale" | "aln" | "alt" | "am" | "an" | "ang" | "ann" | "anp" | "apc" | "ar" | "ar-001" | "arc" | "arn" | "aro" | "arp" | "arq" | "ars" | "arw" | "ary" | "arz" | "as" | "asa" | "ase" | "ast" | "atj" | "av" | "avk" | "awa" | "ay" | "az" | "az-Arab" | "ba" | "bal" | "ban" | "bar" | "bas" | "bax" | "bbc" | "bbj" | "be" | "bej" | "bem" | "bew" | "bez" | "bfd" | "bfq" | "bg" | "bgc" | "bgn" | "bho" | "bi" | "bik" | "bin" | "bjn" | "bkm" | "bla" | "blo" | "blt" | "bm" | "bn" | "bo" | "bpy" | "bqi" | "br" | "bra" | "brh" | "brx" | "bs" | "bss" | "bua" | "bug" | "bum" | "byn" | "byv" | "ca" | "cad" | "car" | "cay" | "cch" | "ccp" | "ce" | "ceb" | "cgg" | "ch" | "chb" | "chg" | "chk" | "chm" | "chn" | "cho" | "chp" | "chr" | "chy" | "cic" | "ckb" | "clc" | "co" | "cop" | "cps" | "cr" | "crg" | "crh" | "crj" | "crk" | "crl" | "crm" | "crr" | "crs" | "cs" | "csb" | "csw" | "cu" | "cv" | "cy" | "da" | "dak" | "dar" | "dav" | "de" | "de-AT" | "de-CH" | "del" | "den" | "dgr" | "din" | "dje" | "doi" | "dsb" | "dtp" | "dua" | "dum" | "dv" | "dyo" | "dyu" | "dz" | "dzg" | "ebu" | "ee" | "efi" | "egl" | "egy" | "eka" | "el" | "elx" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-US" | "enm" | "eo" | "es" | "es-419" | "es-ES" | "es-MX" | "esu" | "et" | "eu" | "ewo" | "ext" | "fa" | "fa-AF" | "fan" | "fat" | "ff" | "fi" | "fil" | "fit" | "fj" | "fo" | "fon" | "fr" | "fr-CA" | "fr-CH" | "frc" | "frm" | "fro" | "frp" | "frr" | "frs" | "fur" | "fy" | "ga" | "gaa" | "gag" | "gan" | "gay" | "gba" | "gbz" | "gd" | "gez" | "gil" | "gl" | "glk" | "gmh" | "gn" | "goh" | "gon" | "gor" | "got" | "grb" | "grc" | "gsw" | "gu" | "guc" | "gur" | "guz" | "gv" | "gwi" | "ha" | "hai" | "hak" | "haw" | "hax" | "he" | "hi" | "hi-Latn" | "hif" | "hil" | "hit" | "hmn" | "hnj" | "ho" | "hr" | "hsb" | "hsn" | "ht" | "hu" | "hup" | "hur" | "hy" | "hz" | "ia" | "iba" | "ibb" | "id" | "ie" | "ig" | "ii" | "ik" | "ikt" | "ilo" | "inh" | "io" | "is" | "it" | "iu" | "izh" | "ja" | "jam" | "jbo" | "jgo" | "jmc" | "jpr" | "jrb" | "jut" | "jv" | "ka" | "kaa" | "kab" | "kac" | "kaj" | "kam" | "kaw" | "kbd" | "kbl" | "kcg" | "kde" | "kea" | "ken" | "kfo" | "kg" | "kgp" | "kha" | "kho" | "khq" | "khw" | "ki" | "kiu" | "kj" | "kk" | "kkj" | "kl" | "kln" | "km" | "kmb" | "kn" | "ko" | "koi" | "kok" | "kos" | "kpe" | "kr" | "krc" | "kri" | "krj" | "krl" | "kru" | "ks" | "ksb" | "ksf" | "ksh" | "ku" | "kum" | "kut" | "kv" | "kw" | "kwk" | "kxv" | "ky" | "la" | "lad" | "lag" | "lah" | "lam" | "lb" | "lez" | "lfn" | "lg" | "li" | "lij" | "lil" | "liv" | "lkt" | "lld" | "lmo" | "ln" | "lo" | "lol" | "lou" | "loz" | "lrc" | "lsm" | "lt" | "ltg" | "lu" | "lua" | "lui" | "lun" | "luo" | "lus" | "luy" | "lv" | "lzh" | "lzz" | "mad" | "maf" | "mag" | "mai" | "mak" | "man" | "mas" | "mde" | "mdf" | "mdr" | "men" | "mer" | "mfe" | "mg" | "mga" | "mgh" | "mgo" | "mh" | "mhn" | "mi" | "mic" | "min" | "mk" | "ml" | "mn" | "mnc" | "mni" | "moe" | "moh" | "mos" | "mr" | "mrj" | "ms" | "mt" | "mua" | "mul" | "mus" | "mwl" | "mwr" | "mwv" | "my" | "mye" | "myv" | "mzn" | "na" | "nan" | "nap" | "naq" | "nb" | "nd" | "nds" | "nds-NL" | "ne" | "new" | "ng" | "nia" | "niu" | "njo" | "nl" | "nl-BE" | "nmg" | "nn" | "nnh" | "no" | "nog" | "non" | "nov" | "nqo" | "nr" | "nso" | "nus" | "nv" | "nwc" | "ny" | "nym" | "nyn" | "nyo" | "nzi" | "oc" | "oj" | "ojb" | "ojc" | "ojs" | "ojw" | "oka" | "om" | "or" | "os" | "osa" | "ota" | "pa" | "pag" | "pal" | "pam" | "pap" | "pau" | "pcd" | "pcm" | "pdc" | "pdt" | "peo" | "pfl" | "phn" | "pi" | "pis" | "pl" | "pms" | "pnt" | "pon" | "pqm" | "prg" | "pro" | "ps" | "pt" | "pt-BR" | "pt-PT" | "qu" | "quc" | "qug" | "raj" | "rap" | "rar" | "rgn" | "rhg" | "rif" | "rm" | "rn" | "ro" | "ro-MD" | "rof" | "rom" | "rtm" | "ru" | "rue" | "rug" | "rup" | "rw" | "rwk" | "sa" | "sad" | "sah" | "sam" | "saq" | "sas" | "sat" | "saz" | "sba" | "sbp" | "sc" | "scn" | "sco" | "sd" | "sdc" | "sdh" | "se" | "see" | "seh" | "sei" | "sel" | "ses" | "sg" | "sga" | "sgs" | "sh" | "shi" | "shn" | "shu" | "si" | "sid" | "sk" | "skr" | "sl" | "slh" | "sli" | "sly" | "sm" | "sma" | "smj" | "smn" | "sms" | "sn" | "snk" | "so" | "sog" | "sq" | "sr" | "sr-ME" | "srn" | "srr" | "ss" | "ssy" | "st" | "stq" | "str" | "su" | "suk" | "sus" | "sux" | "sv" | "sw" | "sw-CD" | "swb" | "syc" | "syr" | "szl" | "ta" | "tce" | "tcy" | "te" | "tem" | "teo" | "ter" | "tet" | "tg" | "tgx" | "th" | "tht" | "ti" | "tig" | "tiv" | "tk" | "tkl" | "tkr" | "tl" | "tlh" | "tli" | "tly" | "tmh" | "tn" | "to" | "tog" | "tok" | "tpi" | "tr" | "tru" | "trv" | "trw" | "ts" | "tsd" | "tsi" | "tt" | "ttm" | "ttt" | "tum" | "tvl" | "tw" | "twq" | "ty" | "tyv" | "tzm" | "udm" | "ug" | "uga" | "uk" | "umb" | "und" | "ur" | "uz" | "vai" | "ve" | "vec" | "vep" | "vi" | "vls" | "vmf" | "vmw" | "vo" | "vot" | "vro" | "vun" | "wa" | "wae" | "wal" | "war" | "was" | "wbp" | "wo" | "wuu" | "xal" | "xh" | "xmf" | "xnr" | "xog" | "yao" | "yap" | "yav" | "ybb" | "yi" | "yo" | "yrl" | "yue" | "za" | "zap" | "zbl" | "zea" | "zen" | "zgh" | "zh" | "zh-Hans" | "zh-Hant" | "zu" | "zun" | "zxx" | "zza");
/** @public */
export type ScriptIdType = ("Adlm" | "Afak" | "Aghb" | "Ahom" | "Arab" | "Aran" | "Armi" | "Armn" | "Avst" | "Bali" | "Bamu" | "Bass" | "Batk" | "Beng" | "Bhks" | "Blis" | "Bopo" | "Brah" | "Brai" | "Bugi" | "Buhd" | "Cakm" | "Cans" | "Cari" | "Cham" | "Cher" | "Chrs" | "Cirt" | "Copt" | "Cpmn" | "Cprt" | "Cyrl" | "Cyrs" | "Deva" | "Diak" | "Dogr" | "Dsrt" | "Dupl" | "Egyd" | "Egyh" | "Egyp" | "Elba" | "Elym" | "Ethi" | "Gara" | "Geok" | "Geor" | "Glag" | "Gong" | "Gonm" | "Goth" | "Gran" | "Grek" | "Gujr" | "Gukh" | "Guru" | "Hanb" | "Hang" | "Hani" | "Hano" | "Hans" | "Hant" | "Hatr" | "Hebr" | "Hira" | "Hluw" | "Hmng" | "Hmnp" | "Hrkt" | "Hung" | "Inds" | "Ital" | "Jamo" | "Java" | "Jpan" | "Jurc" | "Kali" | "Kana" | "Kawi" | "Khar" | "Khmr" | "Khoj" | "Kits" | "Knda" | "Kore" | "Kpel" | "Krai" | "Kthi" | "Lana" | "Laoo" | "Latf" | "Latg" | "Latn" | "Lepc" | "Limb" | "Lina" | "Linb" | "Lisu" | "Loma" | "Lyci" | "Lydi" | "Mahj" | "Maka" | "Mand" | "Mani" | "Marc" | "Maya" | "Medf" | "Mend" | "Merc" | "Mero" | "Mlym" | "Modi" | "Mong" | "Moon" | "Mroo" | "Mtei" | "Mult" | "Mymr" | "Nagm" | "Nand" | "Narb" | "Nbat" | "Newa" | "Nkgb" | "Nkoo" | "Nshu" | "Ogam" | "Olck" | "Onao" | "Orkh" | "Orya" | "Osge" | "Osma" | "Ougr" | "Palm" | "Pauc" | "Perm" | "Phag" | "Phli" | "Phlp" | "Phlv" | "Phnx" | "Plrd" | "Prti" | "Qaag" | "Rjng" | "Rohg" | "Roro" | "Runr" | "Samr" | "Sara" | "Sarb" | "Saur" | "Sgnw" | "Shaw" | "Shrd" | "Sidd" | "Sind" | "Sinh" | "Sogd" | "Sogo" | "Sora" | "Soyo" | "Sund" | "Sunu" | "Sylo" | "Syrc" | "Syre" | "Syrj" | "Syrn" | "Tagb" | "Takr" | "Tale" | "Talu" | "Taml" | "Tang" | "Tavt" | "Telu" | "Teng" | "Tfng" | "Tglg" | "Thaa" | "Thai" | "Tibt" | "Tirh" | "Tnsa" | "Todr" | "Toto" | "Tutg" | "Ugar" | "Vaii" | "Visp" | "Vith" | "Wara" | "Wcho" | "Wole" | "Xpeo" | "Xsux" | "Yezi" | "Yiii" | "Zanb" | "Zinh" | "Zmth" | "Zsye" | "Zsym" | "Zxxx" | "Zyyy" | "Zzzz");
/** @public */
export type RegionIdType = ("001" | "002" | "003" | "005" | "009" | "011" | "013" | "014" | "015" | "017" | "018" | "019" | "021" | "029" | "030" | "034" | "035" | "039" | "053" | "054" | "057" | "061" | "142" | "143" | "145" | "150" | "151" | "154" | "155" | "202" | "419" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CP" | "CQ" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DG" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EA" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "EU" | "EZ" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IC" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "QO" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "UN" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "XA" | "XB" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ");
/** @public */
export type MetaZoneType = "Acre" | "Afghanistan" | "Africa_Central" | "Africa_Eastern" | "Africa_Southern" | "Africa_Western" | "Alaska" | "Almaty" | "Amazon" | "America_Central" | "America_Eastern" | "America_Mountain" | "America_Pacific" | "Anadyr" | "Apia" | "Aqtau" | "Aqtobe" | "Arabian" | "Argentina" | "Argentina_Western" | "Armenia" | "Atlantic" | "Australia_Central" | "Australia_CentralWestern" | "Australia_Eastern" | "Australia_Western" | "Azerbaijan" | "Azores" | "Bangladesh" | "Bhutan" | "Bolivia" | "Brasilia" | "Brunei" | "Cape_Verde" | "Casey" | "Chamorro" | "Chatham" | "Chile" | "China" | "Christmas" | "Cocos" | "Colombia" | "Cook" | "Cuba" | "Davis" | "DumontDUrville" | "East_Timor" | "Easter" | "Ecuador" | "Europe_Central" | "Europe_Eastern" | "Europe_Further_Eastern" | "Europe_Western" | "Falkland" | "Fiji" | "French_Guiana" | "French_Southern" | "GMT" | "Galapagos" | "Gambier" | "Georgia" | "Gilbert_Islands" | "Greenland" | "Greenland_Eastern" | "Greenland_Western" | "Guam" | "Gulf" | "Guyana" | "Hawaii_Aleutian" | "Hong_Kong" | "Hovd" | "India" | "Indian_Ocean" | "Indochina" | "Indonesia_Central" | "Indonesia_Eastern" | "Indonesia_Western" | "Iran" | "Irkutsk" | "Israel" | "Japan" | "Kamchatka" | "Kazakhstan" | "Kazakhstan_Eastern" | "Kazakhstan_Western" | "Korea" | "Kosrae" | "Krasnoyarsk" | "Kyrgystan" | "Lanka" | "Line_Islands" | "Lord_Howe" | "Macau" | "Magadan" | "Malaysia" | "Maldives" | "Marquesas" | "Marshall_Islands" | "Mauritius" | "Mawson" | "Mexico_Pacific" | "Mongolia" | "Moscow" | "Myanmar" | "Nauru" | "Nepal" | "New_Caledonia" | "New_Zealand" | "Newfoundland" | "Niue" | "Norfolk" | "Noronha" | "North_Mariana" | "Novosibirsk" | "Omsk" | "Pakistan" | "Palau" | "Papua_New_Guinea" | "Paraguay" | "Peru" | "Philippines" | "Phoenix_Islands" | "Pierre_Miquelon" | "Pitcairn" | "Ponape" | "Pyongyang" | "Qyzylorda" | "Reunion" | "Rothera" | "Sakhalin" | "Samara" | "Samoa" | "Seychelles" | "Singapore" | "Solomon" | "South_Georgia" | "Suriname" | "Syowa" | "Tahiti" | "Taipei" | "Tajikistan" | "Tokelau" | "Tonga" | "Truk" | "Turkmenistan" | "Tuvalu" | "Uruguay" | "Uzbekistan" | "Vanuatu" | "Venezuela" | "Vladivostok" | "Volgograd" | "Vostok" | "Wake" | "Wallis" | "Yakutsk" | "Yekaterinburg" | "Yukon";
/** @public */
export type UnitType = "g-force" | "meter-per-square-second" | "arc-minute" | "arc-second" | "degree" | "radian" | "revolution" | "acre" | "bu-jp" | "cho" | "dunam" | "hectare" | "se-jp" | "square-centimeter" | "square-foot" | "square-inch" | "square-kilometer" | "square-meter" | "square-mile" | "square-yard" | "item" | "karat" | "milligram-ofglucose-per-deciliter" | "millimole-per-liter" | "mole" | "percent" | "permille" | "permillion" | "permyriad" | "portion-per-1e9" | "liter-per-100-kilometer" | "liter-per-kilometer" | "mile-per-gallon" | "mile-per-gallon-imperial" | "bit" | "byte" | "gigabit" | "gigabyte" | "kilobit" | "kilobyte" | "megabit" | "megabyte" | "petabyte" | "terabit" | "terabyte" | "century" | "day" | "day-person" | "decade" | "hour" | "microsecond" | "millisecond" | "minute" | "month" | "nanosecond" | "night" | "quarter" | "second" | "week" | "year" | "ampere" | "milliampere" | "ohm" | "volt" | "british-thermal-unit" | "calorie" | "electronvolt" | "foodcalorie" | "joule" | "kilocalorie" | "kilojoule" | "kilowatt-hour" | "therm-us" | "kilowatt-hour-per-100-kilometer" | "newton" | "pound-force" | "gigahertz" | "hertz" | "kilohertz" | "megahertz" | "dot" | "dot-per-centimeter" | "dot-per-inch" | "em" | "megapixel" | "pixel" | "pixel-per-centimeter" | "pixel-per-inch" | "astronomical-unit" | "centimeter" | "decimeter" | "earth-radius" | "fathom" | "foot" | "furlong" | "inch" | "jo-jp" | "ken" | "kilometer" | "light-year" | "meter" | "micrometer" | "mile" | "mile-scandinavian" | "millimeter" | "nanometer" | "nautical-mile" | "parsec" | "picometer" | "point" | "ri-jp" | "rin" | "shaku-cloth" | "shaku-length" | "solar-radius" | "sun" | "yard" | "candela" | "lumen" | "lux" | "solar-luminosity" | "carat" | "dalton" | "earth-mass" | "fun" | "grain" | "gram" | "kilogram" | "microgram" | "milligram" | "ounce" | "ounce-troy" | "pound" | "solar-mass" | "stone" | "ton" | "tonne" | "gigawatt" | "horsepower" | "kilowatt" | "megawatt" | "milliwatt" | "watt" | "atmosphere" | "bar" | "gasoline-energy-density" | "hectopascal" | "inch-ofhg" | "kilopascal" | "megapascal" | "millibar" | "millimeter-ofhg" | "pascal" | "pound-force-per-square-inch" | "beaufort" | "kilometer-per-hour" | "knot" | "light-speed" | "meter-per-second" | "mile-per-hour" | "celsius" | "fahrenheit" | "temperature" | "kelvin" | "newton-meter" | "pound-force-foot" | "acre-foot" | "barrel" | "bushel" | "centiliter" | "cubic-centimeter" | "cubic-foot" | "cubic-inch" | "cubic-kilometer" | "cubic-meter" | "cubic-mile" | "cubic-yard" | "cup" | "cup-jp" | "cup-metric" | "deciliter" | "dessert-spoon" | "dessert-spoon-imperial" | "dram" | "drop" | "fluid-ounce" | "fluid-ounce-imperial" | "gallon" | "gallon-imperial" | "hectoliter" | "jigger" | "koku" | "kosaji" | "liter" | "megaliter" | "milliliter" | "osaji" | "pinch" | "pint" | "pint-metric" | "quart" | "quart-imperial" | "sai" | "shaku" | "tablespoon" | "teaspoon" | "to-jp";
/**
* Values 'h' and 'H' for hours have been unified to 'H' for uniqueness
*
* @public
*/
export type DateTimePatternFieldType = "G" | "y" | "M" | "d" | "a" | "B" | "H" | "h" | "m" | "s";
/**
* @public
*/
export type DayPeriodType = "noon" | "midnight" | "am" | "pm" | "morning1" | "morning2" | "afternoon1" | "afternoon2" | "evening1" | "evening2" | "night1" | "night2";
/**
* @public
*/
export type EraWidthType = "names" | "abbr" | "narrow";
/**
* @public
*/
export type FieldWidthType = "abbreviated" | "narrow" | "short" | "wide";
/**
* @public
*/
export type FormatWidthType = "short" | "medium" | "long" | "full";
/**
* @public
*/
export type DateFieldType = "era" | "year" | "quarter" | "month" | "week" | "weekday" | "weekdayOfMonth" | "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "day" | "dayperiod" | "hour" | "minute" | "second" | "zone";
/**
* @public
*/
export type DateFieldWidthType = "short" | "narrow" | "wide";
/**
* @public
*/
export type RelativeTimeFieldType = "year" | "quarter" | "month" | "week" | "day" | "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "hour" | "minute" | "second";
/**
* @public
*/
export type CharacterOrderType = "ltr" | "rtl";
/**
* @public
*/
export type ContextType = "middle-of-text" | "begin-sentence" | "standalone" | "ui-list-or-menu";
/**
* @public
*/
export type LineOrderType = "ttb" | "btt";
/**
* @public
*/
export type ListPatternPositionType = "start" | "middle" | "end" | "two";
/**
* @public
*/
export type PluralType = "other" | "zero" | "one" | "two" | "few" | "many";
/**
* @public
*/
export type AltType = "none" | "short" | "narrow" | "variant" | "stand-alone" | "long" | "menu";
/**
* @public
*/
export type DayPeriodAltType = "none" | "casing";
/**
* @public
*/
export type EraAltType = "none" | "sensitive";
/**
* @public
*/
export type CurrencySpacingPos = "before" | "after";
/**
* @public
*/
export type CurrencySpacingPattern = "currencyMatch" | "surroundingMatch" | "insertBetween";
/**
* @public
*/
export type NumberSymbolType = "approximatelySign" | "currencyDecimal" | "currencyGroup" | "decimal" | "exponential" | "group" | "infinity" | "list" | "minusSign" | "nan" | "perMille" | "percentSign" | "plusSign" | "superscriptingExponent" | "timeSeparator";
/**
* These are all of the possible numbering systems we've implemented. Just decimal for now.
*
* @public
*/
export type NumberSystemName = "adlm" | "ahom" | "arab" | "arabext" | "bali" | "beng" | "bhks" | "brah" | "cakm" | "cham" | "deva" | "fullwide" | "gonm" | "gujr" | "guru" | "hanidec" | "hmng" | "java" | "kali" | "khmr" | "knda" | "lana" | "lanatham" | "laoo" | "latn" | "lepc" | "limb" | "mathbold" | "mathdbl" | "mathmono" | "mathsanb" | "mathsans" | "mlym" | "modi" | "mong" | "mroo" | "mtei" | "mymr" | "mymrshan" | "mymrtlng" | "newa" | "nkoo" | "olck" | "orya" | "osma" | "saur" | "shrd" | "sind" | "sinh" | "sora" | "sund" | "takr" | "talu" | "tamldec" | "telu" | "thai" | "tibt" | "tirh" | "vaii" | "wara";
/**
* @public
*/
export type NumberSystemCategory = "default" | "native" | "finance" | "traditional";
/**
* @public
*/
export type NumberMiscPatternType = "at-least" | "at-most" | "approx" | "range";
/**
* @public
*/
export interface CalendarFields {
readonly weekdays: Vector2Arrow<string, string>;
readonly months: Vector2Arrow<string, string>;
readonly quarters: Vector2Arrow<string, string>;
readonly dayPeriods: Vector3Arrow<string, string, DayPeriodAltType>;
}
/**
* @public
*/
export interface CalendarSchema {
readonly eras: Vector3Arrow<EraWidthType, string, EraAltType>;
readonly format: CalendarFields;
readonly standAlone: CalendarFields;
readonly availableFormats: Vector1Arrow<string>;
readonly pluralFormats: Vector2Arrow<PluralType, string>;
readonly intervalFormats: Vector2Arrow<string, DateTimePatternFieldType>;
readonly dateFormats: Vector1Arrow<FormatWidthType>;
readonly timeFormats: Vector1Arrow<FormatWidthType>;
readonly dateTimeFormats: Vector1Arrow<FormatWidthType>;
readonly dateTimeFormatsAt: Vector1Arrow<FormatWidthType>;
readonly intervalFormatFallback: FieldArrow;
}
/**
* @public
*/
export interface BuddhistSchema extends CalendarSchema {
}
/**
* @public
*/
export interface GregorianSchema extends CalendarSchema {
}
/**
* @public
*/
export interface JapaneseSchema extends CalendarSchema {
}
/**
* @public
*/
export interface PersianSchema extends CalendarSchema {
}
/**
* @public
*/
export interface CurrenciesSchema {
readonly displayName: Vector1Arrow<CurrencyType>;
readonly decimal: Vector1Arrow<CurrencyType>;
readonly pluralName: Vector2Arrow<PluralType, CurrencyType>;
readonly symbol: Vector2Arrow<AltType, CurrencyType>;
}
/**
* @public
*/
export interface RelativeTimeFields {
readonly previous2: Vector1Arrow<RelativeTimeFieldType>;
readonly previous: Vector1Arrow<RelativeTimeFieldType>;
readonly current: Vector1Arrow<RelativeTimeFieldType>;
readonly next: Vector1Arrow<RelativeTimeFieldType>;
readonly next2: Vector1Arrow<RelativeTimeFieldType>;
readonly future: Vector2Arrow<PluralType, RelativeTimeFieldType>;
readonly past: Vector2Arrow<PluralType, RelativeTimeFieldType>;
}
/**
* @public
*/
export interface RelativeTimes {
readonly wide: RelativeTimeFields;
readonly short: RelativeTimeFields;
readonly narrow: RelativeTimeFields;
}
/**
* @public
*/
export interface DateFieldsSchema {
readonly relativeTimes: RelativeTimes;
readonly displayName: Vector2Arrow<DateFieldType, DateFieldWidthType>;
}
/**
* @public
*/
export interface LayoutSchema {
readonly characterOrder: FieldArrow;
readonly lineOrder: FieldArrow;
}
/**
* @public
*/
export interface ListPatternsSchema {
readonly and: Vector1Arrow<ListPatternPositionType>;
readonly andShort: Vector1Arrow<ListPatternPositionType>;
readonly or: Vector1Arrow<ListPatternPositionType>;
readonly unitLong: Vector1Arrow<ListPatternPositionType>;
readonly unitNarrow: Vector1Arrow<ListPatternPositionType>;
readonly unitShort: Vector1Arrow<ListPatternPositionType>;
}
/**
* @public
*/
export interface ContextTransformsSchema {
readonly contextTransforms: Vector1Arrow<ContextTransformFieldType>;
}
/**
* @public
*/
export interface LanguageNameInfo {
readonly displayName: Vector2Arrow<AltType, LanguageIdType>;
}
/**
* @public
*/
export interface ScriptNameInfo {
readonly displayName: Vector2Arrow<AltType, ScriptIdType>;
}
/**
* @public
*/
export interface RegionNameInfo {
readonly displayName: Vector2Arrow<AltType, RegionIdType>;
}
/**
* @public
*/
export interface NamesSchema {
readonly languages: LanguageNameInfo;
readonly scripts: ScriptNameInfo;
readonly regions: RegionNameInfo;
}
/**
* @public
*/
export interface CurrencyFormats {
readonly standard: FieldArrow;
readonly accounting: FieldArrow;
readonly short: DigitsArrow<PluralType>;
readonly spacing: Vector2Arrow<CurrencySpacingPos, CurrencySpacingPattern>;
readonly unitPattern: Vector1Arrow<PluralType>;
}
/**
* @public
*/
export interface DecimalFormats {
readonly standard: FieldArrow;
readonly short: DigitsArrow<PluralType>;
readonly long: DigitsArrow<PluralType>;
}
/**
* @public
*/
export interface NumberSystemInfo {
readonly symbols: Vector1Arrow<NumberSymbolType>;
readonly currencyFormats: CurrencyFormats;
readonly decimalFormats: DecimalFormats;
readonly percentFormat: FieldArrow;
readonly scientificFormat: FieldArrow;
readonly miscPatterns: Vector1Arrow<NumberMiscPatternType>;
}
/**
* @public
*/
export interface NumbersSchema {
readonly minimumGroupingDigits: FieldArrow;
readonly numberSystems: Vector1Arrow<NumberSystemCategory>;
readonly numberSystem: ScopeArrow<NumberSystemName, NumberSystemInfo>;
}
/**
* @public
*/
export type TimeZoneNameType = "daylight" | "generic" | "standard";
/**
* @public
*/
export interface MetaZoneInfo {
readonly short: Vector2Arrow<TimeZoneNameType, MetaZoneType>;
readonly long: Vector2Arrow<TimeZoneNameType, MetaZoneType>;
}
/**
* @public
*/
export interface TimeZoneSchema {
readonly metaZones: MetaZoneInfo;
readonly exemplarCity: Vector1Arrow<string>;
readonly gmtFormat: FieldArrow;
readonly hourFormat: FieldArrow;
readonly gmtZeroFormat: FieldArrow;
readonly regionFormat: FieldArrow;
}
/**
* @public
*/
export interface UnitInfo {
readonly unitPattern: Vector2Arrow<PluralType, UnitType>;
readonly displayName: Vector1Arrow<UnitType>;
readonly perUnitPattern: Vector1Arrow<UnitType>;
readonly perPattern: FieldArrow;
readonly timesPattern: FieldArrow;
}
/**
* @public
*/
export interface UnitsSchema {
readonly long: UnitInfo;
readonly narrow: UnitInfo;
readonly short: UnitInfo;
}
/**
* @public
*/
export interface Schema {
readonly Names: NamesSchema;
readonly Numbers: NumbersSchema;
readonly DateFields: DateFieldsSchema;
readonly Layout: LayoutSchema;
readonly ListPatterns: ListPatternsSchema;
readonly Buddhist: BuddhistSchema;
readonly Gregorian: GregorianSchema;
readonly Japanese: JapaneseSchema;
readonly Persian: PersianSchema;
readonly TimeZones: TimeZoneSchema;
readonly Currencies: CurrenciesSchema;
readonly Units: UnitsSchema;
readonly ContextTransforms: ContextTransformsSchema;
}
/**
* @public
*/
export interface SchemaConfig {
/**
* Calendar types to include. Note that 'gregory' for the
* gregorian calendar will be included by default, even if
* omitted from this list.
*
* Ex: ['buddhist', 'japanese', 'persian']
*/
calendars?: string[];
/**
* Control which skeleton date time formats are available at runtime.
*/
["gregorian-available-format"]?: string[];
["gregorian-plural-format"]?: string[];
["gregorian-interval-format"]?: string[];
["buddhist-available-format"]?: string[];
["buddhist-plural-format"]?: string[];
["buddhist-interval-format"]?: string[];
["japanese-available-format"]?: string[];
["japanese-plural-format"]?: string[];
["japanese-interval-format"]?: string[];
["persian-available-format"]?: string[];
["persian-plural-format"]?: string[];
["persian-interval-format"]?: string[];
/**
* Currency codes to include.
*
* Ex: ['USD', 'EUR', 'GBP', 'JPY', 'CAD', ... ]
*/
["currency-id"]?: string[];
/**
* Language identifiers to include. This only controls
* inclusion of language display name data.
*/
["language-id"]?: string[];
/**
* Script identifiers to include. This only controls
* inclusion of script display name data.
*/
["script-id"]?: string[];
/**
* Region identifiers to include. This only controls
* inclusion of region display name data.
*/
["region-id"]?: string[];
/**
* Units to include.
*
* Ex: ['meter', 'kilogram', 'foot']
*/
["unit-id"]?: string[];
/**
* CLDR stable timezone identifiers to include. This only
* controls inclusion of exemplar city data. All timezone
* ids and offset data will work even if this array is
* empty.
*
* Ex: ['America/New_York', 'America/Adak', ... ]
*/
["timezone-id"]?: string[];
/**
* Number system names to include. Note that 'latn' will be
* included by default, even if omitted from this list.
*
* Ex: ['arab', 'laoo']
*/
["number-system-name"]?: string[];
}
/**
* A single part of a multi-part value.
*
* @public
*/
export interface Part {
type: string;
value: string;
}
/**
* Formatting of decimal values.
*
* @public
*/
export interface DecimalFormatter<T> {
/**
* Add a new part to the formatted value.
*/
add(c: string): void;
/**
* Finalize and return the formatted value.
*/
render(): T;
}
/**
* Flags indicate special values.
*
* @public
*/
export declare const enum DecimalFlag {
NONE = 0,
NAN = 1,
INFINITY = 2
}
/**
* Modes for controlling rounding.
*
* @public
*/
export type RoundingModeType = "up" | "down" | "ceiling" | "floor" | "half-up" | "half-down" | "half-even";
/**
* Sets the scale or precision, and the rounding mode for a math operation.
*
* @public
*/
export interface MathContext {
scale?: number;
precision?: number;
round?: RoundingModeType;
}
export declare const enum Op {
ADDITION = 0,
SUBTRACTION = 1,
MULTIPLICATION = 2,
DIVISION = 3,
MOD = 4
}
/**
* Valid argument for constructing a Decimal value.
*
* @public
*/
export type DecimalArg = number | string | Decimal;
/**
* Arbitrary precision decimal type.
*
* @public
*/
export declare class Decimal {
protected data: number[];
protected sign: number;
protected _exp: number;
protected flag: DecimalFlag;
constructor(num: DecimalArg);
/**
* Return the decimal's exponent.
*/
exp(): number;
/**
* Return true if this decimal is not a number (NaN).
*/
isNaN(): boolean;
/**
* Return true if this decimal is finite (not infinity or NaN).
*/
isFinite(): boolean;
/**
* Return true if this decimal is positive or negative infinity.
*/
isInfinity(): boolean;
/**
* Compare decimal u to v, returning the following:
*
* -1 if u < v
* 0 if u = v
* 1 if u > v
*
* If the abs flag is true compare the absolute values.
*
* Any NAN argument will always return -1.
*/
compare(v: DecimalArg, abs?: boolean): number;
/**
* Return the raw internal properties of the number. Use with caution.
*/
properties(): [
number[],
number,
number,
number
];
/**
* Return the absolute value of the number.
*/
abs(): Decimal;
/**
* Invert this number's sign.
*/
negate(): Decimal;
/**
* Indicates this number is negative.
*/
isNegative(): boolean;
/**
* Signum.
*/
signum(): number;
/**
* Check if this number can be represented as an integer without loss of precision.
* For example, '12.000' is the same number as '12'.
*/
isInteger(): boolean;
/**
* Number is exactly zero. Exponent may exist, e.g. "0e-2" is "0.00".
*/
isZero(): boolean;
/**
* Return the integer part.
*/
toInteger(): Decimal;
/**
* Adds v.
*/
add(v: DecimalArg): Decimal;
/**
* Subtracts v.
*/
subtract(v: DecimalArg): Decimal;
/**
* Multiplies by v with optional math context.
*/
multiply(v: DecimalArg, context?: MathContext): Decimal;
/**
* Divide by v with optional math context.
*/
divide(v: DecimalArg, context?: MathContext): Decimal;
/**
* Divide by v and return the quotient and remainder.
*/
divmod(v: DecimalArg): [
Decimal,
Decimal
];
/**
* Divide by v and return the remainder.
*/
mod(v: DecimalArg): Decimal;
/**
* Number of trailing zeros.
*/
trailingZeros(): number;
/**
* Strip all trailing zeros.
*/
stripTrailingZeros(): Decimal;
/**
* Return a scientific representation of the number,
* Decimal coefficient and adjusted exponent.
*/
scientific(minIntDigits?: number): [
Decimal,
number
];
/**
* Number of digits in the unscaled value.
*/
precision(): number;
/**
* Scale is the number of digits to the right of the decimal point.
*/
scale(): number;
/**
* Number of integer digits, 1 or higher.
*/
integerDigits(): number;
/**
* Returns a new number with the given scale, shifting the coefficient as needed.
*/
setScale(scale: number, roundingMode?: RoundingModeType): Decimal;
/**
* Adjusted exponent for alignment. Two numbers with the same aligned exponent are
* aligned for arithmetic operations. If the aligned exponents do not match one
* number must be shifted.
*/
alignexp(): number;
/**
* Move the decimal point -n (left) or +n (right) places. Does not change
* precision, only affects the exponent.
*/
movePoint(n: number): Decimal;
/**
* Shifts all digits to the left, increasing the precision.
*/
shiftleft(shift: number): Decimal;
/**
* Shifts all digits to the right, reducing the precision. Result is rounded
* using the given rounding mode.
*/
shiftright(shift: number, mode?: RoundingModeType): Decimal;
/**
* Increment the least-significant integer digit.
*/
increment(): Decimal;
/**
* Decrement the least-significant integer digit.
*/
decrement(): Decimal;
/**
* Format the number to a string, using fixed point.
*/
toString(): string;
/**
* Format this number to scientific notation as a string.
*/
toScientificString(minIntegers?: number): string;
/**
* Format this number to an array of parts.
*/
toParts(): Part[];
/**
* Format this number to scientific notation as an array of parts.
*/
toScientificParts(minIntegers?: number): Part[];
/**
* Low-level formatting of string and Part[] forms.
*/
format<R>(formatter: DecimalFormatter<R>, decimal: string, group: string, minInt: number, minGroup: number, priGroup: number, secGroup: number, zeroScale: boolean, digits?: string[]): void;
protected formatFlags(): string;
protected formatFlagsParts(): Part[];
protected formatString(d: Decimal, minInt: number): string;
protected formatParts(d: Decimal, minInt: number): Part[];
/**
* Handle setting of flags for operations per the IEEE-754-2008 specification.
* These rules are also referenced in the EcmaScript specification:
*
* 12.7.3.1 - Applying the mul operator:
* https://tc39.github.io/ecma262/#sec-applying-the-mul-operator
*
* 12.7.3.2 - Applying the div operator:
* https://tc39.github.io/ecma262/#sec-applying-the-div-operator
*
* 12.7.3.3 - Applying the mod operator:
* https://tc39.github.io/ecma262/#sec-applying-the-mod-operator
*
* 12.8.5 - Applying the additive operators to numbers:
* https://tc39.github.io/ecma262/#sec-applying-the-additive-operators-to-numbers
*
*/
protected handleFlags(op: Op, v: Decimal): Decimal | undefined;
protected static fromRaw(sign: number, _exp: number, data: number[], flag: DecimalFlag): Decimal;
/**
* Mutating in-place shift left.
*/
protected _shiftleft(shift: number): void;
/**
* Mutating in-place shift right.
*/
protected _shiftright(shift: number, mode: RoundingModeType): void;
protected _setScale(scale: number, roundingMode?: RoundingModeType): void;
protected _stripTrailingZeros(): void;
/**
* Trim leading zeros from a result and reset sign and exponent accordingly.
*/
protected trim(): Decimal;
/**
* Increment the least-significant digit of the coefficient.
*/
protected _increment(): void;
/**
* Return a rounding indicator for a given rounding mode,
*/
protected round(rnd: number, rest: number, mode: RoundingModeType): number;
/**
* Return true if this instance is odd.
*/
protected isodd(): boolean;
/**
* Addition and subtraction.
*/
protected addsub(u: Decimal, v: Decimal, vsign: number): Decimal;
/**
* Parse a number or string setting the fields on the current instance.
*/
protected parse(arg: string | number): void;
/**
* Parse a string into a Decimal.
*
* Expects strings of the form:
* "[-+][digits][.][digits][eE][-+][digits]"
* or:
* "[nN]a[nN]" for a NaN
* "[-+]?[iI]nfinity" for positive or negative infinity
*/
protected _parse(str: string): string | undefined;
}
/**
* Common Decimal values as constants.
*
* @public
*/
export declare const DecimalConstants: {
ZERO: Decimal;
ONE: Decimal;
TWO: Decimal;
PI: Decimal;
E: Decimal;
NAN: Decimal;
POSITIVE_INFINITY: Decimal;
NEGATIVE_INFINITY: Decimal;
};
/**
* Valid argument for constructing a Rational value.
*
* @public
*/
export type RationalArg = Rational | Decimal | number | string;
/**
* Arbitrary precision rational type.
*
* @public
*/
export declare class Rational {
protected numer: Decimal;
protected denom: Decimal;
constructor(numerator: DecimalArg, denominator?: DecimalArg);
numerator(): Decimal;
denominator(): Decimal;
compare(num: RationalArg, context?: MathContext): number;
divide(num: RationalArg, context?: MathContext): Rational;
multiply(num: RationalArg, context?: MathContext): Rational;
inverse(): Rational;
toDecimal(context?: MathContext): Decimal;
toString(): string;
private _parse;
}
/**
* IETF BCP 47 language tag with static methods for parsing, adding likely
* subtags, etc.
*
* @public
*/
export declare class LanguageTag {
protected core: (undefined | string)[];
protected _extensions: {
[x: string]: string[];
};
protected _privateUse: string;
protected _extlangs: string[];
protected _compact?: string;
protected _expanded?: string;
constructor(language?: string, script?: string, region?: string, variant?: string, extensions?: {
[x: string]: string[];
}, privateUse?: string, extlangs?: string[]);
/**
* Language subtag.
*/
language(): string;
/**
* Returns true if the language subtag is defined.
*/
hasLanguage(): boolean;
/**
* Script subtag.
*/
script(): string;
/**
* Returns true if the script subtag is defined.
*/
hasScript(): boolean;
/**
* Region subtag.
*/
region(): string;
/**
* Returns true if the region subtag is defined.
*/
hasRegion(): boolean;
/**
* Variant subtag.
*/
variant(): string;
/**
* Return a copy of this language tag's extensions map.
*/
extensions(): {
[x: string]: string[];
};
/**
* Return a copy of the extensions of the given type. Use 'u' for Unicode
* and 't' for Transforms.
*/
extensionSubtags(key: string): string[];
/**
* Private use subtag.
*/
privateUse(): string;
/**
* Extended language tags, used for BCP 47 canonicalization.
*/
extlangs(): string[];
/**
* Return a compact string representation of the language tag. Any undefined
* fields will be omitted.
*/
compact(): string;
/**
* Return an expanded string representation of the language tag. Any undefined
* fields will emit their undefined value.
*/
expanded(): string;
/**
* Return a compact string representation of the language tag. Any undefined
* fields will be omitted.
*/
toString(): string;
/**
* Render a tag in compact or expanded form.
*/
private render;
}
/**
* Wrapper pairing an application's opaque locale identifier with a
* parsed and resolved language tag object.
*
* @public
*/
export interface Locale {
/**
* Application's own identifier for the locale, e.g. 'en_US', 'fr-CA', etc.
* We preserve this since applications may use it as a unique key to
* resolve translated messages, and may be forced to use a legacy
* identifier.
*/
readonly id: string;
/**
* Language tag that has been parsed and resolved. Parsing canonicalizes
* the subtags, while resolution includes substituting language and
* territory aliases and adding likely subtags.
*/
readonly tag: LanguageTag;
}
/**
* Merged declaration to add a resolve() method to Locale interface.
*
* @public
*/
export declare class LocaleResolver {
/**
* Parses a language tag and resolves it, substituting aliases and
* adding likely subtags.
*/
static resolve(id: string): Locale;
}
/**
* Methods for substituting language and region aliases, adding likely subtags, etc.
*
* @public
*/
export declare class LanguageResolver {
/**
* Substitute aliases only.
*/
static substituteAliases(real: string | LanguageTag): LanguageTag;
/**
* Substitute all relevant aliases, and then add likely subtags.
*/
static resolve(real: string | LanguageTag): LanguageTag;
/**
* Add any missing subtags using the likely subtags mapping. For example,
* this would convert "en" to "en-Latn-US".
*/
static addLikelySubtags(real: string | LanguageTag): LanguageTag;
/**
* Remove any subtags that would be added by addLikelySubtags() above. For example,
* this would convert "en-Latn-US" to "en".
*/
static removeLikelySubtags(real: string | LanguageTag): LanguageTag;
}
/**
* A result returned by the LocaleMatcher.
*
* @public
*/
export interface LocaleMatch {
/**
* The locale that was matched.
*/
locale: Locale;
/**
* Distance of the match from the desired locale.
*/
distance: number;
}
/**
* Options for the LocaleMatcher.
*
* @public
*/
export interface LocaleMatcherOptions {
/**
* Resolve language tags. (default true)
*/
resolve?: boolean;
}
/**
* Given a list of supported locales, and a list of a user's desired locales
* (sorted in the order of preference, descending), returns the supported
* locale closest to the user preference. The first locale in the list will
* be used as the default. The default will be selected if no match is within
* the distance threshold.
*
* Implementation of CLDR enhanced language matching:
* http://www.unicode.org/reports/tr35/tr35.html#EnhancedLanguageMatching
*
* @public
*/
export declare class LocaleMatcher {
private supported;
private count;
private default;
private exactMap;
constructor(supportedLocales: string | (Locale | LanguageTag | string)[], options?: LocaleMatcherOptions);
/**
* Find the desired locale that is the closed match to a supported locale, within
* the given threshold. Any matches whose distance is greater than or equal to the
* threshold will be treated as having maximum distance.
*/
match(desiredLocales: string | string[], threshold?: number): LocaleMatch;
}
/**
* Operands for use in evaluating localized plural rules:
* See: http://www.unicode.org/reports/tr35/tr35-numbers.html#Plural_Operand_Meanings
*
* symbol value
* ----------------
* n absolute value of the source number (integer and decimals)
* i integer digits of n
* v number of visible fraction digits in n, with trailing zeros
* w number of visible fraction digits in n, without trailing zeros
* f visible fractional digits in n, with trailing zeros
* t visible fractional digits in n, without trailing zeros
* c compact decimal exponent value
* e synonym for 'c', may be redefined in the future
*
* @public
*/
export declare class NumberOperands {
n: number;
i: number;
v: number;
w: number;
f: number;
t: number;
c: number;
/**
* Compute the plural operands for the Decimal `d` with optional compact
* exponent `c`.
*/
constructor(d: Decimal, c?: number);
toString(): string;
}
/**
* Plural operations for a given language.
*
* @public
*/
export interface PluralRules {
operands(d: Decimal): NumberOperands;
cardinal(n: DecimalArg, c?: number): string;
ordinal(n: DecimalArg): string;
range(start: DecimalArg, end: DecimalArg): string;
}
/**
* Global instance for fetching plural rules by language and region.
*
* @public
*/
export declare class Plurals {
/**
* Get the plural rules for a given language and optional region.
*/
get(language: string, region?: string): PluralRules;
}
/**
* Global instance for fetching plural rules by language and region.
*
* @public
*/
export declare const pluralRules: Plurals;
/**
* An argument value can have any type. We cast at the time of evaluation.
* This allows us to accept rich arguments for user-defined custom formatters.
*
* @public
*/
export type MessageArg = any;
/**
* Named args where each argument is given an explicit associative index or name.
* These can override positional arguments.
*
* @public
*/
export type MessageNamedArgs = {
[s: string]: MessageArg;
[n: number]: MessageArg;
};
/**
* Interface for argument converters.
*
* @public
*/
export interface MessageArgConverter {
asString(arg: MessageArg | undefined): string;
asDecimal(arg: MessageArg | undefined): Decimal;
}
/**
* Converts arguments to string or Decimal.
*
* @public
*/
export declare class DefaultMessageArgConverter implements MessageArgConverter {
/**
* Convert to a string if possible.
*/
asString(arg: MessageArg | undefined): string;
/**
* Convert to a Decimal if possible, or zero.
*/
asDecimal(arg: MessageArg | undefined): Decimal;
}
/**
* A string and range of characters [s, e) (from 's' up to but not including 'e'),
* representing the current state of the parse of a given scope inside a
* message string.
*
* @public
*/
export interface MessageState {
t: string;
s: number;
e: number;
}
/**
* Matches message syntax fragments.
*
* @public
*/
export interface MessageMatcher {
/**
* Return the next character.
*/
char(r: MessageState): string;
/**
* Indicate if we've reached the end of input.
*/
complete(r: MessageState): boolean;
/**
* Match one or more spaces.
*/
spaces(r: MessageState): boolean;
/**
* Match a list of arguments.
*/
arguments(r: MessageState): (number | string)[] | undefined;
/**
* Match variable identifier.
*/
identifier(r: MessageState): string | undefined;
/**
* Match a list of options.
*/
options(r: MessageState): string[];
/**
* Match a formatter name.
*/
formatter(r: MessageState): string | undefined;
/**
* Match a plural offset.
*/
pluralOffset(r: MessageState): number;
/**
* Match a plural choice (exact or category).
*/
pluralChoice(r: MessageState): string | undefined;
}
/**
* Constructs the right instance of matcher based on the runtime environment's
* support of sticky regexp, while allowing substring matcher to be selected for
* testing.
*
* @public
*/
export declare const buildMessageMatcher: (names: string[], sticky?: boolean) => MessageMatcher;
/**
* Argument reference inside a message instruction.
*
* @public
*/
export type Argument = string | number;
/**
* Type of a message instruction.
*
* @public
*/
export declare const enum MessageOpType {
TEXT = 0,
ARG = 1,
PLURAL = 2,
SELECT = 3,
BLOCK = 4,
NOOP = 5,
SIMPLE = 6,
ARGSUB = 7
}
/**
* Instruction representing "no operation".
*
* @public
*