import type { PropertyDefs } from "../../support/Serializable.js";
import { SerializableBase } from "../../support/Serializable.js";
/**
 * Creates an error message for an invalid time zone.
 *
 * @param timeZone The invalid time zone string.
 */
export declare const ERR_TIME_ZONE_INVALID: (timeZone: string) => string;
/**
 * The default set of formats used for parsing date values.
 */
export declare const DEFAULT_PARSING_FORMATS: string[];
/**
 * Default settings that affect how dates are formatted and parsed.
 */
export interface DateSettings {
    /**
     * The default format for formatting dates. See
     * {@link utilities/format/date!DateFormatter.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/date!DateFormatter.format}.
     */
    defaultParseFormat?: string | string[];
}
/**
 * Options supported by {@link format}.
 */
export interface FormatOptions {
    /**
     * The locale to use when formatting the date. If not specified, the current
     * locale is used (see locale module).
     */
    locale?: string;
    /**
     * The date format. See {@link utilities/format/date!DateFormatter.format}.
     */
    format?: string;
    /**
     * The time zone of the date being formatted.
     */
    timeZone?: string;
    /**
     * Indicates if the date should be formatted without the time component even
     * if the format suggests to include a time.
     */
    isDateOnly?: boolean;
}
/**
 * Options supported by {@link parse}.
 */
export interface ParseOptions {
    /**
     * The locale to use when parsing the date. 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 utilities/format/date!DateFormatter.format}.
     */
    format?: string | string[];
    /**
     * The time zone of the date being parsed.
     */
    timeZone?: string;
    /**
     * Indicates if the date should be parsed without expecting the time
     * component even if the format suggests there is a time.
     */
    isDateOnly?: boolean;
}
/**
 * A special date instance that signifies failure to parse a date. This way of
 * signifying failure is in keeping with "new Date(string)" and
 * "Date.parse(string)".
 */
export declare const INVALID_DATE: Date;
/**
 * Determines whether the given date object represents a valid date.
 *
 * @param date The date to check.
 */
export declare function isValid(date: Date): boolean;
/**
 * Formats a date for display in the current locale.
 *
 * @param date The date to format.
 */
export declare function format(date: Date): string;
/**
 * Formats a date for display.
 *
 * @param format See {@link utilities/format/date!DateFormatter.format}.
 * @param date The date to format.
 */
export declare function format(format: string, date: Date): string;
/**
 * Formats a date for display.
 *
 * @param options Specifies the format settings to use.
 * @param date The date to format.
 */
export declare function format(options: FormatOptions, date: Date): string;
/**
 * Parses a value into a Date object. The input is assumed to be in local time.
 *
 * @param input The input to parse. Numbers are treated as UNIX timestamps
 *   (always UTC).
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parse(input: unknown): Date;
/**
 * Parses a value into a Date object. The input is assumed to be in local time.
 *
 * @param format See {@link ParseOptions.format}.
 * @param input The input to parse. Numbers are treated as UNIX timestamps
 *   (always UTC).
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parse(format: string | string[], input: unknown): Date;
/**
 * Parses a value into a Date object. The input is assumed to be in local time.
 *
 * @param options The options to use for parsing.
 * @param input The input to parse. Numbers are treated as UNIX timestamps
 *   (always UTC).
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parse(options: ParseOptions, input: unknown): Date;
/**
 * Parses a value into a Date object. The input is assumed to be in UTC.
 *
 * @param input The input to parse. Numbers are treated as UNIX timestamps.
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parseUtc(input: unknown): Date;
/**
 * Parses a value into a Date object. The input is assumed to be in UTC.
 *
 * @param format See {@link ParseOptions.format}.
 * @param input The input to parse. Numbers are treated as UNIX timestamps.
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parseUtc(format: string | string[], input: unknown): Date;
/**
 * Parses a value into a Date object. The input is assumed to be in UTC.
 *
 * @param options The options to use for parsing.
 * @param input The input to parse. Numbers are treated as UNIX timestamps.
 * @returns A Date object corresponding to the input, which might be an Invalid
 *   Date (i.e. getTime() will be NaN).
 */
export declare function parseUtc(options: ParseOptions, input: unknown): Date;
/**
 * Converts an Esri-style date format constant (e.g. "short-date-short-time") to
 * a format string that can be used with {@link format} and {@link parse}.
 *
 * @param format The Esri-style format constant to convert.
 */
export declare function esriFormatToGeocortexFormat(format: string): string;
/**
 * Checks that a given time zone is valid.
 *
 * @param timeZone The IANA tz database identifier of the target time zone, e.g.
 *   "America/Vancouver", "Pacific/Fiji". See http://www.iana.org/time-zones and
 *   {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones}.
 * @returns True if the time zone is valid and false if not.
 */
