| 1 |
import { u8 } from "./diplomat-runtime" |
| 2 |
import { FFIError } from "./diplomat-runtime" |
| 3 |
import { ICU4XDataProvider } from "./ICU4XDataProvider"; |
| 4 |
import { ICU4XError } from "./ICU4XError"; |
| 5 |
import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; |
| 6 |
import { ICU4XLocale } from "./ICU4XLocale"; |
| 7 |
import { ICU4XWeekendContainsDay } from "./ICU4XWeekendContainsDay"; |
| 8 |
|
| 9 |
/** |
| 10 |
|
| 11 |
* A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types |
| 12 |
|
| 13 |
* See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html Rust documentation for `WeekCalculator`} for more information. |
| 14 |
*/ |
| 15 |
export class ICU4XWeekCalculator { |
| 16 |
|
| 17 |
/** |
| 18 |
|
| 19 |
* Creates a new {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} from locale data. |
| 20 |
|
| 21 |
* See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.try_new Rust documentation for `try_new`} for more information. |
| 22 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 23 |
*/ |
| 24 |
static create(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XWeekCalculator | never; |
| 25 |
|
| 26 |
/** |
| 27 |
|
| 28 |
* Additional information: {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday 1}, {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days 2} |
| 29 |
*/ |
| 30 |
static create_from_first_day_of_week_and_min_week_days(first_weekday: ICU4XIsoWeekday, min_week_days: u8): ICU4XWeekCalculator; |
| 31 |
|
| 32 |
/** |
| 33 |
|
| 34 |
* Returns the weekday that starts the week for this object's locale |
| 35 |
|
| 36 |
* See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday Rust documentation for `first_weekday`} for more information. |
| 37 |
*/ |
| 38 |
first_weekday(): ICU4XIsoWeekday; |
| 39 |
|
| 40 |
/** |
| 41 |
|
| 42 |
* The minimum number of days overlapping a year required for a week to be considered part of that year |
| 43 |
|
| 44 |
* See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days Rust documentation for `min_week_days`} for more information. |
| 45 |
*/ |
| 46 |
min_week_days(): u8; |
| 47 |
|
| 48 |
/** |
| 49 |
|
| 50 |
* See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.weekend Rust documentation for `weekend`} for more information. |
| 51 |
*/ |
| 52 |
weekend(): ICU4XWeekendContainsDay; |
| 53 |
} |