|
|
@ -8,12 +8,31 @@ |
|
|
* }) |
|
|
* }) |
|
|
* ``` |
|
|
* ``` |
|
|
* |
|
|
* |
|
|
* Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance |
|
|
* Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. |
|
|
* |
|
|
* |
|
|
* ```js
|
|
|
* ```js
|
|
|
|
|
|
* // Listen to events
|
|
|
|
|
|
* editor.on('storage:start', () => { ... }); |
|
|
|
|
|
* |
|
|
|
|
|
* // Use the API
|
|
|
* const storageManager = editor.StorageManager; |
|
|
* const storageManager = editor.StorageManager; |
|
|
|
|
|
* storageManager.add(...); |
|
|
* ``` |
|
|
* ``` |
|
|
* |
|
|
* |
|
|
|
|
|
* ## Available Events |
|
|
|
|
|
* * `storage:start` - Before the storage request is started |
|
|
|
|
|
* * `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit) |
|
|
|
|
|
* * `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit) |
|
|
|
|
|
* * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet |
|
|
|
|
|
* * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet |
|
|
|
|
|
* * `storage:end` - After the storage request is ended |
|
|
|
|
|
* * `storage:end:store` - After the store request |
|
|
|
|
|
* * `storage:end:load` - After the load request |
|
|
|
|
|
* * `storage:error` - On any error on storage request, passes the error as an argument |
|
|
|
|
|
* * `storage:error:store` - Error on store request, passes the error as an argument |
|
|
|
|
|
* * `storage:error:load` - Error on load request, passes the error as an argument |
|
|
|
|
|
* |
|
|
|
|
|
* ## Methods |
|
|
* * [getConfig](#getconfig) |
|
|
* * [getConfig](#getconfig) |
|
|
* * [isAutosave](#isautosave) |
|
|
* * [isAutosave](#isautosave) |
|
|
* * [setAutosave](#setautosave) |
|
|
* * [setAutosave](#setautosave) |
|
|
@ -362,6 +381,6 @@ export default () => { |
|
|
|
|
|
|
|
|
destroy() { |
|
|
destroy() { |
|
|
[c, em, storages, defaultStorages].forEach(i => (i = {})); |
|
|
[c, em, storages, defaultStorages].forEach(i => (i = {})); |
|
|
} |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|