本文整理汇总了TypeScript中tinymce/core/file/UploadStatus.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('hasBlobUri/markPending', function () {
const status = UploadStatus();
LegacyUnit.strictEqual(status.hasBlobUri('nonexisting_uri'), false);
status.markPending('existing_uri');
LegacyUnit.strictEqual(status.isPending('existing_uri'), true);
LegacyUnit.strictEqual(status.isUploaded('existing_uri'), false);
LegacyUnit.strictEqual(status.hasBlobUri('existing_uri'), true);
status.markUploaded('existing_uri', 'uri');
LegacyUnit.strictEqual(status.isPending('existing_uri'), false);
LegacyUnit.strictEqual(status.isUploaded('existing_uri'), true);
LegacyUnit.strictEqual(status.hasBlobUri('existing_uri'), true);
LegacyUnit.strictEqual(status.getResultUri('existing_uri'), 'uri');
status.markUploaded('existing_uri2', 'uri2');
LegacyUnit.strictEqual(status.isPending('existing_uri'), false);
LegacyUnit.strictEqual(status.isUploaded('existing_uri'), true);
LegacyUnit.strictEqual(status.hasBlobUri('existing_uri2'), true);
LegacyUnit.strictEqual(status.getResultUri('existing_uri2'), 'uri2');
status.markPending('existing_uri');
LegacyUnit.strictEqual(status.hasBlobUri('existing_uri'), true);
status.removeFailed('existing_uri');
LegacyUnit.strictEqual(status.hasBlobUri('existing_uri'), false);
});
示例2: function
suite.asyncTest('findAll (filtered)', function (_, done) {
const imageScanner = ImageScanner(UploadStatus(), BlobCache());
const predicate = function (img) {
return !img.hasAttribute('data-skip');
};
viewBlock.update(
'<img src="' + base64Src + '">' +
'<img src="' + base64Src + '" data-skip="1">'
);
imageScanner.findAll(viewBlock.get(), predicate).then(function (result) {
done();
LegacyUnit.equal(result.length, 1);
LegacyUnit.equal('data:image/gif;base64,' + result[0].blobInfo.base64(), base64Src);
LegacyUnit.equalDom(result[0].image, viewBlock.get().firstChild);
});
});