| 1 | import { FFIError } from "./diplomat-runtime" |
| 2 | import { ICU4XDataProvider } from "./ICU4XDataProvider"; |
| 3 | import { ICU4XError } from "./ICU4XError"; |
| 4 | import { ICU4XLineBreakIteratorLatin1 } from "./ICU4XLineBreakIteratorLatin1"; |
| 5 | import { ICU4XLineBreakIteratorUtf16 } from "./ICU4XLineBreakIteratorUtf16"; |
| 6 | import { ICU4XLineBreakIteratorUtf8 } from "./ICU4XLineBreakIteratorUtf8"; |
| 7 | import { ICU4XLineBreakOptionsV1 } from "./ICU4XLineBreakOptionsV1"; |
| 8 | |
| 9 | /** |
| 10 | |
| 11 | * An ICU4X line-break segmenter, capable of finding breakpoints in strings. |
| 12 | |
| 13 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html Rust documentation for `LineSegmenter`} for more information. |
| 14 | */ |
| 15 | export class ICU4XLineSegmenter { |
| 16 | |
| 17 | /** |
| 18 | |
| 19 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options. It automatically loads the best available payload data for Burmese, Khmer, Lao, and Thai. |
| 20 | |
| 21 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto Rust documentation for `new_auto`} for more information. |
| 22 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 23 | */ |
| 24 | static create_auto(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; |
| 25 | |
| 26 | /** |
| 27 | |
| 28 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options and LSTM payload data for Burmese, Khmer, Lao, and Thai. |
| 29 | |
| 30 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm Rust documentation for `new_lstm`} for more information. |
| 31 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 32 | */ |
| 33 | static create_lstm(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; |
| 34 | |
| 35 | /** |
| 36 | |
| 37 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options and dictionary payload data for Burmese, Khmer, Lao, and Thai.. |
| 38 | |
| 39 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary Rust documentation for `new_dictionary`} for more information. |
| 40 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 41 | */ |
| 42 | static create_dictionary(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; |
| 43 | |
| 44 | /** |
| 45 | |
| 46 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options. It automatically loads the best available payload data for Burmese, Khmer, Lao, and Thai. |
| 47 | |
| 48 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto_with_options Rust documentation for `new_auto_with_options`} for more information. |
| 49 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 50 | */ |
| 51 | static create_auto_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; |
| 52 | |
| 53 | /** |
| 54 | |
| 55 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options and LSTM payload data for Burmese, Khmer, Lao, and Thai. |
| 56 | |
| 57 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm_with_options Rust documentation for `new_lstm_with_options`} for more information. |
| 58 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 59 | */ |
| 60 | static create_lstm_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; |
| 61 | |
| 62 | /** |
| 63 | |
| 64 | * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options and dictionary payload data for Burmese, Khmer, Lao, and Thai. |
| 65 | |
| 66 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary_with_options Rust documentation for `new_dictionary_with_options`} for more information. |
| 67 | * @throws {@link FFIError}<{@link ICU4XError}> |
| 68 | */ |
| 69 | static create_dictionary_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; |
| 70 | |
| 71 | /** |
| 72 | |
| 73 | * Segments a string. |
| 74 | |
| 75 | * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according to the WHATWG Encoding Standard. |
| 76 | |
| 77 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf8 Rust documentation for `segment_utf8`} for more information. |
| 78 | */ |
| 79 | segment_utf8(input: string): ICU4XLineBreakIteratorUtf8; |
| 80 | |
| 81 | /** |
| 82 | |
| 83 | * Segments a string. |
| 84 | |
| 85 | * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according to the WHATWG Encoding Standard. |
| 86 | |
| 87 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf16 Rust documentation for `segment_utf16`} for more information. |
| 88 | */ |
| 89 | segment_utf16(input: string): ICU4XLineBreakIteratorUtf16; |
| 90 | |
| 91 | /** |
| 92 | |
| 93 | * Segments a Latin-1 string. |
| 94 | |
| 95 | * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_latin1 Rust documentation for `segment_latin1`} for more information. |
| 96 | */ |
| 97 | segment_latin1(input: Uint8Array): ICU4XLineBreakIteratorLatin1; |
| 98 | } |