在@types/vinyl中,已定义接口“文件”,而没有模块或名称ase:
declare let File: FileConstructor;
interface File { ... }
在下面用TypeScript编写的gulp任务中,我试图获取vynil文件实例,但得到了很多消息:
return gulp.src(globSelection)
.pipe(gulpPlugins.pug())
.pipe(gulp.dest( (file: File) => {
console.log(file);
return '';
}));
Error:(25, 26) TS2345: Argument of type '(file: File) => string' is not assignable to parameter of type '(file: File) => string'.
Types of parameters 'file' and 'file' are incompatible.
Type 'File' is not assignable to type 'File'. Two different types with this name exist, but they are unrelated.
Property 'lastModified' is missing in type 'File'.
真的Two different types with this name exist, but they are unrelated.
毫无意义。我需要改用哪种文件类型?