- Enhancement: Return a Promise for Editor's setCustomHandlers,

`loadFromString`, `loadFromDataURI` so known when ready and set
- Docs (Refactoring): Formally specify `Promise` resolve type;
    add `typedef` for dialog result object; add an
    `ArbitraryCallbackResult` type
This commit is contained in:
Brett Zamir
2019-04-05 22:59:41 +08:00
parent 5abd183c43
commit 91c0dc549b
11 changed files with 83 additions and 52 deletions

View File

@@ -388,7 +388,7 @@ export default {
/**
* @param {"start"|"mid"|"end"} pos
* @returns {Promise} Resolves to `undefined`
* @returns {Promise<void>} Resolves to `undefined`
*/
async function showTextPrompt (pos) {
let def = $('#' + pos + '_marker').val();
@@ -426,7 +426,7 @@ export default {
// callback function for a toolbar button click
/**
* @param {Event} ev
* @returns {Promise} Resolves to `undefined`
* @returns {Promise<void>} Resolves to `undefined`
*/
async function setArrowFromButton (ev) {
const parts = this.id.split('_');

View File

@@ -240,7 +240,7 @@ export default {
}
/**
* @param {Event} ev
* @returns {Promise} Resolves to `undefined`
* @returns {Promise<void>} Resolves to `undefined`
*/
function setArrowFromButton (ev) {
const parts = this.id.split('_');