對于這樣的配置文件,我有一個非常基本的文件夾結構:/config /button /colors /index代碼如下:colors.tsexport interface Colors { [key: string]: string,}export default { black: '#111', grey: '#999', green: '#4c8857', red: '#bd1414', white: '#fff',};索引import colors from './colors';export default { button, colors,};我收到以下錯誤:Could not find a declaration file for module './colors'. '/xxxxx/styles/config/colors.js' implicitly has an 'any' type.我是Typescript的新手,在網上找不到任何可以清楚說明我做錯了什么的教程或示例。
用于默認導出的Typescript界面
狐的傳說
2021-05-05 13:11:39