You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/utils/copy_type.ts

47 lines
1.1 KiB

import * as path from 'path';
import { downLoadFile } from './utils';
//修正d.ts中类型定义出现错误的问题,临时修复,因为d.ts并不能完全快速的合并我们的类型修复PR.
// copyFolderRecursiveSync("./@types/", "./node_modules/");
function downloadTypes(downFiles)
{
let filePath = path.resolve("./node_modules/@types/" + downFiles.name) + "\\";
console.log('filePath: ', filePath);
for (let file of downFiles.files)
{
console.log(downFiles.urlPath + file);
try
{
downLoadFile(downFiles.urlPath + file, filePath + file);
}
catch (error)
{
console.log('error: ', error);
}
}
}
downloadTypes({
name: "three",
urlPath: "https://gitee.com/BearCAD/DefinitelyType2/raw/master/three/",
files: [
// "index.d.ts",
"three-core.d.ts",
// "three-outlinepass.d.ts",
// "three-smaapass.d.ts"
]
});
downloadTypes({
name: "jquery",
urlPath: "https://gitee.com/BearCAD/DefinitelyType2/raw/master/jquery/",
files: [
"index.d.ts"
]
});