Socket
Socket
Sign inDemoInstall

@formatjs/ecma402-abstract

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/ecma402-abstract - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

262.d.ts

2

_validate_dist-base_options.optionsvalid.d.ts
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/1009/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-base
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/714/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-base
// composite: false

@@ -4,0 +4,0 @@ // declaration: true

// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/1008/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-esm
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/716/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-esm
// composite: false

@@ -4,0 +4,0 @@ // declaration: true

@@ -0,16 +1,47 @@

export * from './src/CanonicalizeLocaleList';
export * from './src/CanonicalizeTimeZoneName';
export * from './src/DateTimeFormat/BasicFormatMatcher';
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher';
export * from './src/DateTimeFormat/DateTimeStyleFormat';
export * from './src/DateTimeFormat/FormatDateTime';
export * from './src/DateTimeFormat/FormatDateTimeToParts';
export * from './src/DateTimeFormat/InitializeDateTimeFormat';
export * from './src/DateTimeFormat/PartitionDateTimePattern';
export * from './src/DateTimeFormat/ToDateTimeOptions';
export * from './src/GetNumberOption';
export * from './src/GetOption';
export * from './src/IsSanctionedSimpleUnitIdentifier';
export * from './src/IsValidTimeZoneName';
export * from './src/IsWellFormedCurrencyCode';
export * from './src/IsWellFormedUnitIdentifier';
export * from './src/NumberFormat/ComputeExponent';
export * from './src/NumberFormat/ComputeExponentForMagnitude';
export * from './src/NumberFormat/CurrencyDigits';
export * from './src/NumberFormat/FormatNumericToParts';
export * from './src/NumberFormat/FormatNumericToString';
export * from './src/NumberFormat/InitializeNumberFormat';
export * from './src/NumberFormat/PartitionNumberPattern';
export * from './src/NumberFormat/SetNumberFormatDigitOptions';
export * from './src/NumberFormat/SetNumberFormatUnitOptions';
export * from './src/NumberFormat/ToRawFixed';
export * from './src/NumberFormat/ToRawPrecision';
export * from './src/PartitionPattern';
export * from './src/PluralRules/GetOperands';
export * from './src/PluralRules/InitializePluralRules';
export * from './src/PluralRules/ResolvePlural';
export * from './src/RelativeTimeFormat/FormatRelativeTime';
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts';
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat';
export * from './src/RelativeTimeFormat/MakePartsList';
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern';
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit';
export * from './src/ResolveLocale';
export * from './src/SupportedLocales';
export { default as _formatToParts } from './src/NumberFormat/format_to_parts';
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils';
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton';
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, LiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils';
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data';
export * from './types/relative-time';
export * from './types/date-time';
export * from './types/list';

@@ -22,2 +53,3 @@ export * from './types/plural-rules';

export { LocaleData } from './types/core';
export * from './262';
//# sourceMappingURL=index.d.ts.map

