Web SDKv1.0.0

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

ParameterTypeDescription
blockIdstringA block id from listBlocks() of the current detection pass.

Returns

Promise<void>

Throws

  • INVALID_STATE while the tool is not active — without edit-text it cannot be activated.
  • FEATURE_NOT_LICENSED without extract.
  • INVALID_ARGUMENT for a text block id that names no block.
  • PAGE_ERROR when the block's page could not be loaded.

Example

TypeScript
const [first] = blocks;
if (first) await viewer.tools.editText.beginEdit(first.id);

More in EditTextToolApi