MCPcopy
hub / github.com/codex-team/editor.js / methods

Method methods

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

* Available methods * * @returns {Blocks}

()

Source from the content-addressed store, hash-verified

18 * @returns {Blocks}
19 */
20 public get methods(): Blocks {
21 return {
22 clear: (): Promise<void> => this.clear(),
23 render: (data: OutputData): Promise<void> => this.render(data),
24 renderFromHTML: (data: string): Promise<void> => this.renderFromHTML(data),
25 delete: (index?: number): void => this.delete(index),
26 swap: (fromIndex: number, toIndex: number): void => this.swap(fromIndex, toIndex),
27 move: (toIndex: number, fromIndex?: number): void => this.move(toIndex, fromIndex),
28 getBlockByIndex: (index: number): BlockAPIInterface | undefined => this.getBlockByIndex(index),
29 getById: (id: string): BlockAPIInterface | null => this.getById(id),
30 getCurrentBlockIndex: (): number => this.getCurrentBlockIndex(),
31 getBlockIndex: (id: string): number => this.getBlockIndex(id),
32 getBlocksCount: (): number => this.getBlocksCount(),
33 getBlockByElement: (element: HTMLElement) => this.getBlockByElement(element),
34 stretchBlock: (index: number, status = true): void => this.stretchBlock(index, status),
35 insertNewBlock: (): void => this.insertNewBlock(),
36 insert: this.insert,
37 insertMany: this.insertMany,
38 update: this.update,
39 composeBlockData: this.composeBlockData,
40 convert: this.convert,
41 };
42 }
43
44 /**
45 * Returns Blocks count

Callers

nothing calls this directly

Calls 14

clearMethod · 0.95
renderMethod · 0.95
renderFromHTMLMethod · 0.95
deleteMethod · 0.95
swapMethod · 0.95
moveMethod · 0.95
getBlockByIndexMethod · 0.95
getByIdMethod · 0.95
getCurrentBlockIndexMethod · 0.95
getBlockIndexMethod · 0.95
getBlocksCountMethod · 0.95
getBlockByElementMethod · 0.95

Tested by

no test coverage detected