In @ types / vinyl , the 'File' interface is defined without a module or namespace:
declare let File: FileConstructor; interface File { ... } In the following gulp-task, written in TypeScript, I try to process the vynil file, but TypeScript produces as many as 4 error messages:
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. - Only common words that do not indicate which type is needed. And if you look at @types/vynil-fs - everything is annotated exactly like this:
export function dest(getFolderPath: (file: File) => string): NodeJS.ReadWriteStream; How should annotate callback in gulp.dest ?
