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

Method swap

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

* Call Block Manager method that swap Blocks * * @param {number} fromIndex - position of first Block * @param {number} toIndex - position of second Block * @deprecated — use 'move' instead

(fromIndex: number, toIndex: number)

Source from the content-addressed store, hash-verified

135 * @deprecated — use 'move' instead
136 */
137 public swap(fromIndex: number, toIndex: number): void {
138 _.log(
139 '`blocks.swap()` method is deprecated and will be removed in the next major release. ' +
140 'Use `block.move()` method instead',
141 'info'
142 );
143
144 this.Editor.BlockManager.swap(fromIndex, toIndex);
145 }
146
147 /**
148 * Move block from one index to another

Callers 1

methodsMethod · 0.95

Calls 1

swapMethod · 0.65

Tested by

no test coverage detected