summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XCustomTimeZone.d.ts
blob: 290f7881ad39d847456b917fbae33035a9ea1a45 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import { i32 } from "./diplomat-runtime"
import { FFIError } from "./diplomat-runtime"
import { ICU4XError } from "./ICU4XError";
import { ICU4XIanaToBcp47Mapper } from "./ICU4XIanaToBcp47Mapper";
import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime";
import { ICU4XMetazoneCalculator } from "./ICU4XMetazoneCalculator";

/**

 * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html Rust documentation for `CustomTimeZone`} for more information.
 */
export class ICU4XCustomTimeZone {

  /**

   * Creates a time zone from an offset string.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.from_str Rust documentation for `from_str`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create_from_string(s: string): ICU4XCustomTimeZone | never;

  /**

   * Creates a time zone with no information.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.new_empty Rust documentation for `new_empty`} for more information.
   */
  static create_empty(): ICU4XCustomTimeZone;

  /**

   * Creates a time zone for UTC.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc Rust documentation for `utc`} for more information.
   */
  static create_utc(): ICU4XCustomTimeZone;

  /**

   * Sets the `gmt_offset` field from offset seconds.

   * Errors if the offset seconds are out of range.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.try_from_offset_seconds Rust documentation for `try_from_offset_seconds`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  try_set_gmt_offset_seconds(offset_seconds: i32): void | never;

  /**

   * Clears the `gmt_offset` field.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds Rust documentation for `offset_seconds`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1}
   */
  clear_gmt_offset(): void;

  /**

   * Returns the value of the `gmt_offset` field as offset seconds.

   * Errors if the `gmt_offset` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds Rust documentation for `offset_seconds`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  gmt_offset_seconds(): i32 | never;

  /**

   * Returns whether the `gmt_offset` field is positive.

   * Errors if the `gmt_offset` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_positive Rust documentation for `is_positive`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  is_gmt_offset_positive(): boolean | never;

  /**

   * Returns whether the `gmt_offset` field is zero.

   * Errors if the `gmt_offset` field is empty (which is not the same as zero).

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_zero Rust documentation for `is_zero`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  is_gmt_offset_zero(): boolean | never;

  /**

   * Returns whether the `gmt_offset` field has nonzero minutes.

   * Errors if the `gmt_offset` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_minutes Rust documentation for `has_minutes`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  gmt_offset_has_minutes(): boolean | never;

  /**

   * Returns whether the `gmt_offset` field has nonzero seconds.

   * Errors if the `gmt_offset` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_seconds Rust documentation for `has_seconds`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  gmt_offset_has_seconds(): boolean | never;

  /**

   * Sets the `time_zone_id` field from a BCP-47 string.

   * Errors if the string is not a valid BCP-47 time zone ID.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  try_set_time_zone_id(id: string): void | never;

  /**

   * Sets the `time_zone_id` field from an IANA string by looking up the corresponding BCP-47 string.

   * Errors if the string is not a valid BCP-47 time zone ID.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47MapperBorrowed.html#method.get Rust documentation for `get`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  try_set_iana_time_zone_id(mapper: ICU4XIanaToBcp47Mapper, id: string): void | never;

  /**

   * Clears the `time_zone_id` field.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1}
   */
  clear_time_zone_id(): void;

  /**

   * Writes the value of the `time_zone_id` field as a string.

   * Errors if the `time_zone_id` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  time_zone_id(): string | never;

  /**

   * Sets the `metazone_id` field from a string.

   * Errors if the string is not a valid BCP-47 metazone ID.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  try_set_metazone_id(id: string): void | never;

  /**

   * Clears the `metazone_id` field.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1}
   */
  clear_metazone_id(): void;

  /**

   * Writes the value of the `metazone_id` field as a string.

   * Errors if the `metazone_id` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  metazone_id(): string | never;

  /**

   * Sets the `zone_variant` field from a string.

   * Errors if the string is not a valid zone variant.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  try_set_zone_variant(id: string): void | never;

  /**

   * Clears the `zone_variant` field.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1}
   */
  clear_zone_variant(): void;

  /**

   * Writes the value of the `zone_variant` field as a string.

   * Errors if the `zone_variant` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  zone_variant(): string | never;

  /**

   * Sets the `zone_variant` field to standard time.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard Rust documentation for `standard`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1}
   */
  set_standard_time(): void;

  /**

   * Sets the `zone_variant` field to daylight time.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight Rust documentation for `daylight`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1}
   */
  set_daylight_time(): void;

  /**

   * Returns whether the `zone_variant` field is standard time.

   * Errors if the `zone_variant` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard Rust documentation for `standard`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  is_standard_time(): boolean | never;

  /**

   * Returns whether the `zone_variant` field is daylight time.

   * Errors if the `zone_variant` field is empty.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight Rust documentation for `daylight`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1}
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  is_daylight_time(): boolean | never;

  /**

   * Sets the metazone based on the time zone and the local timestamp.

   * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_metazone Rust documentation for `maybe_calculate_metazone`} for more information.

   * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.compute_metazone_from_time_zone 1}
   */
  maybe_calculate_metazone(metazone_calculator: ICU4XMetazoneCalculator, local_datetime: ICU4XIsoDateTime): void;
}