@@ -13,22 +13,56 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./src/CanonicalizeLocaleList"), exports);
__exportStar(require("./src/CanonicalizeTimeZoneName"), exports);
__exportStar(require("./src/DateTimeFormat/BasicFormatMatcher"), exports);
var BestFitFormatMatcher_1 = require("./src/DateTimeFormat/BestFitFormatMatcher");
Object.defineProperty(exports, "BestFitFormatMatcher", { enumerable: true, get: function () { return BestFitFormatMatcher_1.BestFitFormatMatcher; } });
__exportStar(require("./src/DateTimeFormat/DateTimeStyleFormat"), exports);
__exportStar(require("./src/DateTimeFormat/FormatDateTime"), exports);
__exportStar(require("./src/DateTimeFormat/FormatDateTimeToParts"), exports);
__exportStar(require("./src/DateTimeFormat/InitializeDateTimeFormat"), exports);
__exportStar(require("./src/DateTimeFormat/PartitionDateTimePattern"), exports);
__exportStar(require("./src/DateTimeFormat/ToDateTimeOptions"), exports);
__exportStar(require("./src/GetNumberOption"), exports);
__exportStar(require("./src/GetOption"), exports);
__exportStar(require("./src/IsSanctionedSimpleUnitIdentifier"), exports);
__exportStar(require("./src/IsValidTimeZoneName"), exports);
__exportStar(require("./src/IsWellFormedCurrencyCode"), exports);
__exportStar(require("./src/IsWellFormedUnitIdentifier"), exports);
__exportStar(require("./src/NumberFormat/ComputeExponent"), exports);
__exportStar(require("./src/NumberFormat/ComputeExponentForMagnitude"), exports);
__exportStar(require("./src/NumberFormat/CurrencyDigits"), exports);
__exportStar(require("./src/NumberFormat/FormatNumericToParts"), exports);
__exportStar(require("./src/NumberFormat/FormatNumericToString"), exports);
__exportStar(require("./src/NumberFormat/InitializeNumberFormat"), exports);
__exportStar(require("./src/NumberFormat/PartitionNumberPattern"), exports);
__exportStar(require("./src/NumberFormat/SetNumberFormatDigitOptions"), exports);
__exportStar(require("./src/NumberFormat/SetNumberFormatUnitOptions"), exports);
__exportStar(require("./src/NumberFormat/ToRawFixed"), exports);
__exportStar(require("./src/NumberFormat/ToRawPrecision"), exports);
__exportStar(require("./src/PartitionPattern"), exports);
__exportStar(require("./src/PluralRules/GetOperands"), exports);
__exportStar(require("./src/PluralRules/InitializePluralRules"), exports);
__exportStar(require("./src/PluralRules/ResolvePlural"), exports);
__exportStar(require("./src/RelativeTimeFormat/FormatRelativeTime"), exports);
__exportStar(require("./src/RelativeTimeFormat/FormatRelativeTimeToParts"), exports);
__exportStar(require("./src/RelativeTimeFormat/InitializeRelativeTimeFormat"), exports);
__exportStar(require("./src/RelativeTimeFormat/MakePartsList"), exports);
__exportStar(require("./src/RelativeTimeFormat/PartitionRelativeTimePattern"), exports);
__exportStar(require("./src/RelativeTimeFormat/SingularRelativeTimeUnit"), exports);
__exportStar(require("./src/ResolveLocale"), exports);
__exportStar(require("./src/SupportedLocales"), exports);
var utils_1 = require("./src/utils");
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_1.getInternalSlot; } });
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_1.getMultiInternalSlots; } });
Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_1.isLiteralPart; } });
Object.defineProperty(exports, "setInternalSlot", { enumerable: true, get: function () { return utils_1.setInternalSlot; } });
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_1.setMultiInternalSlots; } });
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_1.getMagnitude; } });
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } });
var format_to_parts_1 = require("./src/NumberFormat/format_to_parts");
Object.defineProperty(exports, "_formatToParts", { enumerable: true, get: function () { return format_to_parts_1.default; } });
var utils_1 = require("./src/DateTimeFormat/utils");
Object.defineProperty(exports, "DATE_TIME_PROPS", { enumerable: true, get: function () { return utils_1.DATE_TIME_PROPS; } });
var skeleton_1 = require("./src/DateTimeFormat/skeleton");
Object.defineProperty(exports, "parseDateTimeSkeleton", { enumerable: true, get: function () { return skeleton_1.parseDateTimeSkeleton; } });
var utils_2 = require("./src/utils");
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_2.getInternalSlot; } });
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_2.getMultiInternalSlots; } });
Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_2.isLiteralPart; } });
Object.defineProperty(exports, "setInternalSlot", { enumerable: true, get: function () { return utils_2.setInternalSlot; } });
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_2.setMultiInternalSlots; } });
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_2.getMagnitude; } });
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_2.defineProperty; } });
var data_1 = require("./src/data");

@@ -39,2 +73,3 @@ Object.defineProperty(exports, "getLocaleHierarchy", { enumerable: true, get: function () { return data_1.getLocaleHierarchy; } });

__exportStar(require("./types/relative-time"), exports);
__exportStar(require("./types/date-time"), exports);
__exportStar(require("./types/list"), exports);

@@ -44,3 +79,4 @@ __exportStar(require("./types/plural-rules"), exports);

__exportStar(require("./types/displaynames"), exports);
var utils_2 = require("./src/utils");
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_2.invariant; } });
var utils_3 = require("./src/utils");
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_3.invariant; } });
__exportStar(require("./262"), exports);

@@ -0,16 +1,47 @@

