EditTextToolApi.beginEdit()
Opens a block for editing — what a double-click does. Needs
edit-text and extract: the editor shows the block's words in the page.methodEditingsince 1.0.0
Signature
beginEdit(blockId: string): Promise<void>
Parameters
| Parameter | Type | Description |
|---|---|---|
| blockId | string | A block id from listBlocks() of the current detection pass. |
Returns
Promise<void>
Throws
INVALID_STATEwhile the tool is not active — withoutedit-textit cannot be activated.FEATURE_NOT_LICENSEDwithoutextract.INVALID_ARGUMENTfor a text block id that names no block.PAGE_ERRORwhen the block's page could not be loaded.
Example
TypeScript
const [first] = blocks; if (first) await viewer.tools.editText.beginEdit(first.id);