This commit is contained in:
Walter Rumsby
2018-03-22 11:10:51 +13:00
parent 4c2186d54c
commit a08461c405
2 changed files with 11 additions and 7 deletions
+9 -7
View File
@@ -3,18 +3,20 @@
// Definitions by: My Food Bag <https://github.com/MyFoodBag>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import events = require('events');
import stream = require('stream');
import File = require('vinyl');
/// <reference types="node" />
export function create(...args: any[]): create.Store;
import { EventEmitter } from 'events';
import { Transform } from 'stream';
import * as File from 'vinyl';
export namespace create {
interface Store extends events.EventEmitter {
export function create(...args: any[]): memFs.Store;
export namespace memFs {
interface Store extends EventEmitter {
add: (file: File, content: string) => void;
each: (callback: (file: File, index: number) => void) => void;
get: (filepath: string) => File;
stream: () => stream.Transform;
stream: () => Transform;
}
const prototype: {
+2
View File
@@ -4,3 +4,5 @@ const store = fs.create();
const file = store.get('hello');
store.add(file, 'hahahahah');
store.each((file, index) => console.log(index, file.path));