mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
Merge pull request #8090 from asgoth/feature/vinyl-fs-changes
Improves typings for vinyl/vinyl-fs
This commit is contained in:
@@ -909,4 +909,15 @@ describe('symlink stream', function () {
|
||||
stream.end();
|
||||
});
|
||||
});
|
||||
it('should check if it"s a vinyl file', function () {
|
||||
var srcPath = path.join(__dirname, './fixtures/test.coffee');
|
||||
var options = {
|
||||
path: srcPath,
|
||||
cwd: __dirname,
|
||||
contents: new Buffer("1234567890")
|
||||
};
|
||||
var file = new File(options);
|
||||
File.isVinyl(file).should.equal(true);
|
||||
File.isVinyl(options).should.equal(false);
|
||||
})
|
||||
});
|
||||
|
||||
Vendored
+3
-1
@@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../glob-stream/glob-stream.d.ts" />
|
||||
/// <reference path="../vinyl/vinyl.d.ts" />
|
||||
|
||||
declare module NodeJS {
|
||||
@@ -15,8 +16,9 @@ declare module NodeJS {
|
||||
declare module "vinyl-fs" {
|
||||
import _events = require("events");
|
||||
import File = require("vinyl");
|
||||
import globStream = require("glob-stream");
|
||||
|
||||
interface ISrcOptions {
|
||||
interface ISrcOptions extends globStream.Options {
|
||||
/** Specifies the working directory the folder is relative to */
|
||||
cwd?: string;
|
||||
|
||||
|
||||
Vendored
+5
@@ -135,6 +135,11 @@ declare module "vinyl" {
|
||||
* Returns a pretty String interpretation of the File. Useful for console.log.
|
||||
*/
|
||||
public inspect(): string;
|
||||
|
||||
/**
|
||||
* Checks if a given object is a vinyl file.
|
||||
*/
|
||||
public static isVinyl(obj: any): boolean;
|
||||
}
|
||||
|
||||
export = File;
|
||||
|
||||
Reference in New Issue
Block a user