fix: add missing JSDoc, return types, and as-any comments to layout engines
This commit is contained in:
@@ -24,7 +24,11 @@ export interface LayoutLine {
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggregated output of a single-font layout pass.
|
||||
*/
|
||||
export interface LayoutResult {
|
||||
/** Per-line grapheme data. Empty when input text is empty. */
|
||||
lines: LayoutLine[];
|
||||
/** Total height in pixels. Equals `lines.length * lineHeight` (pretext guarantee). */
|
||||
totalHeight: number;
|
||||
@@ -61,6 +65,7 @@ export class TextLayoutEngine {
|
||||
*/
|
||||
#segmenter: Intl.Segmenter;
|
||||
|
||||
/** @param locale BCP 47 language tag passed to Intl.Segmenter. Defaults to the runtime locale. */
|
||||
constructor(locale?: string) {
|
||||
this.#segmenter = new Intl.Segmenter(locale, { granularity: 'grapheme' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user