Add typings for the mkpath library

This commit is contained in:
Jared
2015-02-16 17:21:36 +13:00
parent bcf610fef5
commit 7e87f449a8
2 changed files with 24 additions and 0 deletions

9
mkpath/mkpath-tests.ts Normal file
View File

@@ -0,0 +1,9 @@
/// <reference path="mkpath.d.ts" />
import mkpath = require('mkpath');
mkpath('red/green/violet', function (err) {
if (err) throw err;
console.log('Directory structure red/green/violet created');
});
mkpath.sync('/tmp/blue/orange', 700);

15
mkpath/mkpath.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for mkpath v0.1.0
// Project: https://www.npmjs.com/package/mkpath
// Definitions by: Jared Klopper <https://github.com/optical>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'mkpath' {
module mkpath {
function sync(path: string, mode?: number): void;
}
function mkpath(path: string, callback?: (err: any) => void): void;
function mkpath(path: string, mode?: number, callback?: (err?: any) => void): void;
export = mkpath;
}