Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XTimeZoneFormatter.d.ts

raw
1 import { FFIError } from "./diplomat-runtime"
2 import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone";
3 import { ICU4XDataProvider } from "./ICU4XDataProvider";
4 import { ICU4XError } from "./ICU4XError";
5 import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions";
6 import { ICU4XLocale } from "./ICU4XLocale";
7
8 /**
9
10 * An ICU4X TimeZoneFormatter object capable of formatting an {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} type (and others) as a string
11
12 * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html Rust documentation for `TimeZoneFormatter`} for more information.
13 */
14 export class ICU4XTimeZoneFormatter {
15
16 /**
17
18 * Creates a new {@link ICU4XTimeZoneFormatter `ICU4XTimeZoneFormatter`} from locale data.
19
20 * Uses localized GMT as the fallback format.
21
22 * 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.
23
24 * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1}
25 * @throws {@link FFIError}<{@link ICU4XError}>
26 */
27 static create_with_localized_gmt_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XTimeZoneFormatter | never;
28
29 /**
30
31 * Creates a new {@link ICU4XTimeZoneFormatter `ICU4XTimeZoneFormatter`} from locale data.
32
33 * Uses ISO-8601 as the fallback format.
34
35 * 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.
36
37 * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1}
38 * @throws {@link FFIError}<{@link ICU4XError}>
39 */
40 static create_with_iso_8601_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, options: ICU4XIsoTimeZoneOptions): ICU4XTimeZoneFormatter | never;
41
42 /**
43
44 * Loads generic non-location long format. Example: "Pacific Time"
45
46 * 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.
47 * @throws {@link FFIError}<{@link ICU4XError}>
48 */
49 load_generic_non_location_long(provider: ICU4XDataProvider): void | never;
50
51 /**
52
53 * Loads generic non-location short format. Example: "PT"
54
55 * 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.
56 * @throws {@link FFIError}<{@link ICU4XError}>
57 */
58 load_generic_non_location_short(provider: ICU4XDataProvider): void | never;
59
60 /**
61
62 * Loads specific non-location long format. Example: "Pacific Standard Time"
63
64 * 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.
65 * @throws {@link FFIError}<{@link ICU4XError}>
66 */
67 load_specific_non_location_long(provider: ICU4XDataProvider): void | never;
68
69 /**
70
71 * Loads specific non-location short format. Example: "PST"
72
73 * 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.
74 * @throws {@link FFIError}<{@link ICU4XError}>
75 */
76 load_specific_non_location_short(provider: ICU4XDataProvider): void | never;
77
78 /**
79
80 * Loads generic location format. Example: "Los Angeles Time"
81
82 * 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.
83 * @throws {@link FFIError}<{@link ICU4XError}>
84 */
85 load_generic_location_format(provider: ICU4XDataProvider): void | never;
86
87 /**
88
89 * Loads localized GMT format. Example: "GMT-07:00"
90
91 * 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.
92 * @throws {@link FFIError}<{@link ICU4XError}>
93 */
94 include_localized_gmt_format(): void | never;
95
96 /**
97
98 * Loads ISO-8601 format. Example: "-07:00"
99
100 * 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.
101 * @throws {@link FFIError}<{@link ICU4XError}>
102 */
103 load_iso_8601_format(options: ICU4XIsoTimeZoneOptions): void | never;
104
105 /**
106
107 * Formats a {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string.
108
109 * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format Rust documentation for `format`} for more information.
110
111 * 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.
112 * @throws {@link FFIError}<{@link ICU4XError}>
113 */
114 format_custom_time_zone(value: ICU4XCustomTimeZone): string | never;
115
116 /**
117
118 * Formats a {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string, performing no fallback
119
120 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.FormattedTimeZone.html#method.write_no_fallback Rust documentation for `write_no_fallback`} for more information.
121 * @throws {@link FFIError}<{@link ICU4XError}>
122 */
123 format_custom_time_zone_no_fallback(value: ICU4XCustomTimeZone): string | never;
124 }