summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XWeekCalculator.d.ts
blob: cf60ebbc186fe6a58c3383454fa3d77d10cd0df4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { u8 } from "./diplomat-runtime"
import { FFIError } from "./diplomat-runtime"
import { ICU4XDataProvider } from "./ICU4XDataProvider";
import { ICU4XError } from "./ICU4XError";
import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday";
import { ICU4XLocale } from "./ICU4XLocale";

/**

 * A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types

 * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html Rust documentation for `WeekCalculator`} for more information.
 */
export class ICU4XWeekCalculator {

  /**

   * Creates a new {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} from locale data.

   * 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.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XWeekCalculator | never;

  /**

   * 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}
   */
  static create_from_first_day_of_week_and_min_week_days(first_weekday: ICU4XIsoWeekday, min_week_days: u8): ICU4XWeekCalculator;

  /**

   * Returns the weekday that starts the week for this object's locale

   * 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.
   */
  first_weekday(): ICU4XIsoWeekday;

  /**

   * The minimum number of days overlapping a year required for a week to be considered part of that year

   * 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.
   */
  min_week_days(): u8;
}