本文整理汇总了TypeScript中tinymce/core/api/util/Promise.resolve函数的典型用法代码示例。如果您正苦于以下问题:TypeScript resolve函数的具体用法?TypeScript resolve怎么用?TypeScript resolve使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resolve函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
const findSelectedBlob = function (editor) {
let blobInfo;
blobInfo = editor.editorUpload.blobCache.getByUri(getSelectedImage(editor).src);
if (blobInfo) {
return Promise.resolve(blobInfo.blob());
}
return imageToBlob(editor, getSelectedImage(editor));
};
示例2: function
const findBlob = function (editor: Editor, img) {
let blobInfo;
blobInfo = editor.editorUpload.blobCache.getByUri(img.src);
if (blobInfo) {
return Promise.resolve(blobInfo.blob());
}
return imageToBlob(editor, img);
};
示例3: Promise
const waitForLoad = (): Promise<boolean> => {
if (hasLoaded()) {
return Promise.resolve(true);
} else {
return new Promise((resolve, reject) => {
let numRetries = 3;
const interval = Delay.setInterval(() => {
if (hasLoaded()) {
Delay.clearInterval(interval);
resolve(true);
} else {
numRetries--;
if (numRetries < 0) {
console.log('Could not load emojis from url: ' + databaseUrl);
Delay.clearInterval(interval);
reject(false);
}
}
}, 500);
});
}
};
示例4: function
const convertLinkToAbsolute = function (editor, href) {
return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href);
};
示例5:
.then(function (result) {
return result.status < 200 || result.status >= 300 ? Errors.handleHttpError(result.status) : Promise.resolve(result.blob);
});
示例6:
}).then(function (result) {
return result.status < 200 || result.status >= 300 ? Errors.handleServiceErrorResponse(result.status, result.blob) : Promise.resolve(result.blob);
});