Debian Codegraph @

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

raw
1 import { FFIError } from "./diplomat-runtime"
2 import { ICU4XDataProvider } from "./ICU4XDataProvider";
3 import { ICU4XDateLength } from "./ICU4XDateLength";
4 import { ICU4XDateTime } from "./ICU4XDateTime";
5 import { ICU4XError } from "./ICU4XError";
6 import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime";
7 import { ICU4XLocale } from "./ICU4XLocale";
8 import { ICU4XTimeLength } from "./ICU4XTimeLength";
9
10 /**
11
12 * An ICU4X DateFormatter object capable of formatting a {@link ICU4XDateTime `ICU4XDateTime`} as a string, using some calendar specified at runtime in the locale.
13
14 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html Rust documentation for `DateTimeFormatter`} for more information.
15 */
16 export class ICU4XDateTimeFormatter {
17
18 /**
19
20 * Creates a new {@link ICU4XDateTimeFormatter `ICU4XDateTimeFormatter`} from locale data.
21
22 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.try_new Rust documentation for `try_new`} for more information.
23 * @throws {@link FFIError}<{@link ICU4XError}>
24 */
25 static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XDateTimeFormatter | never;
26
27 /**
28
29 * Formats a {@link ICU4XDateTime `ICU4XDateTime`} to a string.
30
31 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format Rust documentation for `format`} for more information.
32 * @throws {@link FFIError}<{@link ICU4XError}>
33 */
34 format_datetime(value: ICU4XDateTime): string | never;
35
36 /**
37
38 * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string.
39
40 * Will convert to this formatter's calendar first
41
42 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format Rust documentation for `format`} for more information.
43 * @throws {@link FFIError}<{@link ICU4XError}>
44 */
45 format_iso_datetime(value: ICU4XIsoDateTime): string | never;
46 }