Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27018aa
commit c029c43
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export interface Options { | ||
/** | ||
* Enable globbing when matching file paths. | ||
* | ||
* @default true | ||
*/ | ||
readonly glob?: boolean; | ||
} | ||
|
||
/** | ||
* Move files and folders to the trash. | ||
* | ||
* @param input - Accepts paths and [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). | ||
*/ | ||
export default function trash( | ||
input: string | string[], | ||
options?: Options | ||
): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {expectType} from 'tsd-check'; | ||
import trash from '.'; | ||
|
||
expectType<Promise<void>>(trash('/path/to/item1')); | ||
expectType<Promise<void>>(trash(['/path/to/item1', '/path/to/item2'])); | ||
expectType<Promise<void>>( | ||
trash(['/path/to/item1', '/path/to/item2'], {glob: false}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters