import type { PropertyDefs } from "../../support/Serializable.js";
import { SerializableBase } from "../../support/Serializable.js";
/**
 * Default settings that affect how numbers are formatted and parsed.
 */
export interface NumberSettings {
    /**
     * The default format for formatting numbers. See
     * {@link utilities/format/number!NumberFormatter.format}.
     */
    defaultFormat?: string;
    /**
     * Either a single format, or one of several possible formats that the input
     * is expected to be in. If specified, the input must _exactly_ match. The
     * syntax is the same as for
     * {@link utilities/format/number!NumberFormatter.format}.
     */
    defaultParseFormat?: string | string[];
    /**
     * The 3-letter ISO 4217 currency code (e.g "USD", "CAD"). Required when
     * formatting a number using NumberFormat.CURRENCY or
     * NumberFormat.ACCOUNTING.
     */
    currency?: string;
    /**
     * The number of digits to show after the decimal point. If unspecified, an
     * appropriate value is determined based on the locale and currency.
     */
    fractionalDigits?: number;
}
/**
 * Options supported by {@link format}.
 */
export interface FormatOptions {
    /**
     * The locale to use when formatting the number. If not specified, the
     * current locale is used (see locale module).
     */
    locale?: string;
    /**
     * The number format. See
     * {@link utilities/format/number!NumberFormatter.format}.
     */
    format?: string;
    /**
     * See {@link NumberSettings.currency}.
     */
    currency?: string;
    /**
     * The unit to use when formatting the number. If specified any additional
     * supplied format will be ignored. Example: 'kilometer', 'mile', 'celsius'
     * etc. See
     * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#supported_unit_identifiers}.
     */
    unit?: string;
    /**
     * See {@link NumberSettings.fractionalDigits}.
     */
    fractionalDigits?: number;
}
/**
 * Options supported by {@link parse}.
 */
export interface ParseOptions {
    /**
     * The locale to use when parsing the number. If not specified, the current
     * locale is used (see locale module).
     */
    locale?: string;
    /**
     * Either a single format, or one of several possible formats that the input
     * is expected to be in. If specified, the input must _exactly_ match. See
     * {@link NumberFormatter.format}.
     */
    format?: string | string[];
}
/**
 * Formats a number for display in the current locale.
 *
 * @param num The number to format.
 */
export declare function format(num: number): string;
/**
 * Formats a number for display.
 *
 * @param format See {@link utilities/format/number!NumberFormatter.format}.
 * @param num The number to format.
 */
export declare function format(format: string, num: number): string;
/**
 * Formats a number for display.
 *
 * @param options Specifies the format settings to use.
 * @param num The number to format.
 */
export declare function format(options: FormatOptions, num: number): string;
/**
 * Parses a value into a number.
 *
 * @param input The input to parse.
 * @returns A number corresponding to the input, or NaN if the input can't be
 *   parsed.
 */
export declare function parse(input: unknown): number;
/**
 * Parses a value into a number.
 *
 * @param format See {@link ParseOptions.format}.
 * @param input The input to parse.
 * @returns A number corresponding to the input, or NaN if the input can't be
 *   parsed.
 */
export declare function parse(format: string | string[], input: unknown): number;
/**
 * Parses a value into a number.
 *
 * @param options The options to use for parsing.
 * @param input The input to parse.
 * @returns A number corresponding to the input, or NaN if the input can't be
 *   parsed.
 */
export declare function parse(options: ParseOptions, input: unknown): number;
/**
 * Properties that can be passed into the constructor for
 * {@link utilities/format/number!NumberFormatter}.
 */
export interface NumberFormatterProperties extends NumberSettings {
    /**
     * The locale to use when formatting & parsing the number. If not specified,
     * the current locale is used (see locale module).
     */
    locale?: string;
}
/**
 * A helper class for formatting and parsing numbers.
 */
export declare class NumberFormatter extends SerializableBase<NumberFormatterProperties> implements NumberSettings {
    /**
     * @inheritDoc
     */
    get defaultFormat(): string | undefined;
    set defaultFormat(defaultFormat: string | undefined);
    /**
     * @inheritDoc
     */
    get defaultParseFormat(): string | undefined;
    set defaultParseFormat(defaultParseFormat: string | undefined);
    /**
     * @inheritDoc
     */
    get currency(): string | undefined;
    set currency(currency: string | undefined);
    /**
     * @inheritDoc
     */
    get fractionalDigits(): number | undefined;
    set fractionalDigits(fractionalDigits: number | undefined);
    /**
     * The locale to use when formatting & parsing the number. If not specified,
     * the current locale is used (see locale module).
     */
    locale: string | undefined;
    private _defaultFormat;
    private _defaultParseFormat;
    private _currency;
    private _fractionalDigits;
    /**
     * See {@link format}.
     */
    format(format: string, num: number): string;
    format(options: FormatOptions, num: number): string;
    format(num: number): string;
    /**
     * See {@link parse}.
     */
    parse(input: unknown): number;
    parse(format: string | string[], input: unknown): number;
    parse(options: ParseOptions, input: unknown): number;
    protected _getSerializableProperties(): PropertyDefs<NumberFormatterProperties>;
    /**
     * Converts a format string accepted by formatNumber() to formatter
     * function.
     *
     * @param inputLocales The locale.
     * @param format The format to use.
     * @param defaultOptions Options that control how values are formatted.
     */
    private _createNumberFormatter;
    /**
     * Create a numeric parser function for a set of locales.
     *
     * @param inputLocales An ordered array of locales to be used for parsing
     *   sorted in order of precedence.
     */
    private _createNumberParser;
}
/**
 * Default settings used for formatting and parsing numbers.
 */
export declare const settings: NumberSettings;