export * from './src/CanonicalizeLocaleList';
export * from './src/CanonicalizeTimeZoneName';
export * from './src/DateTimeFormat/BasicFormatMatcher';
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher';
export * from './src/DateTimeFormat/DateTimeStyleFormat';
export * from './src/DateTimeFormat/FormatDateTime';
export * from './src/DateTimeFormat/FormatDateTimeToParts';
export * from './src/DateTimeFormat/InitializeDateTimeFormat';
export * from './src/DateTimeFormat/PartitionDateTimePattern';
export * from './src/DateTimeFormat/ToDateTimeOptions';
export * from './src/GetNumberOption';
export * from './src/GetOption';
export * from './src/IsSanctionedSimpleUnitIdentifier';
export * from './src/IsValidTimeZoneName';
export * from './src/IsWellFormedCurrencyCode';
export * from './src/IsWellFormedUnitIdentifier';
export * from './src/NumberFormat/ComputeExponent';
export * from './src/NumberFormat/ComputeExponentForMagnitude';
export * from './src/NumberFormat/CurrencyDigits';
export * from './src/NumberFormat/FormatNumericToParts';
export * from './src/NumberFormat/FormatNumericToString';
export * from './src/NumberFormat/InitializeNumberFormat';
export * from './src/NumberFormat/PartitionNumberPattern';
export * from './src/NumberFormat/SetNumberFormatDigitOptions';
export * from './src/NumberFormat/SetNumberFormatUnitOptions';
export * from './src/NumberFormat/ToRawFixed';
export * from './src/NumberFormat/ToRawPrecision';
export * from './src/PartitionPattern';
export * from './src/PluralRules/GetOperands';
export * from './src/PluralRules/InitializePluralRules';
export * from './src/PluralRules/ResolvePlural';
export * from './src/RelativeTimeFormat/FormatRelativeTime';
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts';
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat';
export * from './src/RelativeTimeFormat/MakePartsList';
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern';
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit';
export * from './src/ResolveLocale';
export * from './src/SupportedLocales';
export { default as _formatToParts } from './src/NumberFormat/format_to_parts';
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils';
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton';
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, LiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils';
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data';
export * from './types/relative-time';
export * from './types/date-time';
export * from './types/list';

@@ -22,2 +53,3 @@ export * from './types/plural-rules';

export { LocaleData } from './types/core';
export * from './262';
//# sourceMappingURL=index.d.ts.map

@@ -0,16 +1,47 @@

export * from './src/CanonicalizeLocaleList';
export * from './src/CanonicalizeTimeZoneName';
export * from './src/DateTimeFormat/BasicFormatMatcher';
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher';
export * from './src/DateTimeFormat/DateTimeStyleFormat';
export * from './src/DateTimeFormat/FormatDateTime';
export * from './src/DateTimeFormat/FormatDateTimeToParts';
export * from './src/DateTimeFormat/InitializeDateTimeFormat';
export * from './src/DateTimeFormat/PartitionDateTimePattern';
export * from './src/DateTimeFormat/ToDateTimeOptions';
export * from './src/GetNumberOption';
export * from './src/GetOption';
export * from './src/IsSanctionedSimpleUnitIdentifier';
export * from './src/IsValidTimeZoneName';
export * from './src/IsWellFormedCurrencyCode';
export * from './src/IsWellFormedUnitIdentifier';
export * from './src/NumberFormat/ComputeExponent';
export * from './src/NumberFormat/ComputeExponentForMagnitude';
export * from './src/NumberFormat/CurrencyDigits';
export * from './src/NumberFormat/FormatNumericToParts';
export * from './src/NumberFormat/FormatNumericToString';
export * from './src/NumberFormat/InitializeNumberFormat';
export * from './src/NumberFormat/PartitionNumberPattern';
export * from './src/NumberFormat/SetNumberFormatDigitOptions';
export * from './src/NumberFormat/SetNumberFormatUnitOptions';
export * from './src/NumberFormat/ToRawFixed';
export * from './src/NumberFormat/ToRawPrecision';
export * from './src/PartitionPattern';
export * from './src/PluralRules/GetOperands';
export * from './src/PluralRules/InitializePluralRules';
export * from './src/PluralRules/ResolvePlural';
export * from './src/RelativeTimeFormat/FormatRelativeTime';
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts';
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat';
export * from './src/RelativeTimeFormat/MakePartsList';
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern';
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit';
export * from './src/ResolveLocale';
export * from './src/SupportedLocales';
export { default as _formatToParts } from './src/NumberFormat/format_to_parts';
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils';
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton';
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils';
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data';
export * from './types/relative-time';
export * from './types/date-time';
export * from './types/list';

@@ -21,1 +52,2 @@ export * from './types/plural-rules';

export { invariant } from './src/utils';
export * from './262';

