Fix return type of methods and arguments of create method

This commit is contained in:
Rémi Alvergnat
2018-11-17 13:56:59 +01:00
parent d202969f89
commit 2ac92c2d4c
2 changed files with 6 additions and 6 deletions

View File

@@ -10,13 +10,13 @@ import { Transform } from 'stream';
import * as File from 'vinyl';
export interface Store extends EventEmitter {
add: (file: File, content: string) => void;
each: (callback: (file: File, index: number) => void) => void;
get: (filepath: string) => File;
add: (file: File) => this;
each: (callback: (file: File, index: number) => void) => this;
stream: () => Transform;
}
export function create(...args: any[]): Store;
export function create(): Store;
export namespace memFs {
}

View File

@@ -3,6 +3,6 @@ import * as fs from 'mem-fs';
const store: fs.Store = fs.create();
const file = store.get('hello');
store.add(file, 'hahahahah');
store.each(file => console.dir(store.get(file.path)));
const file2 = store.add(file)
.each(file => console.dir(store.get(file.path)))
.get('test');