// generated by diplomat-tool
import type { Calendar } from "./Calendar"
import type { CalendarDateAddError } from "./CalendarDateAddError"
import type { CalendarDateFromFieldsError } from "./CalendarDateFromFieldsError"
import type { CalendarError } from "./CalendarError"
import type { CalendarMismatchedCalendarError } from "./CalendarMismatchedCalendarError"
import type { DateAddOptions } from "./DateAddOptions"
import type { DateAddOptions_obj } from "./DateAddOptions"
import type { DateDifferenceOptions } from "./DateDifferenceOptions"
import type { DateDifferenceOptions_obj } from "./DateDifferenceOptions"
import type { DateDuration } from "./DateDuration"
import type { DateDuration_obj } from "./DateDuration"
import type { DateFields } from "./DateFields"
import type { DateFields_obj } from "./DateFields"
import type { DateFromFieldsOptions } from "./DateFromFieldsOptions"
import type { DateFromFieldsOptions_obj } from "./DateFromFieldsOptions"
import type { IsoDate } from "./IsoDate"
import type { Rfc9557ParseError } from "./Rfc9557ParseError"
import type { Weekday } from "./Weekday"
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";



/**
 * An ICU4X Date object capable of containing a date for any calendar.
 *
 * See the [Rust documentation for `Date`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html) for more information.
 */
export class Date {
    /** @internal */
    get ffiValue(): pointer;
    /** @internal */
    constructor();


    /**
     * Creates a new {@link Date} representing the ISO date
     * given but in a given calendar
     *
     * See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.new_from_iso) for more information.
     */
    static fromIsoInCalendar(isoYear: number, isoMonth: number, isoDay: number, calendar: Calendar): Date;

    /**
     * Creates a new {@link Date} from the given fields, which are interpreted in the given calendar system.
     *
     * See the [Rust documentation for `try_from_fields`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.try_from_fields) for more information.
     */
    static fromFieldsInCalendar(fields: DateFields_obj, options: DateFromFieldsOptions_obj, calendar: Calendar): Date;

    /**
     * Creates a new {@link Date} from the given codes, which are interpreted in the given calendar system
     *
     * An empty era code will treat the year as an extended year
     *
     * See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.try_new) for more information.
     *
     * See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.Month.html#method.try_from_str) for more information.
     */
    static fromCodesInCalendar(eraCode: string, year: number, monthCode: string, day: number, calendar: Calendar): Date;

    /**
     * Creates a new {@link Date} from the given Rata Die
     *
     * See the [Rust documentation for `from_rata_die`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.from_rata_die) for more information.
     */
    static fromRataDie(rd: bigint, calendar: Calendar): Date;

    /**
     * Creates a new {@link Date} from an IXDTF string.
     *
     * See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.try_from_str) for more information.
     */
    static fromString(v: string, calendar: Calendar): Date;

    /**
     * Convert this date to one in a different calendar
     *
     * See the [Rust documentation for `to_calendar`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.to_calendar) for more information.
     */
    toCalendar(calendar: Calendar): Date;

    /**
     * Converts this date to ISO
     *
     * See the [Rust documentation for `to_iso`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.to_iso) for more information.
     */
    toIso(): IsoDate;

    /**
     * Returns this date's Rata Die
     *
     * See the [Rust documentation for `to_rata_die`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.to_rata_die) for more information.
     */
    get rataDie(): bigint;

    /**
     * Returns the 1-indexed day in the year for this date
     *
     * See the [Rust documentation for `day_of_year`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.day_of_year) for more information.
     */
    get dayOfYear(): number;

    /**
     * Returns the 1-indexed day in the month for this date
     *
     * See the [Rust documentation for `day_of_month`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.day_of_month) for more information.
     */
    get dayOfMonth(): number;

    /**
     * Returns the day in the week for this day
     *
     * This is *not* the day of the week, an ordinal number that is locale
     * dependent.
     *
     * See the [Rust documentation for `day_of_week`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.day_of_week) for more information.
     *
     * @deprecated use `weekday`
     */
    get dayOfWeek(): Weekday;

