BidiParagraph.d.ts (2245B)
1 // generated by diplomat-tool 2 import type { BidiDirection } from "./BidiDirection" 3 import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; 4 5 6 /** 7 * Bidi information for a single processed paragraph 8 */ 9 10 11 export class BidiParagraph { 12 get ffiValue(): pointer; 13 14 15 /** 16 * Given a paragraph index `n` within the surrounding text, this sets this 17 * object to the paragraph at that index. Returns nothing when out of bounds. 18 * 19 * This is equivalent to calling `paragraph_at()` on `BidiInfo` but doesn't 20 * create a new object 21 */ 22 setParagraphInText(n: number): boolean; 23 24 /** 25 * The primary direction of this paragraph 26 * 27 * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. 28 */ 29 get direction(): BidiDirection; 30 31 /** 32 * The number of bytes in this paragraph 33 * 34 * See the [Rust documentation for `len`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len) for more information. 35 */ 36 get size(): number; 37 38 /** 39 * The start index of this paragraph within the source text 40 */ 41 get rangeStart(): number; 42 43 /** 44 * The end index of this paragraph within the source text 45 */ 46 get rangeEnd(): number; 47 48 /** 49 * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained 50 * within this paragraph's range. 51 * 52 * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. 53 */ 54 reorderLine(rangeStart: number, rangeEnd: number): string | null; 55 56 /** 57 * Get the BIDI level at a particular byte index in this paragraph. 58 * This integer is conceptually a `unicode_bidi::Level`, 59 * and can be further inspected using the static methods on Bidi. 60 * 61 * Returns 0 (equivalent to `Level::ltr()`) on error 62 * 63 * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. 64 */ 65 levelAt(pos: number): number; 66 }