tor-browser

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

Bidi.d.ts (3040B)


      1 // generated by diplomat-tool
      2 import type { BidiInfo } from "./BidiInfo"
      3 import type { DataError } from "./DataError"
      4 import type { DataProvider } from "./DataProvider"
      5 import type { ReorderedIndexMap } from "./ReorderedIndexMap"
      6 import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
      7 
      8 
      9 /**
     10 * An ICU4X Bidi object, containing loaded bidi data
     11 *
     12 * See the [Rust documentation for `BidiClass`](https://docs.rs/icu/latest/icu/properties/props/struct.BidiClass.html) for more information.
     13 */
     14 
     15 
     16 export class Bidi {
     17    get ffiValue(): pointer;
     18 
     19 
     20    /**
     21     * Creates a new [`Bidi`] from locale data, and a particular data source.
     22     */
     23    static createWithProvider(provider: DataProvider): Bidi;
     24 
     25    /**
     26     * Use the data loaded in this object to process a string and calculate bidi information
     27     *
     28     * Takes in a Level for the default level, if it is an invalid value it will default to LTR
     29     *
     30     * See the [Rust documentation for `new_with_data_source`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source) for more information.
     31     */
     32    forText(text: string, defaultLevel: number | null): BidiInfo;
     33 
     34    /**
     35     * Utility function for producing reorderings given a list of levels
     36     *
     37     * Produces a map saying which visual index maps to which source index.
     38     *
     39     * The levels array must not have values greater than 126 (this is the
     40     * Bidi maximum explicit depth plus one).
     41     * Failure to follow this invariant may lead to incorrect results,
     42     * but is still safe.
     43     *
     44     * See the [Rust documentation for `reorder_visual`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.reorder_visual) for more information.
     45     */
     46    reorderVisual(levels: Array<number>): ReorderedIndexMap;
     47 
     48    /**
     49     * Check if a Level returned by level_at is an RTL level.
     50     *
     51     * Invalid levels (numbers greater than 125) will be assumed LTR
     52     *
     53     * See the [Rust documentation for `is_rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_rtl) for more information.
     54     */
     55    static levelIsRtl(level: number): boolean;
     56 
     57    /**
     58     * Check if a Level returned by level_at is an LTR level.
     59     *
     60     * Invalid levels (numbers greater than 125) will be assumed LTR
     61     *
     62     * See the [Rust documentation for `is_ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_ltr) for more information.
     63     */
     64    static levelIsLtr(level: number): boolean;
     65 
     66    /**
     67     * Get a basic RTL Level value
     68     *
     69     * See the [Rust documentation for `rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl) for more information.
     70     */
     71    static levelRtl(): number;
     72 
     73    /**
     74     * Get a simple LTR Level value
     75     *
     76     * See the [Rust documentation for `ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr) for more information.
     77     */
     78    static levelLtr(): number;
     79 
     80    constructor();
     81 }