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://raw.githubusercontent.com/FishOrBear/three.js/patch-1/", files: [ "examples/jsm/shaders/CopyShader.d.ts", "examples/jsm/postprocessing/EffectComposer.d.ts", "examples/jsm/postprocessing/RenderPass.d.ts", "examples/jsm/shaders/FXAAShader.d.ts", "src/helpers/SpotLightHelper.d.ts", "src/helpers/RectAreaLightHelper.d.ts", "examples/jsm/postprocessing/Pass.d.ts" ] }); downloadTypes({ moduleName: "three", urlPath: "https://raw.githubusercontent.com/FishOrBear/three.js/patch-3/", files: [ "src/math/Vector2.d.ts", "src/math/Vector2.js", "src/math/Vector3.d.ts", "src/math/Vector3.js", ] }); downloadTypes({ moduleName: "three", urlPath: "https://raw.githubusercontent.com/FishOrBear/three.js/fbx_cad/", files: [ "examples/jsm/loaders/FBXLoader.js", ] }); downloadTypes({ moduleName: "jquery", urlPath: "https://gitee.com/BearCAD/DefinitelyType2/raw/master/jquery/", files: [ "index.d.ts" ] });