AK-21/Graphite-Industrial-Intelligence
0
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17declare namespace Intl {18 // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories19 type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other";20 type PluralRuleType = "cardinal" | "ordinal";21 22 interface PluralRulesOptions {23 localeMatcher?: "lookup" | "best fit" | undefined;24 type?: PluralRuleType | undefined;25 minimumIntegerDigits?: number | undefined;26 minimumFractionDigits?: number | undefined;27 maximumFractionDigits?: number | undefined;28 minimumSignificantDigits?: number | undefined;29 maximumSignificantDigits?: number | undefined;30 }31 32 interface ResolvedPluralRulesOptions {33 locale: string;34 pluralCategories: LDMLPluralRule[];35 type: PluralRuleType;36 minimumIntegerDigits: number;37 minimumFractionDigits: number;38 maximumFractionDigits: number;39 minimumSignificantDigits?: number;40 maximumSignificantDigits?: number;41 }42 43 interface PluralRules {44 resolvedOptions(): ResolvedPluralRulesOptions;45 select(n: number): LDMLPluralRule;46 }47 48 interface PluralRulesConstructor {49 new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;50 (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;51 supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];52 }53 54 const PluralRules: PluralRulesConstructor;55 56 interface NumberFormatPartTypeRegistry {57 literal: never;58 nan: never;59 infinity: never;60 percent: never;61 integer: never;62 group: never;63 decimal: never;64 fraction: never;65 plusSign: never;66 minusSign: never;67 percentSign: never;68 currency: never;69 }70 71 type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry;72 73 interface NumberFormatPart {74 type: NumberFormatPartTypes;75 value: string;76 }77 78 interface NumberFormat {79 formatToParts(number?: number | bigint): NumberFormatPart[];80 }81}82 