Skip to content

Commit

Permalink
Add options for the filesystem.copy function
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed Apr 22, 2024
1 parent e01e8c7 commit 884b374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/api/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
DirectoryEntry,
DirectoryReaderOptions,
FileReaderOptions,
CopyOptions,
OpenedFile,
Stats,
Watcher
Expand Down Expand Up @@ -83,8 +84,8 @@ export function readDirectory(path: string, options?: DirectoryReaderOptions): P
return sendMessage('filesystem.readDirectory', { path, ...options });
};

export function copy(source: string, destination: string): Promise<void> {
return sendMessage('filesystem.copy', { source, destination } );
export function copy(source: string, destination: string, options?: CopyOptions ): Promise<void> {
return sendMessage('filesystem.copy', { source, destination, ...options } );
};

export function move(source: string, destination: string): Promise<void> {
Expand Down
8 changes: 7 additions & 1 deletion src/types/api/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ export interface Stats {
export interface Watcher {
id: number;
path: string;
}
}

export interface CopyOptions {
recursive: boolean;
overwrite: boolean;
skip: boolean;
}

0 comments on commit 884b374

Please sign in to comment.