@@ -1,2 +0,2 @@

import ToString from 'es-abstract/2019/ToString';
import { ToString } from '../262';
/**

@@ -3,0 +3,0 @@ * https://tc39.es/ecma402/#sec-getoption

@@ -1,2 +0,2 @@

import SameValue from 'es-abstract/5/SameValue';
import { SameValue } from '../../262';
import { ToRawPrecision } from './ToRawPrecision';

@@ -3,0 +3,0 @@ import { repeat } from '../utils';

@@ -1,2 +0,2 @@

import ToObject from 'es-abstract/2019/ToObject';
import { ToObject } from '../262';
import { GetOption } from './GetOption';

@@ -3,0 +3,0 @@ import { LookupSupportedLocales } from './LookupSupportedLocales';

@@ -101,2 +101,46 @@ import { LDMLPluralRule } from './plural-rules';

}
export declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit';
export declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit';
export declare type NumberFormatOptionsCompactDisplay = 'short' | 'long';
export declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol';
export declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting';
export declare type NumberFormatOptionsNotation = NumberFormatNotation;
export declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero';
export declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow';
export interface NumberFormatInternal extends NumberFormatDigitInternalSlots {
locale: string;
dataLocale: string;
style: NumberFormatOptionsStyle;
currency?: string;
currencyDisplay: NumberFormatOptionsCurrencyDisplay;
unit?: string;
unitDisplay: NumberFormatOptionsUnitDisplay;
currencySign: NumberFormatOptionsCurrencySign;
notation: NumberFormatOptionsNotation;
compactDisplay: NumberFormatOptionsCompactDisplay;
signDisplay: NumberFormatOptionsSignDisplay;
useGrouping: boolean;
pl: Intl.PluralRules;
boundFormat?: Intl.NumberFormat['format'];
numberingSystem: string;
dataLocaleData: NumberFormatLocaleInternalData;
}
export declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & {
localeMatcher?: NumberFormatOptionsLocaleMatcher;
style?: NumberFormatOptionsStyle;
compactDisplay?: NumberFormatOptionsCompactDisplay;
currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
currencySign?: NumberFormatOptionsCurrencySign;
notation?: NumberFormatOptionsNotation;
signDisplay?: NumberFormatOptionsSignDisplay;
unit?: string;
unitDisplay?: NumberFormatOptionsUnitDisplay;
numberingSystem?: string;
};
export declare type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick<NumberFormatInternal, 'currencySign' | 'unit' | 'unitDisplay' | 'notation' | 'compactDisplay' | 'signDisplay'>;
export declare type NumberFormatPartTypes = Intl.NumberFormatPartTypes | 'exponentSeparator' | 'exponentMinusSign' | 'exponentInteger' | 'compact' | 'unit' | 'literal';
export interface NumberFormatPart {
type: NumberFormatPartTypes;
value: string;
}
//# sourceMappingURL=number.d.ts.map
import { LocaleData } from './core';
import { NumberFormatDigitInternalSlots } from './number';
export declare type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';

@@ -11,2 +12,7 @@ export interface PluralRulesData {

export declare type PluralRulesLocaleData = LocaleData<PluralRulesData>;
export interface PluralRulesInternal extends NumberFormatDigitInternalSlots {
initializedPluralRules: boolean;
locale: string;
type: 'cardinal' | 'ordinal';
}
//# sourceMappingURL=plural-rules.d.ts.map
import { LocaleData } from './core';
import { LDMLPluralRule } from './plural-rules';
import { LiteralPart } from '../src/utils';
export interface FieldData {

@@ -29,3 +30,65 @@ '0'?: string;

export declare type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;
export declare type RelativeTimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
export declare type RelativeTimeUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years';
export declare type RelativeTimeFormattableUnit = RelativeTimeUnit | RelativeTimeUnits;
export declare type RelativeTimePart = LiteralPart | RelativeTimeFormatNumberPart;
export interface RelativeTimeFormatNumberPart extends Intl.NumberFormatPart {
unit: RelativeTimeUnit;
}
export interface IntlRelativeTimeFormatOptions {
/**
* The locale matching algorithm to use.
* Possible values are "lookup" and "best fit"; the default is "best fit".
* For information about this option, see
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation.
*/
localeMatcher?: 'best fit' | 'lookup';
/**
* The format of output message. Possible values are:
* - "always" (default, e.g., 1 day ago),
* - or "auto" (e.g., yesterday).
* The "auto" value allows to not always have to
* use numeric values in the output.
*/
numeric?: 'always' | 'auto';
/**
* The length of the internationalized message. Possible values are:
* - "long" (default, e.g., in 1 month)
* - "short" (e.g., in 1 mo.),
* - or "narrow" (e.g., in 1 mo.).
* The narrow style could be similar to the short style for some locales.
*/
style?: 'long' | 'short' | 'narrow';
}
export interface ResolvedIntlRelativeTimeFormatOptions extends Pick<IntlRelativeTimeFormatOptions, 'style' | 'numeric'> {
/**
* The BCP 47 language tag for the locale actually used.
* If any Unicode extension values were requested in the
* input BCP 47 language tag that led to this locale,
* the key-value pairs that were requested and are
* supported for this locale are included in locale.
*/
locale: string;
/**
* The value requested using the Unicode
* extension key "nu" or filled in as a default.
*/
numberingSystem: string;
}
export interface RelativeTimeFormat {
format(value: number, unit: RelativeTimeFormattableUnit): string;
formatToParts(value: number, unit: RelativeTimeFormattableUnit): RelativeTimePart[];
resolvedOptions(): ResolvedIntlRelativeTimeFormatOptions;
}
export interface RelativeTimeFormatInternal {
numberFormat: Intl.NumberFormat;
pluralRules: Intl.PluralRules;
locale: string;
fields: LocaleFieldsData;
style: IntlRelativeTimeFormatOptions['style'];
numeric: IntlRelativeTimeFormatOptions['numeric'];
numberingSystem: string;
initializedRelativeTimeFormat: boolean;
}
export {};
//# sourceMappingURL=relative-time.d.ts.map
{
"name": "@formatjs/ecma402-abstract",
"version": "1.0.3",
"version": "1.1.0",
"description": "A collection of implementation for ECMAScript abstract operations",

@@ -30,7 +30,3 @@ "keywords": [

"license": "MIT",
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
"dependencies": {
"@types/es-abstract": "^1.17.1",
"es-abstract": "^1.17.6"
}
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c"
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetOption = void 0;
var ToString_1 = __importDefault(require("es-abstract/2019/ToString"));
var _262_1 = require("../262");
/**

@@ -27,3 +24,3 @@ * https://tc39.es/ecma402/#sec-getoption

if (type === 'string') {
value = ToString_1.default(value);
value = _262_1.ToString(value);
}

@@ -30,0 +27,0 @@ if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatNumericToString = void 0;
var SameValue_1 = __importDefault(require("es-abstract/5/SameValue"));
var _262_1 = require("../../262");
var ToRawPrecision_1 = require("./ToRawPrecision");

@@ -15,3 +12,3 @@ var utils_1 = require("../utils");

function FormatNumericToString(intlObject, x) {
var isNegative = x < 0 || SameValue_1.default(x, -0);
var isNegative = x < 0 || _262_1.SameValue(x, -0);
if (isNegative) {

@@ -18,0 +15,0 @@ x = -x;

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SupportedLocales = void 0;
var ToObject_1 = __importDefault(require("es-abstract/2019/ToObject"));
var _262_1 = require("../262");
var GetOption_1 = require("./GetOption");

@@ -19,3 +16,3 @@ var LookupSupportedLocales_1 = require("./LookupSupportedLocales");

if (options !== undefined) {
options = ToObject_1.default(options);
options = _262_1.ToObject(options);
matcher = GetOption_1.GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');

@@ -22,0 +19,0 @@ }

@@ -101,2 +101,46 @@ import { LDMLPluralRule } from './plural-rules';

}
export declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit';
export declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit';
export declare type NumberFormatOptionsCompactDisplay = 'short' | 'long';
export declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol';
export declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting';
export declare type NumberFormatOptionsNotation = NumberFormatNotation;
export declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero';
export declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow';
export interface NumberFormatInternal extends NumberFormatDigitInternalSlots {
locale: string;
dataLocale: string;
style: NumberFormatOptionsStyle;
currency?: string;
currencyDisplay: NumberFormatOptionsCurrencyDisplay;
unit?: string;
unitDisplay: NumberFormatOptionsUnitDisplay;
currencySign: NumberFormatOptionsCurrencySign;
notation: NumberFormatOptionsNotation;
compactDisplay: NumberFormatOptionsCompactDisplay;
signDisplay: NumberFormatOptionsSignDisplay;
useGrouping: boolean;
pl: Intl.PluralRules;
boundFormat?: Intl.NumberFormat['format'];
numberingSystem: string;
dataLocaleData: NumberFormatLocaleInternalData;
}
export declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & {
localeMatcher?: NumberFormatOptionsLocaleMatcher;
style?: NumberFormatOptionsStyle;
compactDisplay?: NumberFormatOptionsCompactDisplay;
currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
currencySign?: NumberFormatOptionsCurrencySign;
notation?: NumberFormatOptionsNotation;
signDisplay?: NumberFormatOptionsSignDisplay;
unit?: string;
unitDisplay?: NumberFormatOptionsUnitDisplay;
numberingSystem?: string;
};
export declare type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick<NumberFormatInternal, 'currencySign' | 'unit' | 'unitDisplay' | 'notation' | 'compactDisplay' | 'signDisplay'>;
export declare type NumberFormatPartTypes = Intl.NumberFormatPartTypes | 'exponentSeparator' | 'exponentMinusSign' | 'exponentInteger' | 'compact' | 'unit' | 'literal';
export interface NumberFormatPart {
type: NumberFormatPartTypes;
value: string;
}
//# sourceMappingURL=number.d.ts.map
import { LocaleData } from './core';
import { NumberFormatDigitInternalSlots } from './number';
export declare type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';

@@ -11,2 +12,7 @@ export interface PluralRulesData {

export declare type PluralRulesLocaleData = LocaleData<PluralRulesData>;
export interface PluralRulesInternal extends NumberFormatDigitInternalSlots {
initializedPluralRules: boolean;
locale: string;
type: 'cardinal' | 'ordinal';
}
//# sourceMappingURL=plural-rules.d.ts.map
import { LocaleData } from './core';
import { LDMLPluralRule } from './plural-rules';
import { LiteralPart } from '../src/utils';
export interface FieldData {

@@ -29,3 +30,65 @@ '0'?: string;

export declare type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;
export declare type RelativeTimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
export declare type RelativeTimeUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years';
export declare type RelativeTimeFormattableUnit = RelativeTimeUnit | RelativeTimeUnits;
export declare type RelativeTimePart = LiteralPart | RelativeTimeFormatNumberPart;
export interface RelativeTimeFormatNumberPart extends Intl.NumberFormatPart {
unit: RelativeTimeUnit;
}
export interface IntlRelativeTimeFormatOptions {
/**
* The locale matching algorithm to use.
* Possible values are "lookup" and "best fit"; the default is "best fit".
* For information about this option, see
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation.
*/
localeMatcher?: 'best fit' | 'lookup';
/**
* The format of output message. Possible values are:
* - "always" (default, e.g., 1 day ago),
* - or "auto" (e.g., yesterday).
* The "auto" value allows to not always have to
* use numeric values in the output.
*/
numeric?: 'always' | 'auto';
/**
* The length of the internationalized message. Possible values are:
* - "long" (default, e.g., in 1 month)
* - "short" (e.g., in 1 mo.),
* - or "narrow" (e.g., in 1 mo.).
* The narrow style could be similar to the short style for some locales.
*/
style?: 'long' | 'short' | 'narrow';
}
export interface ResolvedIntlRelativeTimeFormatOptions extends Pick<IntlRelativeTimeFormatOptions, 'style' | 'numeric'> {
/**
* The BCP 47 language tag for the locale actually used.
* If any Unicode extension values were requested in the
* input BCP 47 language tag that led to this locale,
* the key-value pairs that were requested and are
* supported for this locale are included in locale.
*/
locale: string;
/**
* The value requested using the Unicode
* extension key "nu" or filled in as a default.
*/
numberingSystem: string;
}
export interface RelativeTimeFormat {
format(value: number, unit: RelativeTimeFormattableUnit): string;
formatToParts(value: number, unit: RelativeTimeFormattableUnit): RelativeTimePart[];
resolvedOptions(): ResolvedIntlRelativeTimeFormatOptions;
}
export interface RelativeTimeFormatInternal {
numberFormat: Intl.NumberFormat;
pluralRules: Intl.PluralRules;
locale: string;
fields: LocaleFieldsData;
style: IntlRelativeTimeFormatOptions['style'];
numeric: IntlRelativeTimeFormatOptions['numeric'];
numberingSystem: string;
initializedRelativeTimeFormat: boolean;
}
export {};
//# sourceMappingURL=relative-time.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc