// generated by diplomat-tool
import type { DateDurationParseError } from "./DateDurationParseError"
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";

export type DateDuration_obj = {
    isNegative: boolean;
    years: number;
    months: number;
    weeks: number;
    days: number;
};



/**
 * See the [Rust documentation for `DateDuration`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.DateDuration.html) for more information.
 */
export class DateDuration {
    get isNegative(): boolean;
    set isNegative(value: boolean);
    get years(): number;
    set years(value: number);
    get months(): number;
    set months(value: number);
    get weeks(): number;
    set weeks(value: number);
    get days(): number;
    set days(value: number);
    /** @internal */
    static fromFields(structObj : DateDuration_obj) : DateDuration;

    /**
    * Create `DateDuration` from an object that contains all of `DateDuration`s fields.
    * Optional fields do not need to be included in the provided object.
    */
    constructor(structObj: DateDuration_obj);


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

    /**
     * Returns a new {@link DateDuration} representing a number of years.
     *
     * See the [Rust documentation for `for_years`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.DateDuration.html#method.for_years) for more information.
     */
    static forYears(years: number): DateDuration;

    /**
     * Returns a new {@link DateDuration} representing a number of months.
     *
     * See the [Rust documentation for `for_months`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.DateDuration.html#method.for_months) for more information.
     */
    static forMonths(months: number): DateDuration;

    /**
     * Returns a new {@link DateDuration} representing a number of weeks.
     *
     * See the [Rust documentation for `for_weeks`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.DateDuration.html#method.for_weeks) for more information.
     */
    static forWeeks(weeks: number): DateDuration;

    /**
     * Returns a new {@link DateDuration} representing a number of days.
     *
     * See the [Rust documentation for `for_days`](https://docs.rs/icu/2.2.0/icu/calendar/types/struct.DateDuration.html#method.for_days) for more information.
     */
    static forDays(days: number): DateDuration;
}