- 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

@@ -127,7 +127,7 @@ export const init = (editor) => {
* @function module:locale.readLang
* @param {module:locale.LocaleStrings} langData See {@tutorial LocaleDocs}
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @returns {Promise} Resolves to [`LangAndData`]{@link module:locale.LangAndData}
* @returns {Promise<module:locale.LangAndData>} Resolves to [`LangAndData`]{@link module:locale.LangAndData}
*/
export const readLang = async function (langData) {
const more = await editor_.addLangData(langParam);
@@ -366,7 +366,7 @@ export const readLang = async function (langData) {
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext-langReady
* @fires module:svgcanvas.SvgCanvas#event:ext-langChanged
* @returns {Promise} Resolves to result of {@link module:locale.readLang}
* @returns {Promise<module:locale.LangAndData>} Resolves to result of {@link module:locale.readLang}
*/
export const putLocale = async function (givenParam, goodLangs, conf) {
if (givenParam) {