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