| 83 | public exportAPI(editor: Core): void { |
| 84 | const fieldsToExport = [ 'configuration' ]; |
| 85 | const destroy = (): void => { |
| 86 | Object.values(editor.moduleInstances) |
| 87 | .forEach((moduleInstance) => { |
| 88 | if (_.isFunction(moduleInstance.destroy)) { |
| 89 | moduleInstance.destroy(); |
| 90 | } |
| 91 | moduleInstance.listeners.removeAll(); |
| 92 | }); |
| 93 | |
| 94 | destroyTooltip(); |
| 95 | |
| 96 | editor = null; |
| 97 | |
| 98 | for (const field in this) { |
| 99 | if (Object.prototype.hasOwnProperty.call(this, field)) { |
| 100 | delete this[field]; |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | Object.setPrototypeOf(this, null); |
| 105 | }; |
| 106 | |
| 107 | fieldsToExport.forEach((field) => { |
| 108 | this[field] = editor[field]; |