summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XTimeZoneFormatter.d.ts
blob: feae2fc23496c32ead8850eaee24fdf9b533b051 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { FFIError } from "./diplomat-runtime"
import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone";
import { ICU4XDataProvider } from "./ICU4XDataProvider";
import { ICU4XError } from "./ICU4XError";
import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions";
import { ICU4XLocale } from "./ICU4XLocale";

/**

 * An ICU4X TimeZoneFormatter object capable of formatting an {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} type (and others) as a string

 * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html Rust documentation for `TimeZoneFormatter`} for more information.
 */
export class ICU4XTimeZoneFormatter {

  /**

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

   * Uses localized GMT as the fallback format.

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new Rust documentation for `try_new`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create_with_localized_gmt_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XTimeZoneFormatter | never;

  /**

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

   * Uses ISO-8601 as the fallback format.

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new Rust documentation for `try_new`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create_with_iso_8601_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, options: ICU4XIsoTimeZoneOptions): ICU4XTimeZoneFormatter | never;

  /**

   * Loads generic non-location long format. Example: "Pacific Time"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_long Rust documentation for `include_generic_non_location_long`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_generic_non_location_long(provider: ICU4XDataProvider): void | never;

  /**

   * Loads generic non-location short format. Example: "PT"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_short Rust documentation for `include_generic_non_location_short`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_generic_non_location_short(provider: ICU4XDataProvider): void | never;

  /**

   * Loads specific non-location long format. Example: "Pacific Standard Time"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_long Rust documentation for `include_specific_non_location_long`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_specific_non_location_long(provider: ICU4XDataProvider): void | never;

  /**

   * Loads specific non-location short format. Example: "PST"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_short Rust documentation for `include_specific_non_location_short`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_specific_non_location_short(provider: ICU4XDataProvider): void | never;

  /**

   * Loads generic location format. Example: "Los Angeles Time"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_location_format Rust documentation for `include_generic_location_format`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_generic_location_format(provider: ICU4XDataProvider): void | never;

  /**

   * Loads localized GMT format. Example: "GMT-07:00"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_localized_gmt_format Rust documentation for `include_localized_gmt_format`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  include_localized_gmt_format(): void | never;

  /**

   * Loads ISO-8601 format. Example: "-07:00"

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_iso_8601_format Rust documentation for `include_iso_8601_format`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  load_iso_8601_format(options: ICU4XIsoTimeZoneOptions): void | never;

  /**

   * Formats a {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string.

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format Rust documentation for `format`} for more information.

   * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format_to_string Rust documentation for `format_to_string`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  format_custom_time_zone(value: ICU4XCustomTimeZone): string | never;
}