tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

LineSegmenter.d.ts (5194B)


      1 // generated by diplomat-tool
      2 import type { DataError } from "./DataError"
      3 import type { DataProvider } from "./DataProvider"
      4 import type { LineBreakIteratorUtf16 } from "./LineBreakIteratorUtf16"
      5 import type { LineBreakOptions } from "./LineBreakOptions"
      6 import type { LineBreakOptions_obj } from "./LineBreakOptions"
      7 import type { Locale } from "./Locale"
      8 import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
      9 
     10 
     11 /**
     12 * An ICU4X line-break segmenter, capable of finding breakpoints in strings.
     13 *
     14 * See the [Rust documentation for `LineSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html) for more information.
     15 */
     16 
     17 
     18 export class LineSegmenter {
     19    get ffiValue(): pointer;
     20 
     21 
     22    /**
     23     * Construct a [`LineSegmenter`] with default options (no locale-based tailoring) using compiled data. It automatically loads the best
     24     * available payload data for Burmese, Khmer, Lao, and Thai.
     25     *
     26     * See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
     27     */
     28    static createAuto(): LineSegmenter;
     29 
     30    /**
     31     * Construct a [`LineSegmenter`] with default options (no locale-based tailoring) and LSTM payload data for
     32     * Burmese, Khmer, Lao, and Thai, using compiled data.
     33     *
     34     * See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
     35     */
     36    static createLstm(): LineSegmenter;
     37 
     38    /**
     39     * Construct a [`LineSegmenter`] with default options (no locale-based tailoring) and dictionary payload data for
     40     * Burmese, Khmer, Lao, and Thai, using compiled data
     41     *
     42     * See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
     43     */
     44    static createDictionary(): LineSegmenter;
     45 
     46    /**
     47     * Construct a [`LineSegmenter`] with custom options using compiled data. It automatically loads the best
     48     * available payload data for Burmese, Khmer, Lao, and Thai.
     49     *
     50     * See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
     51     */
     52    static autoWithOptions(contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     53 
     54    /**
     55     * Construct a [`LineSegmenter`] with custom options. It automatically loads the best
     56     * available payload data for Burmese, Khmer, Lao, and Thai, using a particular data source.
     57     *
     58     * See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
     59     */
     60    static autoWithOptionsAndProvider(provider: DataProvider, contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     61 
     62    /**
     63     * Construct a [`LineSegmenter`] with custom options and LSTM payload data for
     64     * Burmese, Khmer, Lao, and Thai, using compiled data.
     65     *
     66     * See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
     67     */
     68    static lstmWithOptions(contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     69 
     70    /**
     71     * Construct a [`LineSegmenter`] with custom options and LSTM payload data for
     72     * Burmese, Khmer, Lao, and Thai, using a particular data source.
     73     *
     74     * See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
     75     */
     76    static lstmWithOptionsAndProvider(provider: DataProvider, contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     77 
     78    /**
     79     * Construct a [`LineSegmenter`] with custom options and dictionary payload data for
     80     * Burmese, Khmer, Lao, and Thai, using compiled data.
     81     *
     82     * See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
     83     */
     84    static dictionaryWithOptions(contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     85 
     86    /**
     87     * Construct a [`LineSegmenter`] with custom options and dictionary payload data for
     88     * Burmese, Khmer, Lao, and Thai, using a particular data source.
     89     *
     90     * See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
     91     */
     92    static dictionaryWithOptionsAndProvider(provider: DataProvider, contentLocale: Locale | null, options: LineBreakOptions_obj): LineSegmenter;
     93 
     94    /**
     95     * Segments a string.
     96     *
     97     * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
     98     * to the WHATWG Encoding Standard.
     99     *
    100     * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenterBorrowed.html#method.segment_utf16) for more information.
    101     */
    102    segment(input: string): LineBreakIteratorUtf16;
    103 }