const doc = ByeText.create({
canvas,
text: 'Hello world',
width: 320,
height: 180,
font: { family: 'system-ui', size: 16 }
})setText(text)setWidth(width)setHeight(height)layout()render()
getLineCount()getTotalHeight()getLine(index)charToPosition(index)positionToChar(x, y)getRunAt(index)
insert(charIndex, text)delete(charStart, charEnd)setStyle(style, range)layoutRange(charStart, charEnd)invalidateMeasurements()
Install plugins with doc.use(plugin) and retrieve exposed plugin facades with doc.getPlugin(name).