mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-23 09:12:47 +00:00
commit
dff4f090fa
23
types/mv/index.d.ts
vendored
Normal file
23
types/mv/index.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Type definitions for mv 2.1
|
||||
// Project: https://github.com/andrewrk/node-mv
|
||||
// Definitions by: Miloslav Nenadál <https://github.com/nenadalm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Options {
|
||||
mkdirp?: boolean;
|
||||
clobber?: boolean;
|
||||
}
|
||||
|
||||
interface Mv {
|
||||
(
|
||||
src: string,
|
||||
dest: string,
|
||||
options: Options,
|
||||
callback: (error: any) => void
|
||||
): void;
|
||||
(src: string, dest: string, callback: (error: any) => void): void;
|
||||
}
|
||||
|
||||
declare const inst: Mv;
|
||||
|
||||
export = inst;
|
||||
21
types/mv/mv-tests.ts
Normal file
21
types/mv/mv-tests.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import * as mv from 'mv';
|
||||
|
||||
() => {
|
||||
mv('/tmp/f1.txt', '/tmp/f2.txt', error => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
mv('/tmp/f1.txt', '/tmp/f2.txt', {clobber: false}, error => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
mv('/tmp/f1.txt', '/tmp/f2.txt', {mkdirp: true}, error => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
};
|
||||
22
types/mv/tsconfig.json
Normal file
22
types/mv/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"mv-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/mv/tslint.json
Normal file
1
types/mv/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user