| 1 |
import { FFIError } from "./diplomat-runtime" |
| 2 |
import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone"; |
| 3 |
import { ICU4XDataProvider } from "./ICU4XDataProvider"; |
| 4 |
import { ICU4XDateLength } from "./ICU4XDateLength"; |
| 5 |
import { ICU4XDateTime } from "./ICU4XDateTime"; |
| 6 |
import { ICU4XError } from "./ICU4XError"; |
| 7 |
import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; |
| 8 |
import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions"; |
| 9 |
import { ICU4XLocale } from "./ICU4XLocale"; |
| 10 |
import { ICU4XTimeLength } from "./ICU4XTimeLength"; |
| 11 |
|
| 12 |
/** |
| 13 |
|
| 14 |
* An object capable of formatting a date time with time zone to a string. |
| 15 |
|
| 16 |
* See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html Rust documentation for `ZonedDateTimeFormatter`} for more information. |
| 17 |
*/ |
| 18 |
export class ICU4XZonedDateTimeFormatter { |
| 19 |
|
| 20 |
/** |
| 21 |
|
| 22 |
* Creates a new {@link ICU4XZonedDateTimeFormatter `ICU4XZonedDateTimeFormatter`} from locale data. |
| 23 |
|
| 24 |
* This function has `date_length` and `time_length` arguments and uses default options for the time zone. |
| 25 |
|
| 26 |
* See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new Rust documentation for `try_new`} for more information. |
| 27 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 28 |
*/ |
| 29 |
static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XZonedDateTimeFormatter | never; |
| 30 |
|
| 31 |
/** |
| 32 |
|
| 33 |
* Creates a new {@link ICU4XZonedDateTimeFormatter `ICU4XZonedDateTimeFormatter`} from locale data. |
| 34 |
|
| 35 |
* This function has `date_length` and `time_length` arguments and uses an ISO-8601 style fallback for the time zone with the given configurations. |
| 36 |
|
| 37 |
* See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new Rust documentation for `try_new`} for more information. |
| 38 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 39 |
*/ |
| 40 |
static create_with_lengths_and_iso_8601_time_zone_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength, zone_options: ICU4XIsoTimeZoneOptions): ICU4XZonedDateTimeFormatter | never; |
| 41 |
|
| 42 |
/** |
| 43 |
|
| 44 |
* Formats a {@link ICU4XDateTime `ICU4XDateTime`} and {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. |
| 45 |
|
| 46 |
* See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. |
| 47 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 48 |
*/ |
| 49 |
format_datetime_with_custom_time_zone(datetime: ICU4XDateTime, time_zone: ICU4XCustomTimeZone): string | never; |
| 50 |
|
| 51 |
/** |
| 52 |
|
| 53 |
* Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} and {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. |
| 54 |
|
| 55 |
* See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. |
| 56 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 57 |
*/ |
| 58 |
format_iso_datetime_with_custom_time_zone(datetime: ICU4XIsoDateTime, time_zone: ICU4XCustomTimeZone): string | never; |
| 59 |
} |