随笔分类 - ts
摘要:https://stackoverflow.com/questions/64732623/react-typescript-cannot-find-module-or-its-corresponding-type-declaration css.d.ts declare module '*.scss
阅读全文
Error: Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
摘要:https://www.cnblogs.com/xulei1992/p/15176992.html https://segmentfault.com/a/1190000038956767 tsdx.config.js const postcss = require('rollup-plugin-po
阅读全文
摘要:// tsdx.config.js const images = require('@rollup/plugin-image'); module.exports = { rollup(config, options) { config.plugins = [ images({ include: ['
阅读全文
摘要:此语法需要名为 "__spreadArray" 的导入帮助器 安装最新版tslib即可
阅读全文
摘要:declare module "*.png"
阅读全文
摘要:如前文所示,在对应的index.d.ts/index.d.tsx中添加如下代码: interface Function { _toFixed(params: any): void; } Function.prototype._toFixed = function(params: any) { thi
阅读全文
摘要:类型“typeof BigNumber”的参数不能赋给类型“Value”的参数。 类型“typeof BigNumber”缺少类型“Instance”中的以下属性: c, e, s 原来: bigNumber._toFixed = function (...arg: any) { return ne
阅读全文
摘要:Your rootDir is currently set to "./". Please change your rootDir to "./src".TSDX has deprecated setting tsconfig.compilerOptions.rootDir to "./" as i
阅读全文
摘要:创建对应文件:如index.d.ts或者index.d.tsx。然后声明一下即可。 如果您不关心外部库的类型,并且希望将所有没有类型的库导入为any,则可以将其添加到具有.d.ts扩展名的文件中: declare module '*'; 这样做的好处(和缺点)是,您可以导入任何东西,TS可以编译。
阅读全文