From 2ac92c2d4c4947cb303d5e9aaa3160a0d6fd7352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Alvergnat?= Date: Sat, 17 Nov 2018 13:56:59 +0100 Subject: [PATCH] Fix return type of methods and arguments of create method --- types/mem-fs/index.d.ts | 6 +++--- types/mem-fs/mem-fs-tests.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index 4b1d8c4d14..6ab2c43c88 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -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 { } diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts index 9605c65ef7..3b20f30891 100644 --- a/types/mem-fs/mem-fs-tests.ts +++ b/types/mem-fs/mem-fs-tests.ts @@ -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');