(editor: Editor)
| 183 | * NOTE: can't use yet because of recursion issues |
| 184 | */ |
| 185 | export const syncLegacyMethods = (editor: Editor) => { |
| 186 | const e = editor as Editor & LegacyEditorMethods & UnknownObject; |
| 187 | |
| 188 | // Assign to editor.api |
| 189 | LEGACY_API.forEach((key) => { |
| 190 | if (e[key]) { |
| 191 | if (key === 'getMarks') { |
| 192 | // Special case for marks |
| 193 | (e.api as any).marks = e.getMarks; |
| 194 | } else { |
| 195 | (e.api as any)[key] = e[key]; |
| 196 | } |
| 197 | } |
| 198 | }); |
| 199 | |
| 200 | // Assign to editor.tf |
| 201 | LEGACY_TRANSFORMS.forEach((key) => { |
| 202 | if (e[key]) { |
| 203 | (e.tf as any)[key] = e[key]; |
| 204 | } |
| 205 | }); |
| 206 | }; |
no outgoing calls
searching dependent graphs…