    /**
     * Returns the day in the week for this day
     *
     * See the [Rust documentation for `weekday`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.weekday) for more information.
     */
    get weekday(): Weekday;

    /**
     * Returns 1-indexed number of the month of this date in its year
     *
     * Note that for lunar calendars this may not lead to the same month
     * having the same ordinal month across years; use `month_code` if you care
     * about month identity.
     *
     * See the [Rust documentation for `month`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.month) for more information.
     *
     * See the [Rust documentation for `ordinal`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.MonthInfo.html#structfield.ordinal) for more information.
     */
    get ordinalMonth(): number;

    /**
     * Returns the month code for this date. Typically something
     * like "M01", "M02", but can be more complicated for lunar calendars.
     *
     * See the [Rust documentation for `code`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.Month.html#method.code) for more information.
     *
     * See the [Rust documentation for `standard_code`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.MonthInfo.html#structfield.standard_code) for more information.
     *
     * Additional information: [1](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.month)
     */
    get monthCode(): string;

    /**
     * Returns the month number of this month.
     *
     * See the [Rust documentation for `number`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.Month.html#method.number) for more information.
     */
    get monthNumber(): number;

    /**
     * Returns whether the month is a leap month.
     *
     * See the [Rust documentation for `is_leap`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.Month.html#method.is_leap) for more information.
     */
    get monthIsLeap(): boolean;

    /**
     * Returns the year number in the current era for this date
     *
     * For calendars without an era, returns the related ISO year.
     *
     * See the [Rust documentation for `era_year_or_related_iso`](https://docs.rs/icu/2.2.0/icu/calendar/types/enum.YearInfo.html#method.era_year_or_related_iso) for more information.
     *
     * Additional information: [1](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.EraYear.html#structfield.year), [2](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.CyclicYear.html#structfield.related_iso), [3](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.year)
     */
    get eraYearOrRelatedIso(): number;

    /**
     * Returns the extended year, which can be used for
     *
     * This year number can be used when you need a simple numeric representation
     * of the year, and can be meaningfully compared with extended years from other
     * eras or used in arithmetic.
     *
     * See the [Rust documentation for `extended_year`](https://docs.rs/icu/2.2.0/icu/calendar/types/enum.YearInfo.html#method.extended_year) for more information.
     */
    get extendedYear(): number;

    /**
     * Returns the era for this date, or an empty string
     *
     * See the [Rust documentation for `era`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.EraYear.html#structfield.era) for more information.
     *
     * Additional information: [1](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.year)
     */
    get era(): string;

    /**
     * Returns the number of months in the year represented by this date
     *
     * See the [Rust documentation for `months_in_year`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.months_in_year) for more information.
     */
    get monthsInYear(): number;

    /**
     * Returns the number of days in the month represented by this date
     *
     * See the [Rust documentation for `days_in_month`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.days_in_month) for more information.
     */
    get daysInMonth(): number;

    /**
     * Returns the number of days in the year represented by this date
     *
     * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.days_in_year) for more information.
     */
    get daysInYear(): number;

    /**
     * Returns if the year is a leap year for this date
     *
     * See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information.
     */
    get isInLeapYear(): boolean;

    /**
     * Returns the {@link Calendar} object backing this date
     *
     * See the [Rust documentation for `calendar`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.calendar) for more information.
     */
    get calendar(): Calendar;

    /**
     * Returns a new {@link Date} with the given duration added to it.
     *
     * See the [Rust documentation for `try_added_with_options`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.try_added_with_options) for more information.
     */
    tryAddWithOptions(duration: DateDuration_obj, options: DateAddOptions_obj): Date;

    /**
     * Calculating the duration between `other - self`
     *
     * See the [Rust documentation for `try_until_with_options`](https://docs.rs/icu/2.2.0/icu/calendar/struct.Date.html#method.try_until_with_options) for more information.
     */
    tryUntilWithOptions(other: Date, options: DateDifferenceOptions_obj): DateDuration;
}