mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update
This commit is contained in:
19
task.ts
19
task.ts
@@ -1,3 +1,5 @@
|
||||
import { DiscriminatedUnion } from "./utils.ts";
|
||||
|
||||
export enum TaskType {
|
||||
Download,
|
||||
ExportZip,
|
||||
@@ -11,3 +13,20 @@ export type Task = {
|
||||
pid: number;
|
||||
details: string | null;
|
||||
};
|
||||
|
||||
export type TaskDownloadProgess = {
|
||||
downloaded_page: number;
|
||||
total_page: number;
|
||||
};
|
||||
|
||||
export type TaskExportZipProgress = {
|
||||
added_page: number;
|
||||
total_page: number;
|
||||
};
|
||||
|
||||
export type TaskProgressType = {
|
||||
[TaskType.Download]: TaskDownloadProgess;
|
||||
[TaskType.ExportZip]: TaskExportZipProgress;
|
||||
};
|
||||
|
||||
export type TaskProgress = DiscriminatedUnion<"type", TaskProgressType>;
|
||||
|
||||
Reference in New Issue
Block a user