【发布时间】:2017-11-26 20:36:52
【问题描述】:
这是通配符模块定义:
declare module 'text!*' {
const content: string;
export default content;
}
还有导入:
import * as html from 'text!./myHtml.html';
还有编译器错误:
错误 TS2345:'typeof'text!*'' 类型的参数不可分配给 'string | 类型的参数((这个:HTMLElement,索引:数字, oldhtml: string) => string)'。
我真的希望 html 的类型为 string。
【问题讨论】:
标签: typescript