mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add typings for the mkpath library
This commit is contained in:
9
mkpath/mkpath-tests.ts
Normal file
9
mkpath/mkpath-tests.ts
Normal 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
15
mkpath/mkpath.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user