当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript sand.Window类代码示例

本文整理汇总了TypeScript中@ephox/sand.Window的典型用法代码示例。如果您正苦于以下问题:TypeScript Window类的具体用法?TypeScript Window怎么用?TypeScript Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Window类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

  const uriToBlob = function (base64, type) {
    let i;
    const str = Window.atob(base64);
    const arr = Uint8Array(str.length);

    for (i = 0; i < arr.length; i++) {
      arr[i] = str.charCodeAt(i);
    }
    return Blob([arr], { type });
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:10,代码来源:BlobCacheTest.ts

示例2: function

  const base64ToBlob = function (base64, type) {
    const buff = Window.atob(base64);
    const bytes = Uint8Array(buff.length);

    for (let i = 0; i < bytes.length; i++) {
      bytes[i] = buff.charCodeAt(i);
    }

    return new Blob([bytes], { type });
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:10,代码来源:ActionsTest.ts

示例3: Promise

  return new Promise(function (resolve) {
    let str, arr, i;

    uri = parseDataUri(uri);

    // Might throw error if data isn't proper base64
    try {
      str = Window.atob(uri.data);
    } catch (e) {
      resolve(new Blob([]));
      return;
    }

    arr = new Uint8Array(str.length);

    for (i = 0; i < arr.length; i++) {
      arr[i] = str.charCodeAt(i);
    }

    resolve(new Blob([arr], { type: uri.type }));
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:21,代码来源:Conversions.ts


注:本文中的@ephox/sand.Window类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。