Hier ist die Wildcard-Moduldefinition:Wildcard Modultyp für den Import von Text nicht überprüft
declare module 'text!*' {
const content: string;
export default content;
}
Und der Import:
import * as html from 'text!./myHtml.html';
Und der Compiler-Fehler:
error TS2345: Argument of type 'typeof 'text!*'' is not assignable to parameter of type 'string | ((this: HTMLElement, index: number, oldhtml: string) => string)'.
Ich bin erwarten Sie wirklich html
, um Typ string
zu haben.