Skip to content

Commit

Permalink
update the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sinchang committed May 10, 2023
1 parent e67f064 commit c15d9ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ export type Options = {
} & Readonly<GlobOptions> & CpFileOptions; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents

export type ProgressData = {
/**
Absolute path to source.
*/
sourcePath: string;

/**
Absolute path to destination.
*/
destinationPath: string;

/**
Copied file count.
*/
Expand All @@ -135,6 +125,16 @@ export type ProgressData = {
Completed percentage. A value between `0` and `1`.
*/
percent: number;

/**
The absolute path of the current source files being copied.
*/
sourcePath: string;

/**
The absolute path of the current copied file in the destination directory.
*/
destinationPath: string;
};

export type ProgressEmitter = {
Expand Down
8 changes: 5 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,19 @@ Type: `Function`

```js
{
sourcePath: string,
destinationPath: string,
completedFiles: number,
totalFiles: number,
completedSize: number,
percent: number
percent: number,
sourcePath: string,
destinationPath: string,
}
```

- `completedSize` is in bytes
- `percent` is a value between `0` and `1`
- `sourcePath` is the absolute path of the current source files being copied.
- `destinationPath` is the absolute path of the current copied file in the destination directory.

Note that the `.on()` method is available only right after the initial `cpy` call, so make sure you add a `handler` before awaiting the promise:

Expand Down

0 comments on commit c15d9ee

Please sign in to comment.