MCPcopy Index your code
hub / github.com/codex-team/editor.js / getById

Method getById

src/components/modules/api/blocks.ts:101–111  ·  view source on GitHub ↗

* Returns BlockAPI object by Block id * * @param id - id of block to get

(id: string)

Source from the content-addressed store, hash-verified

99 * @param id - id of block to get
100 */
101 public getById(id: string): BlockAPIInterface | null {
102 const block = this.Editor.BlockManager.getBlockById(id);
103
104 if (block === undefined) {
105 _.logLabeled('There is no block with id `' + id + '`', 'warn');
106
107 return null;
108 }
109
110 return new BlockAPI(block);
111 }
112
113 /**
114 * Get Block API object by any child html element

Callers 1

methodsMethod · 0.95

Calls 1

getBlockByIdMethod · 0.80

Tested by

no test coverage detected