mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for mem-fs 1.1
|
||||
// Project: https://github.com/sboudrias/mem-fs
|
||||
// Definitions by: My Food Bag <https://github.com/MyFoodBag>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import { Transform } from 'stream';
|
||||
import * as File from 'vinyl';
|
||||
|
||||
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: () => Transform;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import * as fs from 'mem-fs';
|
||||
|
||||
const store = fs.create();
|
||||
const file = store.get('hello');
|
||||
|
||||
store.add(file, 'hahahahah');
|
||||
|
||||
store.each(file => console.dir(store.get(file.path)));
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"mem-fs-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user