Debian Codegraph @

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

raw
1 import { FFIError } from "./diplomat-runtime"
2 import { ICU4XError } from "./ICU4XError";
3 import { ICU4XMeasureUnit } from "./ICU4XMeasureUnit";
4
5 /**
6
7 * An ICU4X Measurement Unit parser object which is capable of parsing the CLDR unit identifier (e.g. `meter-per-square-second`) and get the {@link ICU4XMeasureUnit `ICU4XMeasureUnit`}.
8
9 * See the {@link https://docs.rs/icu/latest/icu/experimental/units/measureunit/struct.MeasureUnitParser.html Rust documentation for `MeasureUnitParser`} for more information.
10 */
11 export class ICU4XMeasureUnitParser {
12
13 /**
14
15 * Parses the CLDR unit identifier (e.g. `meter-per-square-second`) and returns the corresponding {@link ICU4XMeasureUnit `ICU4XMeasureUnit`}. Returns an error if the unit identifier is not valid.
16
17 * See the {@link https://docs.rs/icu/latest/icu/experimental/units/measureunit/struct.MeasureUnitParser.html#method.parse Rust documentation for `parse`} for more information.
18 * @throws {@link FFIError}<{@link ICU4XError}>
19 */
20 parse(unit_id: string): ICU4XMeasureUnit | never;
21 }