* Add various functions for keyring synchronization * @param {SyncHandlerObject} syncHandlerObj * @returns {Promise. }
(syncHandlerObj)
| 488 | * @returns {Promise.<undefined, Error>} |
| 489 | */ |
| 490 | addSyncHandler(syncHandlerObj) { |
| 491 | if (typeof syncHandlerObj.uploadSync !== typeof syncHandlerObj.downloadSync) { |
| 492 | return Promise.reject(new Error('uploadSync and downloadSync Handler cannot be set exclusively.')); |
| 493 | } |
| 494 | return send('add-sync-handler', {identifier: this.identifier}).then(syncHandlerId => { |
| 495 | if (syncHandler) { |
| 496 | syncHandler.update(syncHandlerObj); |
| 497 | } else { |
| 498 | syncHandler = new SyncHandler(syncHandlerId, syncHandlerObj); |
| 499 | } |
| 500 | }); |
| 501 | } |
| 502 | |
| 503 | /** |
| 504 | * @typedef {Object} OpenSettingsOptions |