mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #31244 from BendingBender/move-file
Add types for move-file
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for move-file 1.0
|
||||
// Project: https://github.com/sindresorhus/move-file#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = moveFile;
|
||||
|
||||
declare function moveFile(
|
||||
source: string,
|
||||
destination: string,
|
||||
options?: moveFile.Options
|
||||
): Promise<void>;
|
||||
|
||||
declare namespace moveFile {
|
||||
function sync(source: string, destination: string, options?: Options): void;
|
||||
|
||||
interface Options {
|
||||
overwrite?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import moveFile = require('move-file');
|
||||
|
||||
// $ExpectType Promise<void>
|
||||
moveFile('source/unicorn.png', 'destination/unicorn.png');
|
||||
// $ExpectType Promise<void>
|
||||
moveFile('source/unicorn.png', 'destination/unicorn.png', { overwrite: false });
|
||||
// $ExpectType void
|
||||
moveFile.sync('source/unicorn.png', 'destination/unicorn.png');
|
||||
// $ExpectType void
|
||||
moveFile.sync('source/unicorn.png', 'destination/unicorn.png', { overwrite: false });
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"move-file-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user