export declare function isValidTimeZone(timeZone: string): boolean;
/**
 * Properties that can be passed into the constructor for
 * {@link utilities/format/date!DateFormatter}.
 */
export interface DateFormatterProperties extends DateSettings {
    /**
     * The locale to use when formatting & parsing the number. If not specified,
     * the current locale is used (see locale module).
     */
    locale?: string;
    /**
     * The time zone of the date being formatted.
     */
    timeZone?: string;
    /**
     * The time zone of the date being parsed.
     */
    parseTimeZone?: string;
}
/**
 * A helper class for formatting and parsing dates.
 */
export declare class DateFormatter extends SerializableBase<DateFormatterProperties> implements DateSettings {
    /**
     * @inheritDoc
     */
    get defaultFormat(): string | undefined;
    /**
     * @inheritDoc
     */
    set defaultFormat(value: string | undefined);
    /**
     * @inheritDoc
     */
    defaultParseFormat: string | undefined;
    /**
     * The locale to use when formatting & parsing the number. If not specified,
     * the current locale is used (see locale module).
     */
    locale: string | undefined;
    /**
     * The time zone of the date being formatted.
     */
    get timeZone(): string | undefined;
    set timeZone(value: string | undefined);
    /**
     * The time zone of the date being parsed.
     */
    get parseTimeZone(): string | undefined;
    set parseTimeZone(value: string | undefined);
    private _timeZone;
    private _parseTimeZone;
    private _defaultFormat;
    /**
     * Formats a date for display.
     *
     * @param date The date to format.
     */
    format(date: Date): string;
    /**
     * Formats a date for display.
     *
     * @param date The date to format.
     * @param format The format for presenting dates. One of the
     *   {@link utilities/format/formats!DateFormat} constants, or a custom
     *   format string. The format string syntax is similar to
     *   {@link https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx|this},
     *   with the following exceptions:
     *
     *   - "/", and ":" are treated as literal characters.
     *   - "y" is treated as "yy", and "yyy" is treated as "yyyy".
     *   - "z" and "zz" and "zzz" are treated as the UTC offset
     *   - "t" is treated the same as "tt".
     *   - "F", "FF", "FFF" etc. will behave the same as "f", "ff", "fff", etc.
     *       Additionally, a maximum of 3 digits (milliseconds) is supported.
     *       Longer formatters like "fffff" are truncated to 3 digits, rather
     *       than padded with zeros.
     *   - "K" is not supported at all and will be ignored. If not specified, it
     *       will default to DATE_TIME_SHORT.
     */
    format(format: string, date: Date): string;
    /**
     * Formats a date for display.
     *
     * @param date The date to format.
     * @param options Options that control how the date is formatted.
     */
    format(options: FormatOptions, date: Date): string;
    /**
     * Parses a value into a Date object. The input is assumed to be in local
     * time, unless it's a timestamp..
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC unless timezone is specified).
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parse(input: unknown): Date;
    /**
     * Parses a value into a Date object. The input is assumed to be in local
     * time, unless it's a timestamp..
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC unless timezone is specified).
     * @param format See {@link ParseOptions.format}.
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parse(format: string | string[], input: unknown): Date;
    /**
     * Parses a value into a Date object. The input is assumed to be in local
     * time, unless it's a timestamp.
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC unless timezone is specified).
     * @param options The options to use for parsing.
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parse(options: ParseOptions, input: unknown): Date;
    /**
     * Parses a value into a Date object. The input is assumed to be in UTC.
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC even if timezone is specified).
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parseUtc(input: unknown | undefined): Date;
    /**
     * Parses a value into a Date object. The input is assumed to be in UTC.
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC even if timezone is specified).
     * @param format See {@link ParseOptions.format}.
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parseUtc(format: string | string[], input: unknown): Date;
    /**
     * Parses a value into a Date object. The input is assumed to be in UTC.
     *
     * @param input The input to parse. Numbers are treated as UNIX timestamps
     *   (always assumed to be UTC even if timezone is specified).
     * @param options The options to use for parsing.
     * @returns A Date object corresponding to the input, which might be an
     *   Invalid Date (i.e. getTime() will be NaN).
     */
    parseUtc(options: ParseOptions, input: unknown): Date;
    protected _getSerializableProperties(): PropertyDefs<DateFormatterProperties>;
    private _parse;
}
/**
 * Default settings used for formatting and parsing dates.
 */
export declare const settings: DateSettings;
