mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 19:43:20 +08:00
[make-dir] add more specific type to fs config option (#18286)
This commit is contained in:
committed by
Wesley Wigham
parent
168bb317b1
commit
b33275b2f4
6
types/make-dir/index.d.ts
vendored
6
types/make-dir/index.d.ts
vendored
@@ -1,8 +1,12 @@
|
||||
// Type definitions for make-dir 1.0
|
||||
// Project: https://github.com/sindresorhus/make-dir
|
||||
// Definitions by: Ika <https://github.com/ikatyang>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
import * as fs from 'fs';
|
||||
|
||||
export = makeDir;
|
||||
|
||||
/**
|
||||
@@ -33,6 +37,6 @@ declare namespace makeDir {
|
||||
*
|
||||
* Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
*/
|
||||
fs?: any;
|
||||
fs?: typeof fs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import makeDir = require('make-dir');
|
||||
import * as fs from 'fs';
|
||||
import * as gfs from 'graceful-fs';
|
||||
|
||||
makeDir('path/to/somewhere').then(dirname => {
|
||||
// do something
|
||||
});
|
||||
|
||||
const dirname = makeDir.sync('path/to/somewhere');
|
||||
|
||||
makeDir('path/to/somewhere', {mode: parseInt('777', 8)});
|
||||
makeDir('path/to/somewhere', {fs});
|
||||
makeDir('path/to/somewhere', {fs: gfs});
|
||||
|
||||
Reference in New Issue
Block a user