Debian Codegraph @

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

raw
1 import { FFIError } from "./diplomat-runtime"
2 import { ICU4XDataProvider } from "./ICU4XDataProvider";
3 import { ICU4XDateTime } from "./ICU4XDateTime";
4 import { ICU4XError } from "./ICU4XError";
5 import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime";
6 import { ICU4XLocale } from "./ICU4XLocale";
7 import { ICU4XTime } from "./ICU4XTime";
8 import { ICU4XTimeLength } from "./ICU4XTimeLength";
9
10 /**
11
12 * An ICU4X TimeFormatter object capable of formatting an {@link ICU4XTime `ICU4XTime`} type (and others) as a string
13
14 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html Rust documentation for `TimeFormatter`} for more information.
15 */
16 export class ICU4XTimeFormatter {
17
18 /**
19
20 * Creates a new {@link ICU4XTimeFormatter `ICU4XTimeFormatter`} from locale data.
21
22 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.try_new_with_length Rust documentation for `try_new_with_length`} for more information.
23 * @throws {@link FFIError}<{@link ICU4XError}>
24 */
25 static create_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XTimeLength): ICU4XTimeFormatter | never;
26
27 /**
28
29 * Formats a {@link ICU4XTime `ICU4XTime`} to a string.
30
31 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information.
32 * @throws {@link FFIError}<{@link ICU4XError}>
33 */
34 format_time(value: ICU4XTime): string | never;
35
36 /**
37
38 * Formats a {@link ICU4XDateTime `ICU4XDateTime`} to a string.
39
40 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information.
41 * @throws {@link FFIError}<{@link ICU4XError}>
42 */
43 format_datetime(value: ICU4XDateTime): string | never;
44
45 /**
46
47 * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string.
48
49 * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information.
50 * @throws {@link FFIError}<{@link ICU4XError}>
51 */
52 format_iso_datetime(value: ICU4XIsoDateTime): string | never;
53 }