本文整理匯總了TypeScript中monterey-pal.FS.downloadFile方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FS.downloadFile方法的具體用法?TypeScript FS.downloadFile怎麽用?TypeScript FS.downloadFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類monterey-pal.FS
的用法示例。
在下文中一共展示了FS.downloadFile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: tryInstallLauncherFromRemote
async tryInstallLauncherFromRemote(platform, launcherPath) {
try {
let result = await this.getLauncher(platform, launcherPath);
let root = FS.getRootDir();
let file = await FS.downloadFile(result.remoteImagePath, root + "/images/app-launcher/" + platform + "/" + launcherPath + ".png");
result.data.img = root + "/images/app-launcher/" + platform + "/" + launcherPath + ".png";
result.data.enabled = true;
this.state.appLaunchers.push(result);
}
catch(err) {
throw new Error(`Failed to install ${platform}/${launcherPath} launcher: ${err.message}`);
}
}